pax_global_header00006660000000000000000000000064140416372020014511gustar00rootroot0000000000000052 comment=3227b39c58aa5f3a31f0064baa9111ff2cc11383 gnustep-back-0.29.0/000077500000000000000000000000001404163720200141645ustar00rootroot00000000000000gnustep-back-0.29.0/.cvsignore000066400000000000000000000001241404163720200161610ustar00rootroot00000000000000autom4te.cache config.h config.log config.status config.cache config.make back.make gnustep-back-0.29.0/.gitignore000066400000000000000000000003061404163720200161530ustar00rootroot00000000000000obj *.log *.sum *.bundle *.service autom4te.cache config.h config.log config.status config.cache config.make back.make Source/config.h Source/libgnustep*Info.plist Tools/XGCommonFont.m Tools/xdnd.c gnustep-back-0.29.0/ANNOUNCE000066400000000000000000000050151404163720200153160ustar00rootroot000000000000001 Announcement ************** This is version 0.29.0 of the GNUstep GUI Backend ('gnustep-back'). 1.1 What is the GNUstep GUI Backend? ==================================== It is a back-end component for the GNUstep GUI Library. The implementation of the GNUstep GUI Library is designed in two parts. The first part is the front-end component which is independent of platform and display system. This front-end is combined with a back-end component which handles all of the display system dependent such as specific calls to the X Window System. This design allows the GNUstep applications to have the "look and feel" of the underlying display system without any changes to the application, and the library can be easily ported to other display systems. The GNUstep GUI Backend is for platforms using the X-Window System or Window's Systems. It works via a DPS emulation engine to emulate the DPS functions required by the front-end system. 1.2 Noteworthy changes in version '0.29.0' ========================================== The release includes an alpha version of the wayland backend and a few bug fixes. * Alpha version of the wayland backend. * Improved focus handling for WindowMaker interaction. * Speed up for font pattern resolving. * Improved appicon behavior under WindowMaker. * Prevent appicon flickering on WindowMaker at application start. * On Windows, consistently use 'GetWindowLongPtr' and 'SetWindowLongPtr' in place of 'GetWindowLong' and 'SetWindowLong' for win32 and cairo for various win64 fixes. 1.3 Where can you get it? How can you compile it? ================================================= The gnustep-back-0.29.0.tar.gz distribution file has been placed at . It is accompanied by gnustep-back-0.29.0.tar.gz.sig, a PGP signature which you can validate by putting both files in the same directory and using: gpg --verify gnustep-back-0.29.0.tar.gz.sig Signature has been created using the key with the following fingerprint: 83AA E47C E829 A414 6EF8 3420 CA86 8D4C 9914 9679 Read the INSTALL file or the GNUstep-HOWTO for installation instructions. 1.4 Where do I send bug reports? ================================ Please log bug reports on the GNUstep project page or send bug reports to . 1.5 Obtaining GNUstep Software ============================== Check out the GNUstep web site. () and the GNU web site. () gnustep-back-0.29.0/CODEOWNERS000066400000000000000000000004701404163720200155600ustar00rootroot00000000000000# These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. * @fredkiefer Source/opal/* @ivucica @fredkiefer Headers/opal/* @ivucica @fredkiefer gnustep-back-0.29.0/COPYING000066400000000000000000001045141404163720200152240ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . gnustep-back-0.29.0/COPYING.LIB000066400000000000000000000635061404163720200156360ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, 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. Copyright (C) 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 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 Street, 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. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! gnustep-back-0.29.0/ChangeLog000066400000000000000000010275641404163720200157550ustar00rootroot000000000000002020-04-26 Ivan Vucica * ANNOUNCE: * NEWS: * README: Updating documentation for the 0.29.0 release. 2021-03-12 Fred Kiefer * Source/x11/XGServerWindow.m (-styleoffsets:...:): Change NSLog statement on guessing the offset into a NSDebugLLog statement. 2021-03-03 Riccardo Mottola * Source/win32/WIN32Server.m: actually store in a LONG_PTR the result of GetWindowLongPtr 2021-03-02 Riccardo Mottola * Source/win32/WIN32Server.m * Source/win32/w32_create.m * Source/win32/w32_general.m * Source/win32/w32_movesize.m * Source/win32/w32_windowdisplay.m * Source/winlib/WIN32GState.m * Source/cairo/Win32CairoGlitzSurface.m: Consistently use 64bit safe SetWindowLongPtr/GetWindowLongPtr instead of a mix with old 32bit versions. 2021-01-27 Sergii Stoian * Source/x11/XGServerWindow.m (_checkStyle:): do not set application name and WindowGroupHint to temporary window. Created window designed to help get window frame offsets only - appicon window will be created later. This change prevents appicon flickering on WindowMaker at application start. (_createWMAppiconHack, _setupRootWindow): WindowMaker hack removed in favour of solution introduced in _checkStyle:. 2021-01-24 Sergii Stoian * Source/x11/XGServerWindow.m: WindowMaker doesn't support _NET_REQUEST_FRAME_EXTENTS message andthe only way to determine offsets is creating and mapping window. In this case first mapped window of application is not appicon window. Early appicon creating inserted back as _createWMAppiconHack method and called only if no other way to determine window's offsets (before call to _checkStyle);appicon window size is set to size icon; 2021-01-16 Fred Kiefer * Documentation/news.texi: Fill in some details for pending release. * Version: Inclease version number. 2020-09-18 Sergii Stoian * Source/x11/XGServerWindow.m (_setupRootWindow, window::::): removed WindowMaker appicon hack and - now unused - _wmAppIcon variable. Description: The removed code removed creates and maps zero-sized window in hope that WindowMaker will recognize app by this event and create app icon window. Although when application requests window for appicon through the `-window::::` method call, it returns newly created and mapped window. This actually happens but application icon flickers between WM icon creation and application icon window appearance. This fix based on the fact that root application window (ROOT) is mapped in `-orderwindow:::` and this is the event of application recognition by WindowMaker because it is a first application window that is mapped. 2020-09-17 Sergii Stoian * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:): if application (window) receives WM_TAKE_FOCUS in hidden state it means WindowMaker wants us to be unhidden. Description: There are 2 protocols defined in XGServerWindow.h: WMFHideApplication and WMFHideOtherApplications. These protocols exist to help GNUstep application and WindowMaker notify each other about "Hide" and "Hide Others" actions. There are no protocols for "unhide" action. Test case steps: 1. Open application with window opened. 2. Hide application with "Hide" menu item. 3. Open WindowMaker's "Windows" menu (middle-click on desktop). 4. Select hidden application window. Application unhides, activates, restored window is focused (receives) input and "Hide" menu item unselected. 2020-09-16 Sergii Stoian * Source/x11/XGServerWindow.m (hideApplication:): send application's root window to WindowMaker(WM) because it's a "group leader" that clearly identifies application inside WM. WM uses XFindContext to get WApplication structure and "group leader" window ID is a key to find it. 2020-06-18 Riccardo Mottola * Tools/font_cacher.m: If the Library directory is not found, create one for the user. 2020-06-18 Riccardo Mottola * Source/xlib/XGFontManager.m Match return value in case of error (nil instead of NO) * Headers/xlib/XGPrivate.h Fix return value of width to CGFloat 2020-06-10 Fred Kiefer * Headers/fontconfig/FCFaceInfo.h: Add instancevariable _patternIsResolved. * Source/fontconfig/FCFaceInfo.m (-matchedPattern): Cache the resolved pattern and return this. The method characterSet now uses this cached pattern. Patch by Josh Freeman 2020-04-25 Ivan Vucica * Source/GSBackend.m: * Source/cairo/GNUmakefile: * Source/cairo/CairoContext.m: * Source/cairo/WaylandCairoSurface.m: * Source/wayland/GNUmakefile: * Source/wayland/GNUmakefile.preamble: * Source/wayland/WaylandServer.m: * Source/wayland/xdg-shell-protocol.c: * Source/wayland/README.md: * Headers/cairo/WaylandCairoSurface.h: * Headers/wayland/WaylandServer.h: * Headers/wayland/xdg-shell-client-protocol.h: * wayland-regenerate.h: * configure: * configure.ac: Initial merge of the Wayland backend into the master branch. 2020-04-13 Ivan Vucica * Documentation/announce.texi: * ANNOUNCE: Normalize the accompanying text for the release announcement across core packages: standardize chapter name and GPG information. 2020-04-05 Ivan Vucica * ANNOUNCE: * NEWS: * README: Updating documentation for the 0.28.0 release. 2020-03-27 Fred Kiefer * Documentation/news.texi: Fill in some details for pending release. 2020-03-12 Sergii Stoian * Source/art/GNUmakefile.preamble, * Source/gsc/GNUmakefile.preamble: do not overwrite ADDITIONAL_INCLUDE_DIRS value to help RPM build. In spec file ADDITIONAL_INCLUDE_DIRS can be sat to subdirectories which are create by RPM build tool. 2020-03-05 Sergii Stoian * Source/x11/XGServerWindow.m (placewindow::): check window frame in OpenStep and Xlib coordinate systems to decide if it was changed. Rename `xVal` into more meaninful `xFrame` (holds temporary value of window frame in Xlib coordiante system). 2020-03-03 Sergii Stoian * Headers/x11/XGServer.h, * Source/x11/XGServer.m (xScreenSize): new primitive method. * Source/x11/XGDragView.m (XY): use new primitive method to get Xlib screen height. Fixes broken DnD on vertically aligned monitors. 2020-03-01 Sergii Stoian * Source/x11/XGServerWindow.m (placewindow::): call XMoveResizeWindow even if specified frame is equal current. No events will be send to -gui for this case but X11 window position will be refreshed. It fixes misplacement of image in slideImage:from:to: (second and all subsequent calls). 2020-02-26 Sergii Stoian * Headers/x11/XGServerWindow.h (_gswindow_device_t): new structure memeber was added - `osframe`. This member intended to hold cached frame of windows in OpenStep coordinate system. This makes backend more reliable to the cases when gui changes NSWindow's _frame ivar before call to backend methods which make windows placement. * Source/x11/XGServerWindow.m (placewindow::): use `osframe` structure member to decide if window change position or size. Removed usage of temporary `frame` (used only for making desicion). 2020-02-24 Sergii Stoian * Source/x11/XGServerWindow.m (placewindow::): use window->xframe as current window frame instead of NSWindow's frame because `_frame` ivar may be already changed to desired value. 2020-02-21 Fred Kiefer * Source/x11/XGServerWindow.m (-_createAppIconPixmaps): Made preconditions of new code explicit. * Source/x11/XGServerWindow.m (-orderwindow:::): Set icon pixmap only for WindowMaker. 2020-02-20 Sergii Stoian * Headers/x11/XGServer.h (GSDisplayServer): added new ivar xScreenSize to hold Xlib screen size dimensions. * Source/x11/XGServerWindow.m: (_OSFrameToXFrame:for:): use xScreenSize instead of DisplayHeight. (_OSFrameToXHints:for:): ditto. (_XFrameToOSFrame:for:): ditto. (movewindow::): ditto. (_screenSize): new static function to get dimensions of Xlib screen from root window. (screenList): use xScreenSize instead of DisplayHeight/DisplayWidth. 2020-02-14 Fred Kiefer * Source/x11/XGServerWindow.m (screenList): Clean up implementation again. 2020-02-12 Sergii Stoian * Source/x11/XGServerWindow.m (screenList): revert back to old code logic: if XRandR available but can't get screens info for some reasons, return array with one element (Xlib screen). 2020-02-11 Sergii Stoian * Source/x11/XGServerWindow.m (screenList): Transform screen origin into unflipped (OpenStep) coordinate system for XRandR capable systems. After this change windows and screen will use the same start of coordinate system for their origins. 2020-02-08 Fred Kiefer * Source/xlib/GSXftFontInfo.m, * Source/xlib/XGFont.m, * Source/xlib/XGFontManager.m, * Source/xlib/XGFontSetFontInfo.m, * Source/xlib/XGGState.m, * Source/xlib/XGGeometry.m : Fixes after Xrandr change to get xlib backend to compile again. 2020-02-08 Fred Kiefer * Source/x11/XGServerWindow.m (screenList): Clean up implementation. 2020-02-07 Sergii Stoian * Source/x11/XGServerWindow.m (_XFrameToOSFrame:for:): use Xlib screen height instead of monitor's because we convert coordinates from Xlib area. (movewindow::): use Xlib screen height because we're operating in Xlib coordinate system. (screenList): fill monitor depth with value returned by windowPathForScreen with monitor at index 0 (screen_id already set so method will get correct screen_id). * Source/x11/XGServerEvent.m (processEvent:): fixed indentaion. 2020-02-07 Fred Kiefer * Source/x11/XGServerWindow.m (swapColors): Made code more explicit and removed additional copy before calling this function. This function should now do what the comment above it says. (alphaMaskForImage): Slightly cleaner code. * Source/x11/XGServerEvent.m: Prevent compiler warning by moving method. 2020-02-07 Sergii Stoian * Source/x11/XGServerWindow.m (_OSFrameToXFrame:for:):, (_OSFrameToXHints:for:): use Xlib screen height instead of monitor's because we convert coordinates to Xlib area. * Source/x11/XGServerEvent.m (processEvent:): update monitor_id from NSWindow's screen number (it could change after event processing). (mouseLocationOnScreen:window:): use Xlib screen height instead of monitor's. Added comment to code that should be probably removed later. 2020-02-03 Sergii Stoian * Source/x11/XWindowBuffer.m (windowBufferForWindow:depthInfo:): use renamed XGServer's `screenVisual` and `screenDepth` methods. * Source/x11/XIMInputServer.m (initWithDelegate:name:): use `+xDisplay` instead of `xCurrentDisplay`. (clientWindowRect:): ditto. * Headers/x11/XGServerWindow.h (_gswindow_device_t): renamed `screen` to `screen_id`. `monitor_id` element was added - this is an index of element in MonitorDevice array. * Source/x11/XGServerWindow.m: Removed `screen` parameter from methods which contains it in name. Methods were renamed to remove `Screen` and `FromScreen`. (_OSFrameToXFrame:for:): use `monitor_id` instead of `screen`. (_OSFrameToXHints:for:): ditto. (_XFrameToOSFrame:for:): ditto. (_checkStyle:): use renamed methods and `screen_id` window structure element. (_rootWindow): renamed from _rootWindowForScreen:, use `defScreen` instead of removed parameter `screen`, set window structure element `monitor_id` to 0. (_createBuffer:): use `screen_id` window structure. (window::::): use renamed methods, `defScreen`, `screen_id` and `monitor_id` window scructure elements. (nativeWindow:::::): ditto. (setbackgroundcolor::): ditto. (miniwindow:): ditto. (_createAppIconPixmaps): removed unused `screen` local variable, use renamed `screenRContext` method. (orderwindow:::): use `screen_id` window structure element. (movewindow::): use `screen_id` window structure element as a parameter to `boundsForScreen`. (windowbounds:): ditto. (windowlist): use renamed `_rootWindow` method. (setMouseLocation:onScreen:): user renamed methods. (_blankCursor): ditto. (imagecursor:::): ditto (recolorcursor:::): ditto. (screenList): change with assumption that Xlib screen is one per application. Failback code to RandR-related always creates arrays with one element (no enumeration needed). Create `monitor` structure in failback (non-RandR) code. Use `screen_id` MonitorDevice structure element to hold Xlib screen ID. (windowDepthForScreen:): assume that `screen` parameter is a Xlib screen ID, simplify code - `screen` will be used with RandR or not. (availableDepthsForScreen:): changed with assumption that `screen` is a index of element in `monitors` structure. * Source/x11/XGServerEvent.m: use renamed methods and `screen_id` window structure element. * Headers/x11/XGServer.h Removed `screen` parameter from methods which contains it in name. Methods were renamed to remove `Screen` and `FromScreen`. (MonitorDevice): `screen_id` was added. * Source/x11/XGServer.m: use `screen_id` and rename mathods according to XGServer,h. (_initXContext): initialize `monitors` array early here before first use (calls to XGServerWindow methods). * Source/x11/XGDragView.m (XDPY): use `monitor_id` in `boundForScreen:` call. * Source/cairo/XGCairoSurface.m: use `xDisplayRootWindow` XGServer's method. * Source/art/ARTContext.m (setupDrawInfo:): use `xDisplayRootWindow` XGServer's method. 2020-01-31 Sergii Stoian * Source/x11/XGServerWindow.m (boundsForScreen:): check for number of XRandR's ouputs. 2020-01-31 Riccardo Mottola * Source/x11/XGServerWindow.m (boundsForScreen:): Check if Xrandr did not succeed and provide fallback. 2020-01-31 Sergii Stoian * Source/x11/XGServerWindow.m (screenList): join RandR and non-RandR code. Failback to Xlib generic method if any no RandR available or RandR function call was unsuccessful. In Xlib generic method fill in monitors array with values. (boundsForScreen:): use values from cached `monitors` array since -screenList fills it on both cases with or without RandR available. 2020-01-30 Sergii Stoian * Headers/x11/XGServer.h: new structure `MonitorDevice` and ivar `monitors`for holding cache of monitor's parameters (depth, resolution, frame). New ivar `monitorsCount` - holds number of items in `monitors` for RandR or X11 screen count otherwise. * Source/x11/XGServerWindow.m (screenList): new method for RandR mode - enumerates monitors and caches their parameters. Returns array of monitors' indices to get access to monitors` items. (boundsForScreen:): use cached `frame` parameter of specified monitor. Use `monitorsCount` instead of ScreenCount(). (windowDepthForScreen:): renamed method parameter; append `x_` prefix to `Screen *` internal variable; validate `screen` parameter value; use `defScreen` for RandR enabled code. (availableDepthsForScreen:): ditto. (resolutionForScreen:): renamed method parameter; validate `screen` parameter value. (boundsForScreen:): renamed method parameter. * Source/x11/XGServer.m (dealloc): free `monitors` if it was used. 2020-01-26 Sergii Stoian * Source/x11/XGServerWindow.m (boundsForScreen:): use `screen` variable to identify output in RandR screen resources. Use `boundsRect` local variable as return vaalue storage. Cleanup. * Source/x11/XGServerEvent.m (processEvent:), * Source/x11/XGServer.m (_initXContext): catch and process RandR event on default screen. 2020-01-24 Sergii Stoian * Source/x11/XGServerWindow.m (_OSFrameToXFrame:for:): use -boundsForScreen: to get correct screen dimensions if RandR is supported. (_OSFrameToXHints:for:): ditto. (_XFrameToOSFrame:for:): ditto. (movewindow::): ditto. (windowbounds:): ditto. (setMouseLocation:onScreen:): ditto. * Source/x11/XGDragView.m: ditto. * Source/x11/XGServerEvent.m (processEvent:): destroy NSScreen screens list to be regenereated on next call. This change updates ivars of NSScreen (_frame, _depth) by recreating NSScreen instances. (mouseLocationOnScreen:window:): use -boundsForScreen: to get correct screen dimensions if RandR is supported. 2020-01-23 Sergii Stoian * Headers/x11/XGServer.h (GSDisplayServer): RandR event and error base ivars were added. * Source/x11/XGServer.m (_initXContext): get RandR event and error base. * Source/x11/XGServerWindow.m (boundsForScreen:): if Xrandr support enabled get screen dimensions using Xrandr objects. * Source/x11/XGServerEvent.m (processEvent:): process Xrandr event and send NSApplicationDidChangeScreenParametersNotification. * Source/x11/XGServer.m (_initXContext): subscribe to the Xrandr event. 2020-01-22 Sergii Stoian * configure.ac: check for availability of Xrandr library. * config.h.in: added default value for Xrandr usage. * configure: regenerate. 2020-01-17 Sergii Stoian * Source/art/shfill.m:, * Source/art/path.m:, * Source/art/image.m (DPSimage:::::::::::): fixed type formatting specifiers. * Source/art/ftfont.m: removed include to ftfont-old.m. (drawString:at::to::::::::color::::transform:deltas:::widthChar:drawinfo:):, (drawGlyphs::at::to::::::color::::transform:drawinfo:):, (drawGlyphs::at::to::::::alpha::color::::transform:drawinfo:):, (bezierpath_funcs):, fixed type formatting specifiers; moved interface declaration of FTFontInfo to ftfont.h; removed GCCism. * Source/art/ftfont.h: moved interface declaration of FTFontInfo here. * Source/art/composite.m: fixed type formatting specifiers. * Source/art/FTFontEnumerator.m (load_font_configuration): fixed type formatting specifiers. 2020-01-16 Sergii Stoian * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:): use lowerCamelCase for objects and underscores for primitive types; do not ignore TakeFocus request if no key window was set and main application menu receives request. 2020-01-14 Sergii Stoian * Source/x11/XGServerWindow.m (alphaMaskForImage): renamed from image_mask(). (swapColors): new function to convert colors from ARGB order into RGBA (big-endian systems) or BGRA (little-endian systems). (_createAppIconPixmaps): use swapColors() and remove unused code. (restrictWindow:toImage:): use alphaMaskForImage(). (imagecursor:::): use swapColors() and remove unused code. (ALPHA_THRESHOLD): removed duplicate of definition. 2020-01-13 Sergii Stoian * Source/x11/XGServerWindow.m (_createNetIcon:result:size:): fixed off-by-one mistake during alpha handling. Enable disabled code and remove temprorary one. (window::::): set NetWM icon to window for all EWMH capable WMs even it's WindowMaker. (image_mask): new function to create alpha mask for image. It's based on xgps_cursor_mask() code with additional argument `alpha_treshold`. This function may be used for images (alpha_treshold == 0) with real alpha mask and for cursors (if no Xcursor library is used - no alpha is used, no shadows in cursors, alpha_treshold == 158 is used to cut transparent pixels). (_createAppIconPixmaps): icon pixmap creation rewritten to support images with alpha channel using wraster functions. Use image_mask(). (restrictWindow:toImage:): use image_mask() instead of xgps_cursor_mask(). (xgps_cursor_mask): removed as image_mask() replaced it. Guard xgps_cursor_image( with #if - will not be compiled if Xcursor is used. (imagecursor:::): use image_mask() instead of xgps_cursor_mask(). 2019-12-24 Fred Kiefer * Source/cairo/CairoFontInfo.m: Revert to the old defaults for hinting and allow for all possible values to be set. 2019-05-19 Fred Kiefer * Source/cairo/CairoFontInfo.m, * Source/fontconfig/FCFontEnumerator.m: Small cleanup of last pull request. 2019-05-19 Fred Kiefer * .gitignore: Add copied files as they should never be commited. * Headers/fontconfig/FCFaceInfo.h: Add method displaName. * Source/art/FTFontEnumerator.m: Retain the display name. * Source/fontconfig/FCFaceInfo.m, * Source/fontconfig/FCFontInfo.m, * Source/art/ftfont.m: Implement the method displayName. * Source/cairo/CairoFontInfo.m: Enable font hinting and use subpixel antialias if the variable back-art-subpixel-text is set. * Source/fontconfig/FCFontEnumerator.m: Better handling of font names, weight and the order of fonts. Merged huge pull request by Jeff Teunissen 2019-04-20 Sergii Stoian * Source/x11/XGServerWindow.m (standardcursor::): Getting of XC_fleur as GSCloseHandCursor was removed because it loads in NSCursor as image. 2019-04-18 Sergii Stoian * Source/x11/XGServerWindow.m (standardcursor::): revert resizing cursor names to the old values upon request of project owner. 2019-04-17 Sergii Stoian * Source/x11/XGServerWindow.m (getStandardBitmap): send `bitmapFormat` to _convertToFormatBitsPerSample::::::::. Fixes display of colored mouse cursor images. (standardcursor::): cleanup in Xlib cursors handling. Additional cursor types were added: GSClosedHandCursor, GSOpenHandCursor. Removed GSDisappearingItemCursor type handling - it loads in NSCursor from image. 2019-04-12 Sergii Stoian * Source/x11/XGServerEvent.m (mouseOptionsChanged:): change double-click minimum value to 200 and default to 300. 2019-04-11 Sergii Stoian * Source/x11/XGServerEvent.m (processEvent:): do not send event if disabled menu mouse button was released. 2019-04-11 Sergii Stoian * Source/x11/XGServerEvent.m (initializeMouse): new method. Calls -mouseOptionsChanged: and setups observer for defaults changes. (mouseOptionsChanged:): new method. Read mouse properties from user defaults. (processEvent:): respect mouse options on ButtonPress and ButtonRelease events. * Source/x11/XGServer.m (dealloc): remove notification observer. 2019-04-06 Sergii Stoian * Source/x11/XGServerWindow.m (hideApplication:): new method name for `hidewindow`. 2019-04-05 Sergii Stoian * Headers/x11/XGServerWindow.h (GSMaxWMProtocols): increased number to support WMFHideApplication. * Headers/x11/XGGeneric.h: Atoms _WINDOWMAKER_WM_FUNCTION, _GNUSTEP_WM_HIDE_APP were added. * Source/x11/XGServerWindow.m (_setSupportedWMProtocols:): added _GNUSTEP_WM_HIDE_APP protocol suport to the window protocols. (hidewindow:): implementation of GSDisplayServer method. * Source/x11/XGServerEvent.m (processEvent:): process _GNUSTEP_WM_HIDE_APP client message. 2019-04-04 Sergii Stoian * Source/x11/XGServerEvent.m (processEvent:): Send double-click on appicon to the WindowMaker. 2019-04-02 Sergii Stoian * Source/x11/XGServerWindow.m: (orderwindow:::) Map application icon window without focus flickering for applications executed with argument `-autolaunch YES` in WindowMaker environment. 2019-03-26 Sergii Stoian * Source/x11/XGServerWindow.m: (setwindowlevel::) Set `Utility` window type for NSFloatingWindowLevel. 2019-01-04 Fred Kiefer * Documentation/news.texi: Fill in some details for pending release. 2019-01-04 Fred Kiefer * Source/opal/OpalGState.m: Add colour handling for all the different colour spaces. 2018-12-31 Pavel Shlyak * Source/x11/convert.c: Don't leak memory on error handling 2018-12-02 Fred Kiefer * Source/gsc/GSGState.m (-setColor:state:): Don't copy values onto themselves. 2018-09-16 Fred Kiefer * Source/opal/OpalContext.m (-initWithGraphicsPort:flipped:): Implement. * Source/opal/OpalContext.m (-GSSetDevice:::): Get height from surface if no y value is given. * Source/opal/OpalSurface.m: Rewrite to handle the case where device is not set. 2018-07-16 Fred Kiefer * Source/x11/XGServerWindow.m (_setupRootWindow): Make sure the root name variable is null terminated. 2018-06-20 Fred Kiefer * Source/x11/XGServerWindow.m: Check for bytes_after_ret in PropGetCheckProperty. Attempt to improve the window border detection. Based on idea by Tom MacSween 2018-05-01 Fred Kiefer * Headers/x11/XGGeneric.h: Move all atoms in XGGeneric data structure. * Source/x11/XGServerEvent.m, * Source/x11/XGServerWindow.m: Use atoms from XGGeneric. * Headers/x11/XGServer.h, * Source/x11/XGServerEvent.m (-windowManagerName): New method to get the name of the window manager. 2018-03-03 Riccardo Mottola * configure.ac * configure Be consistent in prepending flags to existing LDFLAGS and CPPLFLAGS. 2018-02-25 Yavor Doganov * Tools/font_cacher.1: New file. * Tools/GNUmakefile: Build font_cacher only if WITH_XFT=no. Install the manpage conditionally. * configure.ac: Add deprecation warning for art/xlib/xdps. * configure: Regenerate. 2018-02-09 Yavor Doganov * Source/x11/XGServer.m (_initXContext): Call XInitThreads to enable drawing in secondary threads. 2018-02-05 Yavor Doganov * Headers/xlib/GSXftFontInfo.h (GSXftFontInfo): Inherit from the FCFontInfo class. (GSXftFaceInfo, GSXftFontEnumerator): New classes inheriting from FCFaceInfo and FCFontEnumerator. * Source/xlib/GSXftFontInfo.m: Assume fontconfig is available; remove HAVE_FC define and !HAVE_FC code. (allFonts): Remove. (FcFont, FcFontEnumerator): Remove implementations. (GSXftFontEnumerator): Override +faceInfoClass and +fontWithName:. (Ones, coveredCharacterSet): Remove, not needed anymore. (advancementForGlyph:): Add support for glyph caching. (setupAttributes): Obtain pattern from the GSXftFaceInfo instance. Remove unnecessary code for setting ivars already set by the superclass. Set lineHeight to capHeight. * Source/xlib/XGContext.m (initializeBackend) [HAVE_XFT]: Remove HAVE_FC conditional. Set fontEnumerator to GSXftFontEnumerator. * Source/xlib/GNUmakefile (xlib_OBJC_FILES): Add fontconfig files in the WITH_XFT conditional. 2018-01-21 Yavor Doganov * configure.ac: Add FREETYPE_LIBS to LIBS when building xlib. * configure: Regenerate 2018-01-20 Yavor Doganov * configure.ac: Detect freetype with PKG_CHECK_MODULES. * configure: Regenerate. 2018-01-03 Yavor Doganov * pkg.m4: Update to serial 12. * configure.ac: Use PKG_PROG_PKG_CONFIG to detect pkg-config. Remove all PKG_* shell variables. * configure: Regenerate. 2018-01-01 Ivan Vucica * ANNOUNCE * Documentation/news.texi * NEWS * README * Version: Releasing 0.26.2 to coincide with the -gui release. 2017-12-21 Ivan Vucica * ANNOUNCE * Documentation/news.texi * README * Version * NEWS: Releasing 0.26.1 to coincide with the -gui release. 2017-12-10 Ivan Vucica * ANNOUNCE * Documentation/news.texi * README: Added release notes to news.texi and regenerated the rest for 0.26.0 release. 2017-10-01 Ivan Vucica * Documentation/news.texi: Add stub 0.26.0 entry. * Version: Bump to 0.26.0. 2017-07-17 Daniel Ferreira * Source/opal/GNUmakefile: add OpalBridge.m to project. * Source/opal/OpalBridge.m: Implement a bridge between NSColor and CGColorRef and a stub for a bridge between NSImage and CGImageRef. This improves compatibility with Quartz. 2017-07-17 Daniel Ferreira * Headers/opal/OpalSurface.h * Source/opal/OpalContext.m * Source/opal/OpalSurface.m: In Quartz, the "graphics port" bound to an NSGraphicsContext (subclassed by OpalContext) is a CGContext. We currently initialize one in OpalSurface if it does not exist, however we do not allow the client to initialize a graphics context with a custom graphics port, which should be allowed. We have enabled this feature. 2017-07-31 Fred Kiefer * Source/cairo/CairoGState.m (-DPSshow:): Get DPSshow: to work on scaled windows. 2017-04-16 Fred Kiefer * Source/gsc/GSGState.m * Source/x11/XGDragView.m * Source/x11/XGServerWindow.m * Source/x11/XWindowBuffer.m Fix some clang static analyser warnings reported by Sebastian Reitenbach . 2017-04-04 Ivan Vucica * Releasing 0.25.1. 2017-01-17 Fred Kiefer * Headers/x11/XGGeneric.h: Remove obsolte atom. * Source/x11/XGServerWindow.m: Clean up code. * Source/x11/XGServerWindow.m (-setwindowlevel::): Try to set better level for tool tip windows. 2017-01-08 Fred Kiefer * Source/x11/XGServerWindow.m (-_checkStyle:): Ignore invalid border information. 2016-08-02 Fred Kiefer * Source/opal/OpalFontInfo.m Correct the calculation of line height. * Source/opal/OpalGState.m Adjust font placement to changed height. * Source/opal/OpalSurface.m Better debug output. 2016-07-15 Fred Kiefer * Source/gsc/GSStreamContext.m: Output the Postscript font name. 2016-06-16 Ivan Vucica * ANNOUNCE: * NEWS: * README: * Version: Releasing 0.25.0. 2016-04-28 Ivan Vucica * Headers/cairo/Win32CairoGState.h: Partially applying r39615 from testplant branch to fix a build error on MinGW. Patch by Seong-Gu Lee . 2016-04-06 Ivan Vucica * Source/gsc/GSGState.m: Remove extraneous semicolons. Patch by mlytwyn (cherrypicked from testplant branch, r39614). * Source/cairo/Win32CairoGState.m: Implement dealloc/copyWithZone on Win32CairoGState instance. Patch by mlytwyn (cherrypicked from testplant branch, r39618). * Source/gsc/GSGState.m: Add return type 'id' to -[GSGState copyWithZone:] method definition. Patch by mlytwyn (cherrypicked from testplant branch, r39619). 2016-03-01 Seong Gu Lee * Headers/win32/WIN32Server.h: tweak for compilation on 64bit windows 2015-12-13 Fred Kiefer * Source/opal/OpalFontInfo.m Prevent a compiler warning. * Source/opal/OpalGState.m * Source/opal/OpalSurface.m Correct the bitmap flags used. Add a few missing function calls. 2015-11-25 Riccardo Mottola * configure * configure.ac * config.h.in Specifically check for X11/extensions/sync. * Headers/x11/XGServer.h * Headers/x11/XGServerWindow.h * Source/x11/XGServer.m * Source/x11/XGServerEvent.m * Source/x11/XGServerWindow.m Enable Sync only on explicit presence of sync.h, not just Xext. 2015-11-13 Wolfgang Lux * Source/x11/XGServerWindow.m (_setupRootWindow, window::::): Create an empty app icon window before eventually checking the window frame offsets when using WindowMaker. This fixes the issue that the first GNUstep application started under WindowMaker did not get a proper application menu. 2015-11-03 Fred Kiefer * Source/x11/XGServerEvent.m (-processEvent:): For repeated keys only eat up the KeyRelease events and pass on all KeyPress. 2015-10-28 Fred Kiefer * Source/cairo/CairoGState.m (-GSReadRect:, -DPSimage:..:): Drawing speedup for slow machines. Patch by Josh Freeman 2015-10-16 Fred Kiefer * Source/x11/XGServerEvent.m (-processEvent:): Move repeate key detection from process_key_event() to here to enable filtering out keyUp events as Cocoa does. 2015-10-09 Fred Kiefer * Source/gsc/GSContext.m: Set some defaults. 2015-10-03 Fred Kiefer * Headers/gsc/GSGState.h * Source/gsc/GSContext.m * Source/gsc/GSGState.m * Source/cairo/CairoGState.m Implement per gstate methods for antialias, patternPhase and compositingOperation. 2015-09-20 Fred Kiefer * Source/cairo/CairoGState.m: Preliminary support for anti alias setting for path drawing. 2015-08-13 Fred Kiefer * Source/win32/WIN32Server.m (process_char): Fix bug that caused F11 keypresses to become F12. Patch by Adam Fox 2015-06-05 Fred Kiefer * configure.ac: Fix configure for mingw * configure: Regenerated Patch by Marcian Lytwyn 2015-05-26 Sebastian Reitenbach * Source/cairo/CairoGState.m abs -> fabs * Source/x11/XGGLContext.m format string fix * Headers/x11/XGOpenGL.h glxminorversion is int, not long int 2015-05-22 Fred Kiefer * Source/cairo/CairoGState.m: Add support for image interpolation setting in context. Patch by Josh Freeman 2015-05-22 Fred Kiefer * Source/gsc/GSGState.m (_fillRect:withPattern:): Add support for patternPhase. Patch by Josh Freeman 2015-05-18 Riccardo Mottola * GNUmakefile.postamble Correctly run config.status again. 2015-05-16 Richard Frith-Macdonald * Documentation/news.texi: * ANNOUNCE: * NEWS: * README: * Version: Bugfix release 0.24.1 2015-05-13 Riccardo Mottola * configure.ac Copied from base: only warn if compiler is different from the one configured in make * configure regenerated 2015-05-12 Riccardo Mottola * configure.ac pick up gnustep make configured CC, CPP, CXX and check they are consistent with how make was configured * configure regenerated 2015-03-31 Germán Arias * Source/win32/WIN32Server.m (-windowEventProc:, -process_mouse_event:): Start tracking the mouse at the first mouse movement (as suggested in a note at MSDN documentation) so the window receives the WM_MOUSELEAVE message when the mouse leave the client area. I don't use the message WM_NCMOUSEMOVE, as suggested by Fred, because when the user moves fast the mouse this messages is not generated. But we receive the WM_MOUSELEAVE message no matter if the mouse move fast or not. This approach make unnecessary handle the message WM_NCMOUSEMOVE. I also remove a redundant line in WM_MOUSELEAVE. 2015-03-23 Germán Arias * Source/win32/WIN32Server.m (-windowEventProc:, -process_mouse_event:): Add code to handle the case when the mouse leave the window, move over a nonclient area, update the cursor or when the user open a contextual menu. Also handle the first mouse movement inside the window and save the cursor if we should preserve it between different windows. Sometimes there is a problem with the cursor if the user open a contextual menu after resize the window. But this seems other issue. 2015-03-22 Fred Kiefer * Source/x11/XGServerEvent.m (-processEvent:): Reenable Richard's frontend based expose code. * Source/x11/XGServerWindow.m (-window::::, -_checkStyle:): Don't use CWBackPixel, as the window background may be different. 2015-03-21 Fred Kiefer * Headers/x11/XGGeneric.h * Source/x11/XGServerWindow.m: Correct name for atom net_wm_state_modal_atom. Use this atom to try to set the state for dialog windows to modal. 2015-02-27 Germán Arias * Source/cairo/CairoContext.m (-flushGraphics:): * Source/cairo/Win32CairoSurface.m (-initWithDevice:): Apply fix from TestPlant branch to solve problem with windows with backing store type NSBackingStoreRetained, which are not displayed correclty on MS Windows. With this fix those windows are displayed as buffered windows. * Source/win32/WIN32Server.m (-setWindowdevice:forContext:): The windows with autodisplay set to NO aren't displayed correctly on Windows, no matter the backing store type used. And trying to redisplay these windows here in the server not takes effect. So if the window have set autodisplay to NO, we change it to YES before create the window. This problem affects the tooltips, but this solution is different to the one used in the TestPlant branch. Because that solution involves changes in the side of GUI. 2014-10-25 Fred Kiefer * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Disable workaround for cairo > 1.8 for cairo > 1.13. Patch by Edwin Ancaer 2014-05-24 Fred Kiefer * configure.ac: Fix wrong assumption about Xft's .pc file that leads to build failure with -Wl,--no-undefined. Patch by Yavor Doganov 2014-05-07 Fred Kiefer * Tools/gpbs.m: Revert last change and correct the implementation and usage of gpbs_log. 2014-05-06 Ivan Vucica * Tools/gpbs.m: Removed barely used, overly complex and almost certainly buggy logging code. 2014-05-05 Ivan Vucica * ChangeLog: Corrected year for some recent commits. * GNUmakefile: Added use of Master/deb.make. * gnustep-back.spec.in: Added some details needed for Debian packaging. 2014-01-27 Fred Kiefer * Source/win32/WIN32Server.m (LoadDisplayMonitorInfo): Switch monitor logging to Debug level. Patch by Jonathan Gillaspie 2014-01-19 Fred Kiefer * Source/art/blit.m(MPRE): Remove compiler warning. * Source/art/image.m(-DPSimage:::::::::::): Correct parameter types. Fixes bug #41274. 2014-01-08 Fred Kiefer * configure: Remove duplicate addition of Xext. * configure.ac: Regenerate. 2014-01-05 Niels Grewe * Source/x11/XGServerWindow.m: Remove redundant method. 2014-01-05 Fred Kiefer * Source/x11/XGServerWindow.m(-_checkStyle:): Change NSLog into NSDebugLLog. 2014-01-01 Niels Grewe * Source/x11/XGServerWindow.m: Implement method to get the XWindow ID of the a window from its window number. 2013-12-29 Fred Kiefer * Source/cairo/CairoGState.m (-GSSetFont:), * Source/cairo/CairoFaceInfo.m (-drawGlyphs:...): Use scaled font directly. 2013-12-26 Fred Kiefer * Source/xlib/GSXftFontInfo.m * Source/xlib/XGFontManager.m * Source/xlib/XGBitmap.m: Remove some compiler warnings. 2013-12-24 Richard Frith-Macdonald * Version: bump to 0.24.0 2013-12-23 Fred Kiefer * Update release notes to prepare for upcoming release. 2013-12-23 Fred Kiefer * Source/cairo/CairoFaceInfo.m (-fontFace): Warn about the usage of non-scalable fonts. 2013-12-18 Fred Kiefer * Source/x11/XGServerWindow.m (-_createBuffer, -windowbacking::, -setWindowdevice:forContext:): Move code from last patch around a bit. 2013-12-18 Eric Wasylishen * Source/x11/XGServerWindow.m (-_createBuffer): Fix a big memory leak noticed by Riccardo with the cairo backend, by #ifdef-ing out this method when using cairo. 2013-12-13 Fred Kiefer * Source/x11/XGDragView.m (-_xWindowAcceptingDnDDescendentOf:...): Correct to work with kwin window decoration. 2013-12-13 Fred Kiefer * Tools/xpbs.m (-xProvideSelection:): Leave enough space for all possible types. * Source/x11/XGDragView.m: Simplify D&D window detection code. 2013-09-29 Fred Kiefer * Headers/opal/OpalSurface.h * Source/opal/OpalSurface.m: Make the -device method public. * Headers/opal/OpalContext.h: Remove method definitions. * Source/opal/OpalContext.m: Limit the accepted image types. 2013-09-29 Fred Kiefer * Headers/opal/OpalSurface.h * Source/opal/OpalSurface.m: Remove compiler warnings. * Source/opal/OpalContext.m: Move -flushGraphics method to here. * Source/opal/OpalGState.m: Simplify -DPSimage. Evaluate CGCTX only once per method. 2013-09-29 Fred Kiefer * Headers/opal/OpalGState.h: Clean up to reduce warnings. * Source/opal/OpalGState.m: Add missing path and matrix methods. Remove warnings. Remove unneeded code. Reorder code to allow for easier comparison with GSGState. * Source/opal/OpalContext.m: Add missing includes to get shm completion working. Adjust to changes in OpalGState. 2013-09-23 Eric Wasylishen * Source/opal/OpalGState.m: move variable declaration outside of for loop 2013-09-23 Ivan Vucica * Source/opal/OpalGState.m: Fixed a compile error (extra #endif). Added -DPSsetdash:::. Added stub -DPSsetstrokeadjust:. 2013-09-23 Ivan Vucica * Source/opal/OpalGState.m: * Source/opal/OpalSurface.m: Cutting down on junk code and unneeded output. 2013-09-23 Ivan Vucica * Source/opal/OpalContext.m: Once again pretending we're not drawing on screen. This is a temporary fix for -DPSimage:. -DPSgsave is now passed on to current gstate before GSContext is given chance to replace it. Changes relating to rename of OpalSurface and OpalGState methods -cgContext to -CGContext. * Source/opal/OpalGState.m: Apparently mostly functional -compositeGState:. Includes disabled modification of code from CairoGState. Apparently functional -drawGState. -DPSsetlinecap: stub (need to match linecap constants.) -DPSsetmiterlimit:. Extended -copyWithZone: to assign a 'default' OpalGStateRef to the newly copied gstate in case we currently have no context. This is done by creating a context and copying whatever's in that context onto the new OpalGState. Improved -DPSinitgraphics by setting the device offset that was set here and calling CGContextSaveGState() as many times as it was supposed to be called while CGContext did not exist. Noted that we should, instead of recreating contexts, just reset the internal GState of Opal. Added -GSSetCTM:. -flushGraphics no longer 'flushes' rect 0,0,1024,1024. Now it instead queries surface for its size. In case surface exists but not the CGContext, -DPSgsave creates it. Otherwise, it records that gsave should be run upon context creation. Added -DPSsetlinewidth:. Changes relating to rename of OpalSurface and OpalGState methods -cgContext to -CGContext. * Source/opal/OpalSurface.m: Added reminder of how we should handle recreation of CGContexts. Disabled non-doublebuffered windows. (We always need a backing CGBitmapContext so we can implement -compositeGState: and -drawGState:. Added accessors -x11CGContext and -backingCGContext. Fixed bug where sometimes we'd get incorrect expose values and would try to incorrectly copy the backing image, stretching the resulting on-screen image. Added -size accessor. * Headers/opal/OpalGState.h: Some accessors. _CGContextSaveGStatesOnContextCreation ivar. * Headers/opal/OpalSurface.h: New and renamed accessors. 2013-09-19 Ivan Vucica * Source/opal/OpalContext.m: Added GState switcher -DPSsetgstate:. See description of _opGState in OpalGState.h. * Headers/opal/OpalGState.h: Added _opGState i-var and relevant accessors. * Source/opal/OpalGState.m: Instead of yellow rectangle, -compositeGState:... method *should* now be painting doublebuffered content from the 'other' GState, but sadly does not. This needs debugging. Implemented -copyWithZone:. See description of _opGState in OpalGState.h to see how and why is _opGState used in this class, how it is being copied and why it's alright to keep it nil during -init and even after -DPSinitgraphics, but needs to be set in -copyWithZone:. Added -setOPGState: and -OPGState accessors for the _opGState field. 2013-09-18 Ivan Vucica * Source/opal/OpalSurface.m: Enabled doublebuffering. Fixed some debug code, disabled some other debug code. 2013-09-17 Eric Wasylishen * Source/opal/OpalFontInfo.m: Use new OPFontGetGlyphWithCharacter to properly look up the glyph for a character. 2013-09-17 Ivan Vucica * Source/opal/OpalFontInfo.m: Removed some dead code. * Source/opal/OpalGState.m: Fixed erroneous offset of glyphs by taking -defaultLineHeightForFont, multiplying by 0.66, and adding that to pt.y. No idea why 0.66 is the right number. 2013-09-17 Ivan Vucica * Source/opal/OpalContext.m: Added note that -supportsDrawGState should be implemented. * Source/opal/OpalGState.m: Fixed temporary code for painting colored rectangles in place of text. Partially fixed -GSShowGlyphsWithAdvances::: by removing temporary code for painting colored rectangles, and by setting text matrix in GSSetFont:. 2013-09-17 Eric Wasylishen * Source/opal/OpalFontInfo.m: Move font space to user space conversion to a separate method. Implement -glyphIsEncoded:, -advancementForGlyph:, -glyphForCharacter:, -glyphWithName:. For -boundingRectForGlyph:, and -widthOfString:, return fake, fixed values. * Source/opal/OpalContext.m: Fix -isDrawingToScreen implementation; it now returns YES. This has the unfortunate side effect of breaking image drawing... but, on the positive side, causes NSLayoutManager to make calls to GSShowGlyphsWithAdvances in batches of up to 16 glyphs, instead of one at a time...! * Source/opal/OpalGState.m: Implement -GSSetFont:, and make -GSShowGlyphsWithAdvances: call CGContextShowGlyphsWithAdvances Overall state is glyphs are drawn.. they appear upside down, and the glyph runs only seem to draw at (0, 0). 2013-09-17 Ivan Vucica * Source/opal/OpalFontInfo.m: Fixed scale of metrics by using unitsPerEm and pointSize. 2013-09-17 Ivan Vucica * configure: * configure.ac: Added fontconfig and freetype as dependencies for Opal. configure script is not actually regenerated from configure.ac and contains a simplified piece of code which just appends relevant options to CPPFLAGS and LIBS. * Source/opal/GNUmakefile: Added fontconfig/ implementation files, like it was done in cairo backend. * Headers/opal/OpalFaceInfo.h: * Source/opal/OpalFaceInfo.m: Now copied from CairoFaceInfo and modified to use Core Graphics. * Headers/opal/OpalFontInfo.h: * Source/opal/OpalFontInfo.m: Now copied from CairoFontInfo. Starting modifying to use the Core Graphics. Currently font metrics are not correctly scaled. * Source/opal/OpalFontEnumerator.m: * Headers/opal/OpalFontEnumerator.h: Now copied from CairoFaceInfo. Modified to use the classes in the Opal backend. * Source/opal/OpalGState.m: Added DPSrlineto:: and DPSrmoveto::. * Source/fontconfig/FCFontInfo.m: * Headers/fontconfig/FCFontInfo.h: Removed a cairo-backend-specific method. 2013-09-10 Ivan Vucica * Source/fontconfig/FCFontInfo.m: * Source/fontconfig/FCFontEnumerator.m: * Source/fontconfig/FCFaceInfo.m: * Headers/fontconfig/FCFontInfo.h: * Headers/fontconfig/FCFontEnumerator.h: * Headers/fontconfig/FCFaceInfo.h: * Source/cairo/CairoFontEnumerator.m: * Source/cairo/CairoFaceInfo.m: * Source/cairo/CairoFontInfo.m: * Headers/cairo/CairoFontInfo.h: * Headers/cairo/CairoFontEnumerator.h: * Headers/cairo/CairoFaceInfo.h: In preparation for reusing this code in the Opal backend, moved fontconfig code to a dedicated set of classes that are now superclasses of Cairo backend's font classes. * Source/cairo/GNUmakefile: Added fontconfig font classes directly to GNUmakefile for Cairo backend. It would be better if these had something like their own distinct GNUmakefile that produces a static library which would then be linked into Cairo. But the only backends that will use this are, for now, Cairo and Opal. So the ugliness and extra maintenance in case more classes are added should be, for now, acceptable. * Source/cairo/CairoGState.m: Fixed a mistake in a NSDebugMLLog() call's format. A percentage symbol was placed before word "self", resulting in compiler's interpretation as "%s". 2013-09-10 Eric Wasylishen * Source/x11/XIMInputServer.m: If the requested XIM style (the GSXIMInputMethodStyle user default) is not available, fall back to using a stlye that both the X server and GNUstep support, if any. Also, add support for NoneStyle, which is for simple input methods that don't have any visualization. Problem reported and tested by Riccardo. 2013-09-09 Ivan Vucica * Source/opal/OpalFontInfo.m: Implemented -defaultLineHeightForFont, the key to getting GNUstep layouting system to use information provided in -advancementForGlyph:. Without that, the textcontainer->linefrags does not get created. 2013-09-08 Fred Kiefer * Source/x11/XGGLContext.m, * Source/x11/XGGLFormat.m: Better error reporting by converting glGetError() to a string. 2013-08-21 Eric Wasylishen * Source/x11/XIMInputServer.m: Add the setlocale(LC_CTYPE, "") call back that I removed last year (r35152). I tested the fcitx input method, and without the setlocale call, XOpenIM would fail. I'm not sure what the best plan is in the long term, I wanted to avoid calling setlocale from the core frameworks but in this case xlib seems to require it. 2013-08-02 Ivan Vucica * Source/opal/OpalContext.m: Implementation of -graphicsPort that returns a CGContext * Source/opal/OpalGState.m: -Stubs for -DPSsetlinejoin:, -DPSsetlinecap:, -DPSsetmiterlimit: -Implementation of -DPSimage::::::::::: for 32-bit RGB colorspaces 2013-07-29 Fred Kiefer * Source/gsc/GSContext.m: Replace isa with object_getClass(). 2013-07-25 Ivan Vucica * Source/opal/OpalContext.m: Pushing -DPSgsave: and -DPSgrestore: to OpalGState. * Source/opal/OpalSurface.m: -Disabled doublebuffering temporarily. -Work on fixing doublebuffering, including creating subimage properly. -Richer debug image output code, plus saving as PNGs. * Source/opal/OpalGState.m: -DPSfill -Setting color now also sets stroke color. -Corrected name for -DPSgsave and -DPSgrestore. -Implemented -saveClip, -restoreClip. -Implemented -DPSeoclip and -DPSeofill. -Added dummy DPSshow:, GSShowText:: etc. -Implemented -DPScurrentpoint:: so that superclass's DPSrlineto:: works. * Headers/opal/OpalSurface.h: Added -createCGContexts to header to fix a warning. 2013-07-24 Fred Kiefer * Source/win32/w32_movesize.m (-decodeWM_EXITSIZEMOVEParams:::): Remove code that caused missing windows content. * Source/cairo/CairoContext.m (-flushGraphics): Add experimental flush code for Windows. * Source/cairo/Win32CairoSurface.m (-initWithDevice:, -dealloc): Clean up HDC handling. Based on patch by Marcian Lytwyn 2013-07-24 Ivan Vucica * configure.ac: * configure: Opal backend depends on both Opal and CoreBase. Added CoreBase to list of libraries we link with. * Source/opal/OpalFontInfo.m: * Source/opal/OpalFontEnumerator.m: Switched to NSDebugLLog(). * Source/opal/OpalGState.m: -Switched to NSDebugLLog(). -Fixed DPSimage method's conversion of NSAffineTransform to CGAffineTransform -Implemented GSCurrentCTM -Implemented flushGraphics -Implemented DPSsavegstate and DPSrestoregstate * Source/opal/OpalSurface.m: -Switched to NSDebugLLog(). -Fixed section that is supposed to write out the debug image. 2013-07-21 Ivan Vucica * Source/opal/OpalFontInfo.m: * Source/opal/OpalFontEnumerator.m: Some hacks to figure out how NSMenuItem's width is determined, and how the supported glyphs are determined. * Source/opal/OpalGState.m: Various method implementations and fixes. * Source/opal/OpalSurface.m: Enabled doublebuffered code path, now that Opal's endianess problem is fixed. Creation of CGContext factored out of initializer into a method that can be called whenever needed to recreate the context. 2013-07-15 Ivan Vucica * Source/opal/OpalFontEnumerator.m: * Source/opal/OpalFontInfo.m: More dummy font code, trying to get wider menu items et al. * Source/opal/OpalSurface.m: * Source/opal/OpalContext.m: * Headers/opal/OpalSurface.h: Work on getting backing store support to work. * Source/opal/OpalGState.m: * Headers/opal/OpalGState.h: Implementation of a lot of drawing and matrix methods. 2013-07-11 Ivan Vucica * Source/opal/OpalContext.m: Once the surface is created in context, it's also set as the active surface of the GState. * Source/opal/OpalGState.m: Blocked some superclass methods from running. Added debug output. Added call to dummy paint method in OpalSurface. * Source/opal/OpalSurface.m: * Headers/opal/OpalSurface.h: * Headers/opal/OpalGState.h: Opal context is now created in the surface. Added a dummy draw method. * configure.ac: * configure: Ensured linking with the Opal library. 2013-07-08 Fred Kiefer * Source/x11/XGServerWindow.m (-setIgnoreMouse::): Completely rewrite this method to use Xfixes. * Source/win32/WIN32Server.m (-setIgnoreMouse::): Implement a Windows version of this method. 2013-07-08 Fred Kiefer * Source/x11/XGServerWindow.m (-setIgnoreMouse::): New method that allows to ignore mouse events for a window. 2013-07-04 Richard Frith-Macdonald * Tools/GNUmakefile.preamble: * Source/GNUmakefile.preamble: Fix order of use of library and header directories. 2013-07-03 Ivan Vucica * Source/x11/XGGLFormat.m: * Headers/x11/XGOpenGL.h: ARGB visual is only picked if NSOpenGLPFAAlphaSize is specified in the pixel format. 2013-07-03 Ivan Vucica * Source/x11/XGGLContext.m: * Source/x11/XGGLFormat.m: * Headers/x11/XGOpenGL.h: OpenGL context under X11 now picks up the best possible framebuffer that includes an alpha mask in the X visual info. The code is currently disabled as it needs more debugging. 2013-06-27 German A. Arias * Source/x11/XGServerEvent.m (-processEvent:): Don't add events WindowResized and WindowMoved in event_queue, to don't delay its sent. Instead, send these directly to the window. If not, the programa can move/resize the window while we send these events, causing a confusion. 2013-06-25 Ivan Vucica * Source/opal/OpalFontInfo.m: * Source/opal/OpalContext.m: * Source/opal/OpalGState.m: * Source/opal/OpalFontEnumerator.m: * Source/opal/OpalSurface.m: * Headers/opal/OpalFontInfo.h: * Headers/opal/OpalContext.h: * Headers/opal/OpalGState.h: * Headers/opal/OpalFontEnumerator.h: * Headers/opal/OpalSurface.h: Minimal code for dummy graphics backend now implemented for Opal backend. 2013-06-23 Ivan Vucica * config.h.in: * configure.ac: * configure: * Source/GSBackend.m: Added Opal backend to appropriate places (avoiding rebuild of configure and config.h.in). * Source/opal/OpalPSSurface.m: * Source/opal/GNUmakefile: * Source/opal/OpalFontInfo.m: * Source/opal/OpalPDFSurface.m: * Source/opal/OpalContext.m: * Source/opal/OpalGState.m: * Source/opal/OpalFontEnumerator.m: * Source/opal/OpalSurface.m: * Source/opal/OpalFaceInfo.m: Added dummy files for the Opal backend. 2013-05-11 Fred Kiefer * Source/cairo/Win32CairoSurface.m (-initWithDevice:): Make safer against the surface being deallocated during this method. * Source/cairo/Win32CairoSurface.m (WIN32Server-contentsOfScreen:inRect:): Screen grabbing code. * Headers/win32/WIN32Server.h, * Source/win32/WIN32Server.m (-monitorHandleForScreen:, -createHdcForScreen:, deleteScreenHdc:): Add helper methods for screen grabbing. Patch by Marcian Lytwyn 2013-04-24 23:10-EDT Gregory John Casamento * Source/cairo/CairoGState.m: Added code in -drawGradient: fromPoint:toPoint:options: to handle gradients for colorspaces other than NSCalibratedRGBColorSpace, NSDeviceRGBColorSpace, NSCalibratedWhiteColorSpace, NSDeviceWhiteColorSpace, NSCalibratedBlackColorSpace, NSDeviceBlackColorSpace. The previous implementation assumed RGB based colorspaces only. 2012-03-01 Richard Frith-Macdonald * Version ... bump subminor number in preparation for next release. 2012-03-01 Richard Frith-Macdonald Make release * Version 0.23.0 * Update release notes 2013-02-18 Fred Kiefer * Source/x11/XGServerWindow.m Fix compiler warnings reported by Sebastian Reitenbach 2013-02-16 Fred Kiefer * Source/gsc/GSContext.m * Source/x11/XGServerWindow.m Adopt to changes in gui. 2013-02-10 Fred Kiefer * Headers/cairo/CairoGState.h * Source/cairo/CairoGState.m * Source/cairo/XGCairoXImageSurface.m * Source/gsc/GSContext.m * Source/gsc/GSStreamContext.m * Source/gsc/GSStreamGState.m * Source/x11/XGServerWindow.m * Source/x11/XGDragView.m: Silence warnings from clang. 2013-02-01 Fred Kiefer * Source/winlib/WIN32Context.m(-isCompatibleBitmap): Add missing varible. 2013-02-01 Fred Kiefer * Headers/gsc/GSGState.h * Headers/gsc/GSGStateOps.h * Headers/gsc/GSStreamGState.h * Source/art/ARTGState.m * Source/art/composite.m * Source/art/ftfont-old.m * Source/art/ftfont.h * Source/art/ftfont.m * Source/art/path.m * Source/cairo/CairoGState.m * Source/gsc/GSContext.m * Source/gsc/GSGState.m * Source/gsc/GSStreamContext.m * Source/winlib/WIN32GState.m * Source/xlib/XGGState.m: Adopt to CGFloat changes in DPS/PS functions of gui. 2013-02-01 Fred Kiefer * Source/cairo/CairoGState.m * Source/gsc/GSGState.m * Source/gsc/GSStreamContext.m * Source/winlib/WIN32GState.m: Adopt to CGFloat changes on NSBezierPath. 2013-01-27 Fred Kiefer * Source/gsc/GSContext.m * Source/cairo/CairoContext.m * Source/art/ARTContext.m * Source/xlib/XGContext.m * Source/winlib/WIN32Context.m: Move the bitmap conversion code from cairo to the gsc class. Add a new method to detect incompatible image formats and implement that for all backends. * Source/winlib/WIN32GState.m (GSCreateBitmap): Improve the handling of device black/white colour space. 2013-01-11 Fred Kiefer * Source/win32/w32_general.m (-decodeWM_CLOSEParams:::): Post the close event instead of sending it directly to the window. Patch by Doug Simons 2013-01-05 00:54-EST Gregory John Casamento Merging changes made by Marcian Lytwyn * Tools/win32pbs.m: (+ownerByOsPb:) compare against name instead of pasteboard object to prevent condition where paste works only once as observed on Windows. (MainWindowProc) Add code to handle WM_RENDERALLFORMATS as documented on MSDN here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms649029(v=vs.85).aspx 2012-12-31 Fred Kiefer * Source/cairo/CairoFntInfo.m (-drawGlyphs:..., -setupAttributes): Invert the value of matrix[2]. See bug #30493 2012-11-26 12:56-EST Gregory John Casamento * Headers/cairo/Win32CairoGState.h * Source/cairo/Win32CairoGState.m: Add missing files for windows. 2012-11-26 00:37-EST Gregory John Casamento * ChangeLog * config.h.in * configure * configure.ac * Headers/win32/WIN32Server.h * Source/cairo/CairoContext.m * Source/cairo/CairoGState.m * Source/cairo/CairoPDFSurface.m * Source/cairo/GNUmakefile * Source/cairo/Win32CairoSurface.m * Source/GSBackend.m * Source/gsc/GSGState.m * Source/win32/w32_create.m * Source/win32/w32_general.m * Source/win32/w32_GLcontext.m * Source/win32/w32_movesize.m * Source/win32/w32_windowdisplay.m * Source/win32/WIN32Server.m * Source/winlib/GNUmakefile.preamble: Merge of all testplant branch changes to trunk for Cairo changes. Did code cleanup to make the code conform to coding standards. 2012-10-24 Doug Simons * Source/win32/WIN32Server.m : Fix findWindowAt:windowRef:excluding: to skip windows with the ignoresMouseEvents property set. 2012-10-14 Fred Kiefer * Source/win32/w32_create.m (-decodeWM_CREATEParams:::): Call windowbacking:: instead of handling backingstore here. Merge some changes from testplant branch * Source/win32/WIN32Server.m : Fix for fatal exceptions when a nil mouse event tried to post Patch by Jonathan Gillaspie * Source/gsc/GSGState.m (-description), * Source/cairo/CairoGState.m (-description): Add this method. * Headers/win32/WIN32Server.h - Added a mutable array for storing multiple screen information from GDI screen lookup * Source/win32/WIN32Server.m - Added startup sequence to invoke GDI functions to look up multiple screen/monitor information * Source/gsc/GSGState.m: Fix compiler warnings Patch by Marcian Lytwyn 2012-10-10 Jonathan Gillaspie * Source/win32/WIN32Server.m : Fix for fatal exceptions when a nil mouse event tried to post 2012-09-28 Fred Kiefer * Source/gsc/GSStreamContext.m (-GSShowGlyphsWithAdvances:): Add missing method. 2012-09-26 Eric Wasylishen * Source/cairo/CairoPDFSurface.m: * Source/cairo/CairoContext.m: * Source/cairo/CairoSurface.m: * Source/cairo/CairoPSSurface.m: * Headers/cairo/CairoSurface.h: Add a -isDrawingToScreen method to CairoSurface. Returns NO for PDF/PS surfaces, yes for others. Use it to implement -[CairoContext isDrawingToScreen], so that -[NSGraphicsContext isDrawingToScreen] will return the correct value. 2012-09-21 Wolfgang Lux * Source/x11/XGServerWindow.m (-imagecursor:::): Fix Xcursor specific code for big endian machines. 2012-08-17 Fred Kiefer * Source/cairo/CairoFontEnumerator.m: Allow for Windows default fonts. * Source/win32/w32_GLcontext.m, * Source/x11/XGGLContext.m: Implement 10.6 methods to get/set the CGLContextObj. 2012-08-08 Marcian Lytwyn *** Modifications/fixes for cairo support on win32 *** * Headers/win32/Win32CairoGState.h - NEW * Source/win32/Win32CairoGState.m - NEW * Headers/win32/WIN32Server.h * Source/gsc/GSGState.m: Fix compiler warnings * Source/win32/WIN32Server.m * Source/win32/w32_create.m * Source/win32/Win32CairoSurface.m * Source/cairo/GNUmakefile * Source/cairo/CairoContext.m * configure * configure.ac 2012-06-27 Marcian Lytwyn *** Modifications to Win32 server backend to support multiple monitors. * Headers/win32/WIN32Server.h - Added a mutable array for storing multiple screen information from GDI screen lookup * Source/win32/WIN32Server.m - Added startup sequence to invoke GDI functions to look up multiple screen/monitor information 2012-06-21 Eric Wasylishen * configure.ac: use AC_CHECK_LIB to check for cairo if pkg-config is not available * configure: regenerate 2012-05-14 Quentin Mathe * Source/gsc/GSContext.m (+initialize): Protected +initialize from being called multiple times because of subclasses. As a result, this eliminates a gtable memory leak (e.g. +initialize sent to both GSContext and CairoContext at backend initialization time), and prevents the gstate stack to be reset while still in use (e.g. the program enumerates classes at runtime and sends messages to them... +initialize might be sent to GSStreamContext in such a case). 2012-05-12 Eric Wasylishen * Source/x11/XIMInputServer.m: Remove the locale setting code. Use the correct #ifdef check for Xutf8LookupString, and use that function if available; otherwise use XLookupString. Interpret the return value of XLookupString as Latin-1. 2012-03-22 Eric Wasylishen * Source/x11/XGServerEvent.m: Make the GSModifiersAreKeys default to YES, by renaming the default to GSModifiersAreNotKeys. This should fix bug 25659; for example, in Ink you can now open the color panel with ++c or ++c. * Documentation/Back/DefaultsSummary.gsdoc: Update docs for GSModifiersAreNotKeys. 2012-02-20 Fred Kiefer * Source/cairo/CairoGState.m: Set the filter to BILINEAR for all patterns we use. 2012-02-19 Wolfgang Lux * Source/gsc/GSGState.m (-GSSetFillColor:, -GSSetStrokeColor:): Fix potentially uninitialized color space element when setting fill and stroke colors. 2012-02-19 Fred Kiefer * Source/cairo/CairoGState.m (-compositerect:op:): Use difference operator only for cairo version >= 1.9.4. 2012-02-18 Fred Kiefer * Source/winlib/WIN32GState.m * Source/art/composite.m * Source/xlib/XGGState.m * Source/xdps/NSDPSContextOps.m: Replace NSCompositeHighlight with GSCompositeHighlight and map NSCompositeHighlight onto NSCompositeSourceOver. * Source/cairo/CairoGState.m (-compositerect:op:): Implement GSCompositeHighlight with the difference operator. 2012-02-09 Richard Frith-Macdonald * Tools/gbps.m: Add lots of debug information (have objects describe themselves and where they are in the data sturcture). Simplify code by removing cached information about which owners respond to which selectors (probably not needed on modern systems, and we could re-add this more simply if it turns out I'm wrong). 2012-02-03 Adam Fedor * Bump version 2012-02-03 Adam Fedor * Version 0.22.0 * Update release notes 2012-01-23 Eric Wasylishen * Source/cairo/CairoFntInfo.m (-setupAttributes): use CAIRO_HINT_METRICS_ON instead of CAIRO_HINT_METRICS_OFF, otherwise some text is cut of (e.g. quit Ink with unsaved changes, the "t" in "Quit" in the dialog is cut off) 2012-01-23 Eric Wasylishen * Source/cairo/CairoFontInfo.m (-setupAttributes): We must not leave the hinting settings as their defaults, because if we did, that would mean using the surface defaults which might or might not use hinting (xlib does by default.) Since we make measurements outside of the context of a surface (-advancementForGlyph:), we need to ensure that the same hinting settings are used there as when we draw. For now, just force hinting to be off. 2012-01-19 Wolfgang Lux * Source/x11/XGServerWindow.m (-orderwindow:::): Introduce new user defaults to respectively make app icons and mini windows sticky (aka omnipresent). 2012-01-11 Fred Kiefer * Source/winlib/WIN32FontEnumerator.m: Add missing include. 2012-01-11 Fred Kiefer * Source/winlib/WIN32FontEnumerator.m, * Source/cairo/CairoFontEnumerator.m, * Source/xlib/GSXftFontInfo.m, * Source/xlib/XGFont.m: Use NSDebugLLog instead of NSDebugLog to reduce amount of default output. 2012-01-02 Eric Wasylishen * Source/cairo/CairoGState.m (-GSShowGlyphsWithAdvances:): Update the current point after drawing text. Should not affect anything in gui right now, but will be useful later. 2011-12-24 Eric Wasylishen * Source/cairo/CairoContext.m (-beginPrologueBBox:...): Add a hack to get landscape printing working. Comment in the source reproduced here: FIXME: This is confusing... When an 8.5x11 page is set to landscape, NSPrintInfo also swaps the paperSize to be 11x8.5, but gui also adds a 90 degree rotation as if it will be drawing on a 8.5x11 page. So, swap 11x8.5 back to 8.5x11 here. 2011-12-23 Eric Wasylishen * Source/cairo/CairoContext.m (-beginPrologueBBox:...): Use paper size from print info to set the cairo page size, instead of using the bounding box (which is usually smaller than the paper size, and was causing cairo print output to be wrong compared to GNUstep's built-in PostScript writer.) 2011-11-28 Fred Kiefer * Source/x11/XGServerEvent.m (initialize_keyboard): Don't use XK_ISO_Level3_Shift as second alternate key. * Documentation/Back/DefaultsSummary.gsdoc: Document this mapping. 2011-11-07 Fred Kiefer * Source/x11/XGGLFormat.m (-assembleGLXAttributes:): Use GLX_BUFFER_SIZE for NSOpenGLPFAColorSize instead of setting all the single colour sizes, which was wrong. 2011-11-07 Fred Kiefer * Source/x11/XGServerEvent.m (initialize_keyboard): Use XK_ISO_Level3_Shift as second alternate key. * Documentation/Back/DefaultsSummary.gsdoc: Document this mapping. 2011-11-04 Eric Wasylishen * Source/x11/context.c: check for NULL from XRenderFindVisualFormat 2011-10-25 Eric Wasylishen * Source/gsc/GSStreamContext.m: * Source/gsc/GSContext.m: * Source/gsc/GSGState.m: * Headers/gsc/GSGStateOps.h: Change type for -GSSetFillColor: and -GSSetStrokeColor: from float to CGFloat 2011-10-20 Fred Kiefer * Source/cairo/CairoFontEnumerator.m: Define FC_WEIGHT_ULTRABLACK for old versions of fontconfig. Patch by Richard Frith-Macdonald 2011-10-20 Fred Kiefer * Headers/x11/XWindowBuffer.h: Bracket even more usage of shm in conditional compilation. 2011-10-18 Fred Kiefer * Headers/x11/XWindowBuffer.h: Protect the usage of shm. 2011-10-17 Fred Kiefer * configure.ac: Test for X shape extension * configure: Regenerate * config.h.in: Regenerate * Source/x11/XGServerWindow.m (-restrictWindow:toImage:), * Source/x11/XWindowBuffer.m (-_exposeRect:): Protect usage of shape extension. Should fix bug #34552. 2011-10-13 Eric Wasylishen * Source/cairo/GNUmakefile: * Source/cairo/CairoContext.m: * Source/cairo/CairoSurface.m: * Source/cairo/XGCairoModernSurface.m: * Headers/cairo/XGCairoModernSurface.h: * Headers/cairo/CairoSurface.h: New cairo surface which uses cairo_surface_create_similar to create a back buffer which has an alpha channel, even if the X server doesn't support surfaces with alpha. This new surface is also made the default since this seems to be the recommended way to double buffer with cairo. 2011-09-18 Eric Wasylishen * Source/cairo/CairoContext.m: revert the last change for now 2011-09-16 Eric Wasylishen * Source/cairo/CairoContext.m: Switch to XGCairoSurface by default, because it fixes the corrupted display problem reported by Riccardo on 16-bit displays. 2011-09-12 Fred Kiefer * Source/cairo/CairoGState.m (-saveClip, -restoreClip:, -drawGradient:...): Check that the _ct isnt NULL. * Source/cairo/CairoGState.m (doubleFromUserSpace, floatToUserSpace): Use correct types in these helper functions. 2011-09-12 Fred Kiefer * Source/x11/XGDragView.m (GSActionForDragOperation, GSDragOperationForAction): Corrected drag type conversion. Patch by Andreas Schick 2011-09-11 Eric Wasylishen * Source/cairo/CairoGState.m (-drawGState:...): Check that the source context is non-NULL before calling cairo_get_target on it. Log a warning when either the source context or target context is NULL. 2011-08-16 Eric Wasylishen * Source/cairo/CairoGState.m (-drawGState:...): Use CAIRO_EXTEND_PAD on the pattern to prevent blurred edges when scaling up. 2011-08-15 Eric Wasylishen * Source/cairo/CairoGState.m (-DPSstroke:): If the line width is 0, temporarily set it to 1 unit wide (in device space.) This is an attempt at matching the behaviour of the setlinewidth PostScript operator, which is supposed to interpret 0 as meaning the thinnest line that the output device can draw. Note that Quartz (and cairo) draw nothing with a line width of 0. 2011-08-07 Eric Wasylishen * Tools/xpbs.m: Add some more comments 2011-08-07 Eric Wasylishen * configure.ac: Test for Xfixes * configure: Regenerate * config.h.in: Regenerate * Tools/xpbs.m: If Xfixes is available, use it to receive notifications when the owner of an X11 selection changes. In the future we should invalidate the list of cached pasteboard types when this happens, so, e.g. copying text from gnome-terminal, the general pasteboard will only have the text type, but subsequently copying text from OpenOffice.org, the general pasteboard will have plain text and RTF types (currently we don't do this, so you can't paste RTF contents unless it is in the clipboard when gpbs starts.) The above problem is also why DND from X to GNUstep doesn't work - the dragging pasteboard types are never updated. 2011-08-04 Eric Wasylishen * Tools/xpbs.m: Get copy and paste of rich text from OpenOffice.org to Ink working. - OOo uses the MIME type "text/richtext", so make that another alias for RTF - Fix an obscure bug in measuring the size of the return buffer of XGetWindowProperty. When an array of Atom's is returned xlib will claim that they are 32-bit when in fact they may be 64-bit. This was causing xpbs to miss half of the available types for a clipboard on 64-bit systems. - Don't use 'True' for the delete paramater of XGetWindowProperty. I'm not sure why we were deleting window properties before. gtk doesn't do that. 2011-08-01 Eric Wasylishen * configure.ac: Add a configure test for Xcursor * configure: regenerate * config.h.in: regernate 2011-07-30 Eric Wasylishen * Source/win32/WIN32Server.m (-resolutionForScreen:): Scale the result by 0.75 so the Windows default of 96 DPI is mapped to the GNUstep default of 72 DPI. While this sounds wrong, 72 and 96 are just "virtual" DPI's; both mean 1 point = 1 pixel, so it's actually the right thing to do. * Source/x11/XGServerWindow.m (-resolutionForScreen:): Comment out the implementation and just return 72 for now, because I'm not sure if we can trust the value the X server gives us. NOTE: Currently -gui ignores these methods and only looks at the GSScaleFactor user default. I'm going to make -gui use the server values now, because it's safe to do so on Windows (the system DPI is set by the user, and affects all applications.) NOTE: We might consider refactoring these methods to be called scaleFactorForScreen: to make it clearer what they do. 2011-07-18 Eric Wasylishen * Source/winlib/WIN32GState.m (GSCreateBitmap): Add support for (8 bit-greyscale, 8-bit alpha) format. This fixes various default images not showing (menu arrows, scroller arrows, etc.) 2011-07-15 Eric Wasylishen * Source/x11/XGServerWindow.m: Add Xcursor support (for RGBA imagecursor support.) configure test is still TODO, so it isn't compiled in at the moment. 2011-07-13 Eric Wasylishen * Headers/x11/XGGeneric.h * Source/x11/XGServerWindow.m: Add new netwm window state atoms 2011-07-14 Fred Kiefer * Tools/win32pbs.m: Add include needed for Cygwin. 2011-07-08 Eric Wasylishen * Headers/cairo/CairoGState.h: * Source/cairo/CairoGState.m: Remove most of the rounding code and implementation of DPSstrokeadjust. 2011-07-03 Eric Wasylishen * Source/cairo/XGCairoSurface.m (-contentsOfScreen:inRect:): Use the passed rect properly. 2011-07-03 Eric Wasylishen * Source/cairo/XGCairoSurface.m: Implementation of -[GSDisplayServer contentsOfScreen:inRect:] for x11/cairo 2011-06-22 Fred Kiefer * Headers/x11/XGServer.h: Add #include of config.h. 2011-06-15 Fred Kiefer * Source/cairo/CairoContext.m (-supportsDrawGState), * Headers/cairo/CairoGState.h (-supportsDrawGState) * Source/cairo/CairoGState.m (-supportsDrawGState): Revert last change as gui is fixed now. 2011-06-13 Fred Kiefer * Source/cairo/CairoContext.m (-supportsDrawGState): Delegate to gstate. * Headers/cairo/CairoGState.h (-supportsDrawGState): Declare this method. * Source/cairo/CairoGState.m (-supportsDrawGState): Only allow the faster drawing operation when the clip can be represented as a list of rectangles. * Source/cairo/CairoGState.m (-copyWithZone:): Always free the clip rectangle list. 2011-06-01 Wolfgang Lux * Headers/x11/XGServerWindow.h (GSMaxWMProtocols, _gswindow_device_t): Enlarge protocol array to make space for the _NET_WM_SYNC_REQUEST protocol atom. * Source/x11/XGServerWindow.m (_setSupportedWMProtocols:): Add assertion to catch out of bounds errors in the future. 2011-05-27 13:53 David Chisnall * libs/back/trunk/Source/x11/XGServerWindow.m: Call NSZoneFree() on pointer allocated with NSAllocateCollectable(), not free(). This is a no-op in GC mode, and will free the memory in non-GC mode. 2011-05-25 Eric Wasylishen * Source/winlib/WIN32GState.m: * Source/art/ARTGState.m: * Source/cairo/CairoGState.m: * Source/xlib/XGGState.m: * Source/gsc/GSContext.m: * Source/gsc/GSGState.m: * Headers/gsc/GSGStateOps.h: Add a new interface, GSShowGlyphsWithAdvances, which replaces GSShowGlyphs as the primitive text drawing method. None of the backends implement it properly yet; I simply renamed the existing -GSShowGlyphs:: methods to -GSShowGlyphsWithAdvances:::, so they currently ignore the glyph advances. 2011-05-19 Fred Kiefer * Headers/cairo/CairoFontEnumerator.h, * Headers/cairo/CairoFaceInfo.h: Protect the name id. * Source/cairo/CairoGState.m: Reorder variable declarations before GS_BEGINITEMBUF as some compilers may complain. Patch by Sebastian Reitenbach 2011-05-15 Eric Wasylishen * Source/x11/XGServerWindow.m: * Source/x11/XGServer.m: * Source/x11/XGServerEvent.m: * Headers/x11/XGGeneric.h: * Headers/x11/XGServerWindow.h: * Headers/x11/XGServer.h: Implement the _NET_WM_SYNC_REQUEST protocol described here: http://standards.freedesktop.org/wm-spec/1.3/ar01s06.html This is supposed to make window resizing smoother when dragging a resize handle provided by the window manager, by waiting to change the window manager's frame until the GNUstep window is finished repainting. 2011-05-05 Eric Wasylishen * Undo the previous change and try a different approach.. just cache the character set in CairoFaceInfo, but load them as needed as we were doing before. 2011-05-05 Eric Wasylishen * Source/cairo/CairoFontEnumerator.m: * Source/cairo/CairoFaceInfo (-characterSet): Remove the call to FcFontMatch in -characterSet which was a big performace bottleneck. Instead load the character set data when enumerating all fonts in CairoFontEnumerator. 2011-04-17 Eric Wasylishen * Source/cairo/CairoFontEnumerator.m: Remove declarations after statements for c89 compatability 2011-04-17 Eric Wasylishen * Source/cairo/CairoFontEnumerator.m: Replace -handleKey:selector:valueClass: and -handleKey:selector: methods with macros. 2011-04-17 Eric Wasylishen * configure.ac: Copy the -Wdeclaration-after-statement test from base. Also adds -Wall. 2011-04-14 Eric Wasylishen * Source/cairo/CairoFontEnumerator.m: * Headers/cairo/CairoFontEnumerator.h: Override -matchingFontDescriptorsFor: to delegate the matching to Fontconfig This uses two utility classes which map Fontconfig patterns to and from NSFontDescriptor attributes dictionaries, preserving as much detail as possible. 2011-04-14 Adam Fedor * Version: Bump version 2011-04-14 Adam Fedor * Version 0.20.0 2011-04-09 Fred Kiefer * Source/gsc/GSFunction.m (-initWith:): Correct printf format. * Source/x11/XGServerEvent.m (-XGErrorHandler::, -_XPointToOSPoint:for:, -processEvent:, -_handleTakeFocusAtom:forContext:, process_key_event): Correct printf format. * Source/x11/XGServerWindow.m (setNormalHints, -_OSFrameToXFrame:for:, -_OSFrameToXHints:for:, -_XFrameToOSFrame:for:, -_checkStyle:, -nativeWindow:...:, -styleoffsets:...:, -placewindow::, -setinputfocus:, -_DPSsetcursor::): Correct printf format. * Source/x11/XGServerWindow.m (-orderwindow): Remove misplaced semicolon. * Source/x11/XGDragView.m (-_resetDragTypesForWindow:): Correct printf format. * Source/x11/XIMInputServer.m (-ximStyleInit, -ximFocusICWindow:): Correct printf format. * Source/x11/XWindowBuffer.m: Correct printf format. * Source/GSBackend.m: Replace objc_get_class with NSClassFromString. * Tools/xpbs.m (-xSelectionNotify:): Correct printf format. Fixes warnings reported by clang. 2011-03-27 Eric Wasylishen * Source/cairo/CairoFontEnumerator.m: * Source/cairo/CairoFaceInfo.m: * Source/cairo/CairoFontInfo.m: * Headers/cairo/CairoFontEnumerator.h: * Headers/cairo/CairoFaceInfo.h: Set the coveredCharacterSet ivar of CairoFontInfo. The character set is obtained from Fontconfig. There is an NSCharacterSet subclass which wraps the FcCharSet structure from fontconfig, so there is no need for a slow conversion from one character set format to another. This has the effect of enabling glyph substitution when using the cairo backend. 2011-03-23 Fred Kiefer * Tools/xpbs.m (-pasteboard:provideDataForType:, -availableTypes) (-xSelectionNotify:): Better handling of plain text data types. 2011-03-18 Fred Kiefer * Source/x11/XGServerWindow.m: Extract the bitmap conversion into a local function and use it througout the file. 2011-03-13 Eric Wasylishen * configure.ac: Check for the X extention libraries (Xext, Xt, Xmu) using pkg-config if they aren't found with the default test 2011-03-07 Fred Kiefer * Source/win32/WIN32Server.m, * Source/x11/XGServerWindow.m: Change the way the image for the cursor gets passed on to the backend. The old way could only work for 8 bit data. 2011-03-05 Wolfgang Lux * Tools/xpbs.m (+xEvent:, +receivedEvent:type:extra:, -requestData:, -xTimeByAppending): Fix race condition where gpbs could time out waiting for a property change notification from the X server, which is already present in the X event queue. 2011-02-15 Fred Kiefer * Source/win32/WIN32Server.m, * Source/x11/XGServerWindow.m: New methods for cursor handling. Requires corresponding gui change. 2011-02-14 Wolfgang Lux * Source/x11/XGServerWindow.m (-orderwindow:::): Omit app icons and mini windows from the pager and task bar even when they are displayed at normal window level. 2010-12-11 Fred Kiefer * Source/winlib/WIN32GState.m: Remove a few compiler warnings. 2010-12-11 Fred Kiefer * Source/winlib/WIN32GState.m (GSCreateBitmap, -DPSImage:::...:): Better error detection. 2010-12-08 Jonathan Gillaspie * Source/win32/WIN32Server.m: Added better logging on Window create and destroy errors. Added a secondary call to get current mouse position if the first call fails. * Source/win32/w32_text_focus.m: Cast parameter to appropriate (HWND) type. 2010-11-18 Eric Wasylishen * Source/winlib/WIN32FontInfo.m: * Source/winlib/WIN32GState.m: * Source/cairo/CairoFontInfo.m: * Source/cairo/CairoGState.m: * Source/win32/w32_general.m: * Source/win32/w32_create.m: * Source/x11/XGServerWindow.m: * Source/gsc/GSGState.m: Replace objc_malloc with malloc and objc_free with free 2010-09-11 Fred Kiefer * Source/x11/convert.c (image2StandardPseudoColor): Small change to keep static code analyser happy. * Source/x11/XGServerEvent.m (process_key_event): Don't process the event if we don't have a key window. * Source/x11/XGServerWindow.m (_computeDepth): Test for unknown visual class. * Tools/gpbs.m: Rename newDataWithVersion: into dataWithVersion to follwo the Objective_c naming convention. 2010-09-10 Eric Wasylishen * Source/win32/w32_activate.m: Revert the change to call -[NSApp deactivate].. more investigation needed 2010-08-30 Eric Wasylishen * Source/win32/WIN32Server.m: Only show taskbar buttons for windows which satisfy both: - style mask isn't NSBorderlessWindowMask - style mask don't have NSUtilityWindowMask set Should fix bug 30911 2010-08-29 Eric Wasylishen * Source/win32/w32_activate.m: Call -[NSApp deactivate] in response to a WM_ACTIVEAPPP message reporting that the app lost focus. This delivers NSApplicationWillResignActiveNotification and NSApplicationDidResignActiveNotification, hides panels, etc. 2010-08-24 Eric Wasylishen * Source/win32/WIN32Server.m: Handle Page Down and Page Up keys, as well as adding a few others. 2010-08-24 Eric Wasylishen * Headers/win32/WIN32Server.h: * Source/win32/WIN32Server.m: * Source/win32/w32_movesize.m: Fix a rather serious error where the extra window data was allocated in two places (allocated with objc_malloc in the WM_CREATE handler, and also allocated by Windows using the cbWndExtra field of the window class structure). Sometimes the window level was accessed from one memory area and sometimes from the other. This is a quick fix that leaves the level and ordered properties in the cbWndExtra area, and the rest is left in the WIN_INTERN structure. This fixes the problem where window ordering was broken when running apps in gdb. 2010-08-24 Eric Wasylishen * Source/win32/WIN32Server.m (-setmaxsize::): Remove the maximize box when a maximum size is set on a window. 2010-08-10 Fred Kiefer * Source/cairo/CairoFontEnumerator.m, * Source/xlib/GSXftFontInfo.m: Also request spacing information. Patch by Derek Fawcus . 2010-08-03 Eric Wasylishen * Source/win32/WIN32Server.m: Only look at NSUtilityWindowMask to decide whether to use a thin- style title bar (WS_EX_TOOLWINDOW). 2010-07-28 Fred Kiefer * Source/gsc/GSGState.m (-fillRect:withPattern:): Don't use an autoreleased bezier path. * Source/art/path.m (-DPSrectfill::::), * Source/xlib/XGGState.m (-DPSrectfill::::): Use -fillPath:withPattern: not -fillRect:withPattern: as the rect needs to be converted first. 2010-07-26 Fred Kiefer * Source/win32/WIN32Server.m, * Source/x11/XGServerEvent.m: Use NSDeleteCharacter instead of NSBackSpaceCharacter for the backspace key. This is what Cocoa and OpenStep have been doing all the time. Also use NSBackTabCharacter on X11 when XK_ISO_Left_Tab is pressed, but don't convert shift-tab into NSBackTabCharacter. Patch by Derek Fawcus . 2010-07-25 Eric Wasylishen * Source/win32/WIN32Server.m: Fix accidental integer division intended to be float division when setting the timestamp on events. This was causing all timestamps to be rounded to the nearest second. 2010-07-25 Eric Wasylishen * Source/win32/w32_GLContext.m: * Source/x11/XGGLContext.m: Apply fix for bug 29705: OpenGL subwindow positioning error (OpenGL subwindow position was incorrectly calculated when the window content view was flipped) 2010-07-25 Fred Kiefer * Source/x11/XGServerEvent.m: Treat Shift modifiers in the same manner as other modifiers. This fixes the value of the shift bit (NSShiftKeyMask) in the modifierFlags passed to a -flagsChanged: method call. Without it the shift bit is inverted, as explained in the source comments, as X reports the modifier bits in force before the key was pressed/released. Patch by Derek Fawcus . 2010-07-25 Eric Wasylishen * Source/win32/WIN32Server.m: When ordering out a window, use the SWP_NOACTIVATE flag on SetWindowPos so Windows doesn't activate/deactivate any windows when hiding a window. This fixes the bug where when a tooltip disappeared, it would deactivate the window the tooltip was over. 2010-07-07 Eric Wasylishen * Source/win32/WIN32Server.m: * Source/win32/w32_movesize.m: Fix for bug #29709: Windows: Maximize button in a window title bar is always grayed out 2010-07-06 Eric Wasylishen * Source/win32/WIN32Server.m: Tweak the conditions for incrementing the clickCount when handling mouse clicks: (i.e. double click detection) - Require a click to be within a distance (retrieved from Windows) of the last click to count (previously there was no proximity check) - Allow clicks separated by the Windows double click time interval to count (e.g. if the Windows double click time interval is n, clicking at times 0, n, 2n, 3n would produce events with click counts 1, 2, 3, and 4. This matches OS X behaviour. Previously, all clicks had to be within the windows double click time interval to count as one group.) 2010-06-23 Quentin Mathe Fixed Windows backend issues introduced with r30523 where images are drawn at the wrong location by -[NSImage drawXXX] methods. See bug report #30069 Images are also now drawn correctly with these methods in a rotated/scaled context unlike previously (but alpha blending still doesn't work properly). * Source/winlib/WIN32Context.m (-supportsDrawGState): Added. * Headers/winlib/WIN32GState.m: Added oldWorldTransform ivar. * Source/winlib/WIN32GState.m: (-setUpAppKitBaseCoordinatesForHDC:, -restoreGDIBaseCoordinatesForHDC:, drawGState:fromRect:toPoint:op:fraction:): Added. 2010-06-06 Fred Kiefer * Source/cairo/CairoGState.m (-compositeGState:fromRect:toPoint:op:fraction:): Move the usage of _ct and source->_ct after the check whether they are set. 2010-06-01 Quentin Mathe Fixed composite operator to behave correctly and added a new draw operator to get -[NSImage drawXXX] methods work exactly as Cocoa and improve the drawing performance in some cases. Eliminated all flipping checks in the backend to ensure the flipping remains an high-level AppKit concept. * Source/gsc/GSContext.m: (-GSdraw:toPoint:fromRect:operation:fraction:): Added. This method calls -drawGState:fromRect:toPoint:op:fraction:. * Headers/gsc/GSGState.h (-drawGState:fromRect:toPoint:op:): Added as an informal protocol which can be implemented by subclasses * Source/cairo/CairoContext.m (-supportsDrawGState): Added overriden implementation that enables -drawGState:fromRect:toPoint:op:fraction:. * Source/cairo/CairoGState.m: (-drawOrientationMarkersIn:): Added. (-DPSimage::::::): Removed flipping check. (-compositeGState:fromRect:toPoint:op:fraction:): Fixed to precisely implement the PostScript behavior which is to ignore rotation and scaling effect for the content but not for the destination point. Also documented in details since this code is complex. (-drawGState:fromRect:toPoint:op:fraction:): Added. 2010-05-25 Riccardo Mottola * Source/x11/XGDragView.m * Source/gsc/GSGState.m Added missing imports. 2010-05-16 17:39-EDT Gregory John Casamento * Headers/win32/WIN32Server.h * Source/win32/w32_general.m * Source/win32/WIN32Server.m: Added code to re-activate the theme when the theme changes on Windows. 2010-05-11 Fred Kiefer * configure.ac: Make cairo the default backend. Fall back to art and xlib gracefully. * configure: Regenerate. 2010-05-10 Adam Fedor * Fix release documentation 2010-05-09 Adam Fedor * Version 0.19.0 Unstable release 2010-05-09 Adam Fedor * Version 0.18.0 2010-04-20 Doug Simons * Source/winlib/WIN32GState.m: Fix problem with display location for some composited images. 2010-04-20 Doug Simons * Source/win32/WIN32Server.m: Fix problem with key events going to window other than the key window. Block callbacks while setting the foreground window to prevent key/main window changes from cascading in a feedback loop. 2010-04-18 Eric Wasylishen * Source/winlib/WIN32FontInfo.m: Use DEFAULT_QUALITY for fonts instead of ANTIALISED_QUALITY. ANTIALISED_QUALITY forces small text to be non-antialised, which looks out of place compared with most Windows apps. 2010-04-15 Eric Wasylishen * Source/win32/w32_create.m: Use the default icon size when loading the app ico file Otherwise, the first icon in the file would be used. 2010-04-14 Jonathan Gillaspie * Source/win32/WIN32Server.m: Have non-key, non-main windows that order front not become active. Also don't bring windows that are ordering out to the foreground first. 2010-03-25 Fred Kiefer * Source/art/ftfont.m, * Source/art/ftfont-old.m, * Source/xlib/XGGState.m: Add more missing imports. 2010-03-25 Riccardo Mottola * Source/gsc/GSGState.m: import NSValue, include -> import * Source/xlib/XGGState.m: added missing imports 2010-03-24 Doug Simons * Source/winlib/WIN32FontInfo.m: Include NSDebug.h for definition of NSDebugLLog(). 2010-03-24 Doug Simons * Source/win32/WIN32Server.m: Ignore duplicate mouse down events generated by first click in a window. 2010-03-19 Eric Wasylishen * Headers/win32/w32_movesize.h: * Source/win32/w32_movesize.m: * Source/win32/WIN32Server.m: Call displayIfNeeded on the window when WM_SIZING is recieved so windows redraw while being resized. 2010-03-19 Eric Wasylishen * Source/win32/WIN32Server.m: Report deltaX and deltaY for mouse move events, like OS X does. 2010-03-19 Eric Wasylishen * Source/win32/WIN32Server.m: Process WM_SYSKEYDOWN and WM_SYSKEYUP messages - these are delivered instead of normal WM_KEYDOWN and WM_KEYUP messages when the ALT key is presesd. (and also F10). This fixes NSAlternateKeyMask not being set. 2010-03-13 Eric Wasylishen * Source/win32/w32_GLcontext.m: Set the WS_DISABLED flag on the OpenGL subwindow so mouse/keyboard events get redirected to the parent window. Previously mouse/keyboard events were being eaten by the OpenGL subwindow - now they work as expected. 2010-03-13 Eric Wasylishen * Source/win32/w32_GLcontext.m: Make more than one NSOpenGLView in an application work. Win32GLContext was using the hDC stored in the pixel format object in a few places, instead of getting it from the Win32Subwindow object. 2010-03-13 Eric Wasylishen * Headers/win32/WIN32Server.h: * Source/win32/WIN32Server.m: Add support for horizontal mousewheel scrolling 010-03-13 Eric Wasylishen * Source/win32/WIN32Server.m: Fix handling of mousewheel events. The WM_MOUSEWHEEL message uses screen coordinates, so convert them to client coordinates. 2010-03-13 Fred Kiefer * Source/gsc/GSContext.m (-GSDrawImage::): Bug fix by Anibal Rindisbacher 2010-03-12 Doug Simons * Source/win32/WIN32Server.m: Capture the mouse to get mouse moved events outside of a window while a button is down. 2010-03-11 Doug Simons * Source/win32/WIN32Server.m: Prevent generating spurious NSMouseMoved events when the mouse hasn't actually moved. 2010-03-08 Doug Simons * Source/win32/WIN32Server.m: Oops, I don't know how the extra 'u' got in there... fixed. 2010-03-08 Doug Simons * Source/win32/WIN32Server.m: When the shift key is down, charactersIgnoringModifiers should be uppercase (this is consistent with Cocoa and the x11 backend. 2010-03-07 Fred Kiefer * Source/cairo/CairoGState.m: Only use calls for cairo_pattern_set_extend() on cairo > 1.6.0. Patch suggested by Eric Wasylishen . 2010-03-05 Richard Frith-Macdonald * Source/cairo/CairoGState.m: * Source/gsc/GSGState.m: Use the -zone method rather than GSObjCZone() 2010-02-24 16:45-EST Gregory John Casamento * Source/win32/WIN32Server.m: Added a boolean to control if callbacks are honored so that we can ignore the SetActiveWindow(...) call when windows are resigned. Otherwise this causes some issues and could result in an inconsistent state. * Source/winlib/WIN32GState.m: Moved AlphaBlend to seperate function so that it can be called elsewhere. 2010-02-20 Fred Kiefer * Source/gsc/GSStreamContext.m * Headers/cairo/CairoFontInfo.h * Source/cairo/CairoFontInfo.m * Source/cairo/CairoGState.m * Source/winlib/WIN32FontInfo.m * Source/art/ftfont.m * Source/art/ftfont-old.m * Headers/xlib/GSXftFontInfo.h * Headers/xlib/XGFontSetFontInfo.h * Source/xlib/XGFontSetFontInfo.m * Source/xlib/GSXftFontInfo.m * Source/xlib/XGFont.m: Adjust to the CGFloat change for NSFont and NSAffineTransform done in base and gui. 2010-02-11 Nicola Pero * Documentation/Back/GNUmakefile: Do not try including the non-existing GNUmakefile.local file. * Documentation/GNUmakefile: Same change. * Fonts/GNUmakefile: Same change. * Source/winlib/GNUmakefile: Same change. * Tools/GNUmakefile: Same change. * Fonts/GNUmakefile.postamble (before-uninstall): Remove back-resources_INSTALL_DIR if empty. 2010-02-10 Eric Wasylishen * Source/x11/XGServerWindow.m: * Source/x11/XGServerEvent.m: * Headers/x11/XGGeneric.h: Handle horizontal scrolling events 2010-02-07 03:37-EST Gregory John Casamento * Headers/win32/WIN32Server.h: Remove HOTKEY method. * Source/win32/w32_general.m: Remove HOTKEY method. * Source/win32/WIN32Server.m: Remove call to HOTKEY method. Added function "mask_for_keystate(..)" to implement modifier mappings on Windows. Also changed process_key_event to use the new function and changed the call to ToUnicode to use a blank array instead of modifying the existing keyState array since this was returning the characters with the modifiers still applied. 2010-02-05 16:31-EST Gregory John Casamento * Headers/win32/WIN32Server.h: Added declaration for decodeWM_HOTKEY:... * Source/win32/WIN32Server.m: Added call to method decodeWM_HOTKEY:... * Source/win32/w32_general.m: Added method decodeWM_HOTKEY:... 2010-01-26 Fred Kiefer * Source/win32/w32_text_focus.m: Re-enable the focus in event. * Source\win32\WIN32Server.m (-movewindow::, -placewindow::): Use the SWP_NOACTIVATE flag to pervent window activation. * Source\win32\WIN32Server.m (-setinputstate::): Set active on main not key. 2010-01-26 Fred Kiefer * Source/x11/XWindowBuffer.m (+windowBufferForWindow:depthInfo:): Merge the two checks for xshm. * Source/art/ftfont.m (-initWithFontName:...screenFont:): Initialize unicodeCmap to -1 to be able to detect missing unicode encoding in a font. 2010-01-25 04:13-EST Gregory John Casamento * Source/win32/w32_create.m: (-decodeWM_CREATEParams:::) add code to load and set the HICON into the window. Currently, an .ico file with the same name as the image specified in NSIcon or CFBundleIconName needs to be provided in the resources. 2010-01-22 Fred Kiefer * Source/x11/XWindowBuffer.m (+windowBufferForWindow:depthInfo:) (test_xshm): Don't give up on xshm when pixmaps aren't supported. Based on proposal by Derk Fawcus . 2010-01-22 Wolfgang Lux * Source/x11/XWindowBuffer.m (+windowBufferForWindow:depthInfo:): * Source/art/ARTGState.m (-GSSetDevice:): * Source/cairo/XGCairoXImageSurface.m (-initWithDevice:): Fix bug #28590 (with a little help from Fred Kiefer). 2010-01-21 15:45-EST Riccardo Mottola Committed by: Gregory John Casamento * Source/win32/w32_text_focus.m: Correction for extra event which was causing main/key windows to get out of sync in the backend and gui. 2010-01-14 Wolfgang Lux * Source/x11/XGServerEvent.m (-processEvent:): * Source/x11/XGServerWindow.m (-_wm_state:, -_ewmh_state, -_checkStyle, -_rootWindowForScreen:, -window::::, -nativeWindow:::::): Revise detection of window miniaturization and deminiaturization based on ICCCM WM_STATE property. * Source/x11/XGServerWindow.m (-miniwindow:): Add special case for metacity window manager to avoid miniaturizing shaded windows. 2010-01-14 05:41-EST Gregory John Casamento * Headers/win32/WIN32Server.h: Added decodeWM_MOUSEACTIVATE:.. * Source/win32/w32_general.m: Added call to decodeWM_COMMAND: to -[GSTheme processCommand:] the theme callback which handles native menus, 2010-01-12 Fred Kiefer * Tools/xpbs.m: Add missing comma after name of selection atom. 2010-01-10 Riccardo Mottola * Source/win32/w32_activate.m: generate GSAppKitWindowLeave leave events. 2010-01-08 Fred Kiefer * Source/win32/w32_text_focus.m: Small clean up in focus handling. 2009-12-19 Eric Wasylishen * Source/cairo/CairoGState.m: -DPSsetflat: and -DPScurrentflat should not have been transforming the flatness value with the current transformation matrix. The effect of this could be seen in the Apple BezierPathLab example; zooming in on the circle caused it to look more and more like a polygon. 2009-12-11 Eric Wasylishen * Source/cairo/CairoGState.m: Add a call to cairo_pattern_set_extend(pattern, CAIRO_EXTEND_PAD); on the pattern used to draw images. This keeps the edges of images crisp when the are scaled up. The description from the Cairo docs is: "pixels outside of the pattern copy the closest pixel from the source". 2009-11-19 Doug Simons * Source/x11/XGServerWindow.m: Make sure we return current window bounds. 2009-11-16 Riccardo Mottola * Source\win32\WIN32Server.m: Remove left-over call to a mouse down event in a mouse-up 2009-11-10 Richard Frith-Macdonald * Source\win32\WIN32Server.m: Track mouse button state so that when mouse down events are lost (which appears occasionally to be the case) we can simulate the missing event. 2009-11-08 Fred Kiefer * Source/x11/XGServerWindow.m (-windowDevice:): Don't return a static variable as the window device. 2009-11-05 Fred Kiefer * Source/cairo/CairoGState.m: Set the colour for all text drawing. 2009-11-04 Fred Kiefer * Source/gsc/GSGState.m (-setColor:state:): Don't handle alpha specially. * Source/cairo/CairoGState.m: Clean up last change. 2009-11-04 Richard Frith-Macdonald * Source\winlib\WIN32GState.m: Fixes for read image. * Source\win32\WIN32Server.m: Use layered window for alpha. 2009-11-03 Fred Kiefer * Source/cairo/CairoGState.m: Set the fill or stroke colour immediatly before the drawing. * Source/art/ARTGState.m (-setColor:state:): Handle stroke colour correctly. 2009-11-03 Fred Kiefer * Source/cairo/CairoGState.m (-compositeGState:...): Use the offset adjustment for cairo > 1.8 in the general case. 2009-11-01 Fred Kiefer * Source/winlib/WIN32GState.m: first hack at GSReadRect implementation. 2009-11-01 Wolfgang Lux * Source/x11/XGServerWindow.m (setWindowHintsForStyle): Revert change to (Motif) window style hints that would add a border around appicons and miniwindows on some window managers. * Source/x11/XGServerWindow.m (-miniwindow): Remove code that can make programs unresponsive during window miniaturization. 2009-10-31 Thomas Gamper * Source/x11/XGGLFormat.m Check explicitly for GLX_SAMPLES and GLX_SAMPLE_BUFFERS. 2009-10-29 Fred Kiefer * Source/gsc/GSGState.m (-_fillRect:withPattern:): Convert the drawing coordinate back in user space. 2009-10-28 Thomas Gamper * Source/x11/XGGLFormat.m Check for GLX_VERSION_1_4. 2009-10-28 Riccardo Mottola * Source/x11/XGGLFormat.m cleaned up c99-isms 2009-10-25 Thomas Gamper * Source/x11/XGServerWindow.m Implement setMouseLocation:onScreen:. 2009-10-25 Thomas Gamper * Source/x11/XGGLContext.m * Source/x11/XGGLFormat.m * Headers/x11/XGOpenGL.h Clean up OpenGL stuff, reformat code and add Multisampling support. 2009-10-23 Fred Kiefer * Source/gsc/GSContext.m, * Headers/gsc/GSGStateOps.h, * Source/gsc/GSGState.m: Empty definitions of gradient methods. * Source/cairo/CairoGState.m: Simple cairo gradient implementation. 2009-10-20 Fred Kiefer * Source/winlib/WIN32GState.m: Small correction of last change. 2009-10-19 Fred Kiefer * Headers/gsc/GSGStateOps.h, * Source/gsc/GSGState.m, * Source/art/path.m, * Source/art/ARTGState.m, * Source/cairo/CairoGState.m, * Source/xlib/XGGState.m, * Source/winlib/WIN32GState.m: Implement pattern colours for all backends. 2009-10-18 Richard Frith-Macdonald * Source/x11/XGServerWindow.m: * Source/x11/XGServerEvent.m: Experimental code to try to spot window deminiaturisation and send an event to the gui so that it knows about it. 2009-07-31 Adam Fedor * Version 0.17.1 2009-07-27 Fred Kiefer * Source/cairo/CairoFontEnumerator.m, * Source/xlib/GSXftFontInfo.m: Use DejaVu as another fallback font, as Bitstream Vera and FreeSans are no longer supplied directly by Debian. 2009-07-13 Fred Kiefer * Source/winlib/WIN32GState.m (-_paintPath:) Only draw when the fill/stroke colour has a non zero alpha. 2009-07-10 Fred Kiefer * Source/cairo/CairoGState.m (-compositeGState:fromRect:toPoint:op:fraction:): Add hack to avoid scrolling problem for cairo > 1.8. 2009-05-31 Fred Kiefer * Source/x11/XWindowBuffer.m: Protect the XSHM code parts with #ifdef statements. 2009-05-31 Fred Kiefer * Source/gsc/GSContext.m (-DPScomposite:...:, -DPSdissolve:...:) Map onto GScomposite:toPoint:fromRect:operation:fraction:. * Source/gsc/GSGState.m (-compositeGState:fromRect:toPoint:op:, -dissolveGState:fromRect:toPoint:delta:) Map onto compositeGState:fromRect:toPoint:op:fraction:. * Source/winlib/WIN32GState.m (-compositeGState:fromRect:toPoint:op:, -dissolveGState:fromRect:toPoint:delta:), * Source/xlib/XGGState.m (-compositeGState:fromRect:toPoint:op:, -dissolveGState:fromRect:toPoint:delta:), * Source/cairo/CairoGState.m (-compositeGState:fromRect:toPoint:op:, -dissolveGState:fromRect:toPoint:delta:): Remove these methods. * Source/art/composite.m (-compositeGState:fromRect:toPoint:op:fraction:): Added. 2009-05-10 Adam Fedor * Version 0.17.0 2009-04-04 Riccardo Mottola * Source/x11/XGGLFormat.m, Source/x11/XGGLContext.m: reorder instructions for c89 compatibility 2009-03-28 Fred Kiefer * Source/x11/XWindowBuffer.m (+windowBufferForWindow:depthInfo:): Return an autorelease instance. * Source/cairo/XGCairoXImageSurface.m (-initWithDevice:), * Source/art/ARTGState.m (-GSSetDevice:): Adopt callers. 2009-03-12 Fred Kiefer * Source/x11/XGServerEvent.m: Correct formatting. 2009-03-12 Thomas Gamper * Source/x11/XGServerEvent.m: Implement key repeat support. 2009-03-07 Xavier Glattard * Source/x11/XGServerEvent.m: Fix a bug (from rev.28036) and consolidate the computing of expose rectangle of subwindows. 2009-03-06 Xavier Glattard * Source/x11/XGGLFormat.m: Missing var initialization. 2009-03-04 Xavier Glattard * Source/x11/XGServerEvent.m, * Source/x11/XGGLContext.m, * Source/x11/XGGLFormat.m: Fix typo and oversights - Comes along with the previous changes. 2009-03-04 Xavier Glattard * Source/x11/XGGLContext.m, * Source/x11/XGServerWindow.m, * Source/x11/XGServerEvent.m, * Source/win32/w32_GLcontext.m, * Source/win32/w32_windowdisplay.m, * Source/win32/WIN32Server.m: Two improvements related to OpenGL. 1) prevent the backing store to be flushed after a call to [-drawRect:] (and fix a small bug is win32 window style) 2) handle expose/paint events with retained/buffered backing store. * Source/x11/XGGLFormat.m, * Source/win32/w32_GLformat.m: Declare some new pixel format attributes. * Source/x11/XGGLContext.m, * Source/win32/w32_GLcontext.m: Undo Rev27944 related to NSRECT conversion. 2009-02-21 Fred Kiefer * Source/x11/XGGLContext.m (XGXSubWindow -initWithView:visualInfo:): Set black background pixel. 2009-02-21 Fred Kiefer * Source/x11/XGGLContext.m (XGXSubWindow -initWithView:visualInfo:) * Source/win32/w32_GLcontext.m (Win32Subwindow -initWithView:): Remove special code for different window border handling. 2009-02-11 Riccardo Mottola * Source/win32/WIN32Server.m: Handle Alt-Gr (bug #25397) 2009-02-11 Richard Frith-Macdonald * Source/x11/XGServerWindow.m: Minor fixes to compile with GC 2009-02-08 Wolfgang Lux * Source/x11/XGServerWindow.m (-titlewindow::, -docedited::): Add an asterisk before the window's title if its document is edited and the window manager is not capable of displaying the document's status (i.e., any window manager other than Window Maker for now). 2009-02-08 Matt Rice * Source/x11/XGGLContext.m (-[XGXSubWindow initWithView:visualInfo:]): Use the depth provided by the VisualInfo not the parent window. 2009-02-06 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Correction to last change. 2009-02-05 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Better handling of clip copying when the clip is not representable by cairo. 2009-02-05 Fred Kiefer * Source/xlib/XGBitmap.m: Fix some compiler warnings. 2009-02-03 Richard Frith-Macdonald * Source/win32/WIN32Server.m (-setParentWindow:forChildWindow:), Temporarily comment out method implementation as it was preventing popup menus from working. 2009-01-30 Richard Frith-Macdonald * Source/win32/WIN32Server.m: fix typo * Source/x11/XGServerWindow.m: ditto 2009-01-29 Fred Kiefer * Source/win32/WIN32Server.m (-setPartentWindow:forChildWindow:), * Source/x11/XGServerWindow.m (-setPartentWindow:forChildWindow:): Implement new method. * Source/cairo/CairoGState.m (-compositeGState:...): Adjust y coordinate of point. 2009-01-25 Riccardo Mottola * Source/art/image.m: Fix for big-endiam machines 2009-01-24 Riccardo Mottola * Source/art/image.m: Optimized and correct handling of 16 bit in _get_8_bits() 2009-01-17 Wolfgang Lux * Source/x11/XGServerWindow.m (_setSupportedWMProtocols:, _checkStyle:, window::::, orderwindow:::): Set the WM protocols supported by a window according to its style mask. 2009-01-13 Fred Kiefer * Source/art/ftfont.m: Give more information on failed font face access. 2008-12-21 Adam Fedor * Version 0.16.0 2008-12-19 Wolfgang Lux * Source/x11/XGServerEvent.m (check_modifier): Fix an issue where modifier key settings could be set incorrectly. 2008-12-19 Nicola Pero * All GNUmakefiles: removed GNUSTEP_CORE_SOFTWARE=YES and added PACKAGE_NAME=gnustep-back. * GNUmakefile: Export PACKAGE_NAME to reduce chances of a problem if a GNUmakefile in a subdirectory is missing it. 2008-12-18 Nicola Pero * All GNUmakefiles: added GNUSTEP_CORE_SOFTWARE=YES at the beginning. * GNUmakefile: Export GNUSTEP_CORE_SOFTWARE to reduce chances of a problem if a GNUmakefile in a subdirectory is missing it. 2008-12-17 Fred Kiefer * Source/winlib/WIN32FontInfo.m (-coveredCharacterSet): Set cbThis element of GLYPHSET structure before calling Windows funtion. 2008-12-17 Richard Frith-Macdonald * Tools/gpbs.m: Remove use of private method for connection keepalive. Keepalive is now enabled in base when necessary. 2008-12-15 Wolfgang Lux * Source/x11/XGServerEvent.m (-processEvent:): Ignore _NET_STATE_WM property changes with Window Maker as it causes problems with hidden windows. Add a workaround for Window Maker so that unhidden windows correctly show their document edited status. 2008-12-11 Fred Kiefer * Source/cairo/CairoContext.m (-GSDrawImage::): Correct test whether image conversion is needed. 2008-12-10 Wolfgang Lux * Source/x11/XGServerEvent.m (-runLoopShouldBlock:): Add method to avoid blocking the run loop when the X event queue is not empty. 2008-12-02 Richard Frith-Macdonald * GNUmakefile: * Fonts/GNUmakefile: * Tools/GNUmakefile: * Source/winlib/GNUmakefile: * Source/art/GNUmakefile: * Source/GNUmakefile: * Source/cairo/GNUmakefile: * Source/xlib/GNUmakefile: * Source/win32/GNUmakefile: * Source/x11/GNUmakefile: * Source/gsc/GNUmakefile: * Source/xdps/GNUmakefile: * Documentation/Back/GNUmakefile: * Documentation/GNUmakefile: Don't override installation domain ... fix for bug #24671 2008-11-30 Wolfgang Lux * install.sh: Fix header syntax and provide default for make command argument. 2008-11-20 Richard Frith-Macdonald * Tools/gpbs.m: Use new private method for connection keepalive as we need it on windows. 2008-11-20 Wolfgang Lux * Source/x11/XGServerWindow.m ([XGServer -windowlist]): Implement a fix for bug #24707. 2008-11-14 Wolfgang Lux * Tools/gpbs.m (init): Don't change SIGABRT handler to prevent infinite recursion on abort(). * Tools/xpbs.m (+receivedEvent:type:extra:forMode:): Don't cache number of pending events. Prevents an issue where gpbs could block in XNextEvent and other applications contacting the pasteboard server become unresponsive. 2008-11-06 Fred Kiefer * Source/cairo/CairoContext.m (-GSDrawImage::): Convert the bitmap, when the format is unsupported. 2008-10-26 Fred Kiefer * Source/x11/XWindowBuffer.m (test_xshm): Check whether the X server supports shm pixmaps. 2008-10-24 Fred Kiefer * Source/win32/WIN32Server.m (-setalpha::): Implement transparent windows. * Source/winlib/WIN32GState.m (-DPSimage:...:): Call SetStretchBltMode() before scaling a bitmap. 2008-10-24 Fred Kiefer * Tools/xpbs.m (+initializePasteboard): Use XInternAtom when XInternAtoms isn't available. Patch by Riccardo Mottola . * configure.ac: Check for XInternAtoms. * configure, * config.h.in: Regenerate. 2008-10-24 Fred Kiefer * Source/x11/XGServer.m (-visualForScreen:, -depthForScreen:): New methods that hide RContext details. * Headers/x11/XGServer.h: Declare these new methods. * Source/x11/XWindowBuffer.m: Get the default visual and depth from the XGServer. 2008-10-22 Fred Kiefer * Source/x11/XGServerWindow.m (-_checkStyle:): Correct code for double parent handling. Patch by Wolfgang Lux . 2008-10-17 Fred Kiefer * Headers/win32/WIN32Geometry.h (MSScreenRectToGS, GSScreenRectToMS), * Source/win32/WIN32Server.m, * Source/win32/w32_movesize.m: Remove unused parameters from these functions and adjust callers. 2008-10-17 Fred Kiefer * Headers/win32/WIN32Server.h, * Source/win32/WIN32Server.m, * Source/win32/w32_activate.m, * Source/win32/w32_movesize.m, * Source/win32/w32_general.m: Removed unused and unneeded code left over from the last cleanup. This code was mostly setting server flags that never got read or using falgs that never were set. 2008-10-14 Fred Kiefer * Source/winlib/WIN32GState.m: Removed unneeded code. General cleanup. * Source/winlib/WIN32GState.m (-DPSimage:...:): Scale and rotate images correctly. * Source/winlib/WIN32GState.m (-compositeGState:...fraction:): Position images on scaled views better. 2008-09-14 Fred Kiefer * Source/art/ARTContext.m (-setupDrawInfo): Moved code from here to... * Source/x11/XGServer.m (-getForScreen:pixelFormat:masks:::): ... here, including helper functions. Commented out this code and replaced it by a different approach. * Headers/x11/XGServer.h: Declare this new method. 2008-09-14 13:17-EDT Gregory John Casamento * install.sh: Adding install script for use by compile-all. 2008-08-19 Fred Kiefer * Source/art/ARTContext.m (-GSSetDevice:::): Only call setupDrawInfo once. * Source/art/ARTContext.m (-setupDrawInfo): Try to handle endianess differance better. * Source/art/ARTContext.m (-initializeBackend): Call artcontext_setup_gamma(). * Source/art/blit.h, * Source/art/blit-main.m: New function artcontext_setup_gamma() split off from artcontext_setup_draw_info(). 2008-08-14 Fred Kiefer * Source/x11/XGServerWindow.m (-_ewmh_isMinimized:): Correct indentation. * Source/x11/XGServerEvent.m (-receivedEvent:type:extra:forMode:): For PropertyNotify cache the window first. 2008-07-19 Fred Kiefer * Source/x11/XGServerWindow.m (-window::::): For EWMH window enable property change notifications. * Source/x11/XGServerWindow.m (-_ewmh_isMinimized:): Check whether the window is minimized. * Headers/x11/XGServerWindow.h (-_ewmh_isMinimized:): Declare new method. * Source/x11/XGServerEvent.m: Handle case when window gets minimized. * Headers/x11/XGGeneric.h: Add atom for hidden state. Patch by Hubert Chathi . 2008-07-12 Fred Kiefer * Source/xlib/GSXftFontInfo.m (-setupAttributes:), * Source/xlib/XGFontSetFontInfo.m (-setupAttributes:), * Source/xlib/XGFont.m (-setupAttributes:), * Source/art/ftfont.m (-setupAttributes:), * Source/art/ftfont-old.m (-setupAttributes): Correct the sign of the descender in the bounding box. 2008-07-12 Fred Kiefer * Source/xlib/GSXftFontInfo.m (-setupAttributes:), * Source/xlib/XGFontSetFontInfo.m (-setupAttributes:), * Source/xlib/XGFont.m (-setupAttributes:): Correct the setting of fontBBox, used for boundingRectForFont. 2008-07-11 Fred Kiefer * Source/x11/XGServerWindow.m (-setinputstate:): Disable new code, as it does not work on KDE 4. 2008-07-08 Fred Kiefer * Source/x11/XGServerWindow.m (-setinputfocus:): For EWMH window managers set the user time before requesting focus. * Source/x11/XGServerWindow.m (-setinputstate:): For EWMH window managers set active window status. Based on patch by Hubert Chathi . 2008-06-26 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Use a runtime version check and adjust from > to >= 1.6.0. * Source/cairo/CairoFontInfo.m (-setupAttributes): Slightly better error checks. 2008-06-14 Adam Fedor * Version 0.14.0 2008-06-12 Fred Kiefer * Source/x11/XGServerEvent.m, * Source/x11/XGDragView.m: Convert X event millisecond timestamp to NSEvent second timestamp. 2008-05-25 Adam Fedor * Revert library license version to 2 until applications can be converted 2008-06-07 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Don't use special clip adjustment for cairo > 1.6.0, as this got fixed there. 2008-06-01 18:00-EDT Gregory John Casamento * Headers/x11/XGGeneric.h: * Source/x11/XGServerWindow.m: Added code to automatically make any window which uses the NSDesktopWindowLevel also be omnipresent. This capability will be added as a style later. 2008-05-28 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Avoid double allocation of dashes memory. * Source/gsc/GSGState.m (-DPSrectfill::::, -DPSrectstroke::::, -DPSrectclip::::): Don't use autoreleased objects. 2008-05-27 Fred Kiefer * Source/x11/XGServerWindow.m (check_modifier, -receivedEvent:...): Faster checking for modifiers. 2008-05-27 Fred Kiefer * Source/xlib/GSXftFontInfo.m (-coveredCharacterSet): Moved the swapping into the loop, where the actual data is available. Patch by Sebastian Reitenbach . 2008-05-25 Adam Fedor * configure.ac: Fail if libXext or libXt not found when building x11 server. Set have_freetype variable. 2008-05-25 Nicola Pero * Tools/GNUmakefile.postamble: Use GNUSTEP_DOC instead of GNUSTEP_DOCUMENTATION, and GNUSTEP_DOC_MAN instead of GNUSTEP_DOCUMENTATION_MAN. 2008-05-22 Adam Fedor * Source/cairo/CairoContext.m (-GSSetDevice:::): Fix memory leak. 2008-05-16 Adam Fedor * Source/XGCommonFont.m (XGFontCacheName): New function to standardize display name (and handle new Mac OS X display names). * Tools/font_cacher.m ([XFontCacher -getPathFor:display]): Use it. * Source/xlib/XGFontManager.m (cache_name): Use it. 2008-04-11 Fred Kiefer * Source/xlib/GSXftFontInfo.m (Ones): Correct the parameter name. * Source/winlib/WIN32FontInfo.m (-glyphIsEncoded:): Add parameter to windows call to supress defaults glyphs for missing ones. 2008-04-08 Fred Kiefer * Source/xlib/XGGState.m (-_paintPath:, -_doComplexPath:...): Correct the handling of complex path filling. This is needed for the glyph drawing. 2008-04-07 Fred Kiefer * Source/xlib/GSXftFontInfo.m (-appendBezierPathWithGlyphs:count:toBezierPath:) Implement this method with code copied over from the art backend. 2008-04-07 Fred Kiefer * Source/art/ftfont.m, * Source/art/ftfont-old.m (-glyphPacking): Add missing method. * Source/gsc/GSContext.m (-appendBezierPathWithPackedGlyphs:path:): Send on to gstate. * Headers/gsc/GSGStateOps.h (-appendBezierPathWithPackedGlyphs:path:): New method. * Source/gsc/GSGState.m (-DPScharpath:, -appendBezierPathWithPackedGlyphs:path:): Implement these methods. * Source/xlib/GSXftFontInfo.m (-coveredCharacterSet) Add missing method. 2008-04-04 Fred Kiefer * Source/winlib/WIN32FontInfo.m (-appendBezierPathWithGlyphs:count:toBezierPath:): New method. Patch by Christopher Armstrong . * Source/art/ftfont.m, * Source/art/ftfont-old.m: Moved ligature handling code from here to gui. * Source/cairo/CairoFontInfo.m (-glyphIsEncoded:): Report all ligatures as not supported, as we have no way to determine if they exist in the font. 2008-04-03 Fred Kiefer * Source/cairo/CairoFontInfo.m (-appendBezierPathWithGlyphs:...): Correct implementation. * Source/cairo/CairoGState.m (-DPScharpath::): Correct implementation. 2008-03-29 Fred Kiefer * Source/cairo/CairoFontEnumerator.m, * Source/cairo/CairoFaceInfo.m, * Source/cairo/Win32CairoSurface.m, * Source/cairo/CairoFontInfo.m, * Source/cairo/Win32CairoGlitzSurface.m, * Source/cairo/CairoGState.m: Clean up and better error check and reporting on cairo and malloc calls. 2008-03-19 Adam Fedor * Version 0.13.2 * configure.ac: Add --without-freetype option 2008-03-17 21:01-EST Gregory John Casamento * Source/gsc/GSStreamContext.m: Add back implementation for DPSrectclip::::. 2008-03-15 19:35-EST Gregory John Casamento * Source/gsc/GSStreamContext.m: Correct call in NSDrawBitmap::::... to add NSHeight, not NSWidth to the y coordinate if it's flipped. 2008-03-15 17:48-EST Gregory John Casamento * Source/gsc/GSStreamContext.m: Added implementation for GSDrawImage. 2008-03-13 19:37-EST Gregory John Casamento * Source/gsc/GSStreamContext.m: Remove implementation of DPSrectclip:::: since it was causing issues with printing. Will investigate further to see if this is the correct fix. 2008-03-09 Fred Kiefer * Source/art/ARTContext.m (-GSDrawImage:): Remove this hack again. * Source/art/image.m (_image_get_color_rgb_cmyk_gray, _image_get_color_rgb_8): Make sure the image gets unpremultied in all cases. 2008-03-08 Fred Kiefer * Source\win32\WIN32Server.m (-exwindowStyleForGSStyle:): New method used in window::::, stylewindow: and styleoffsets:::::. * Headers\win32\WIN32Server.h, * Source\win32\WIN32Server.m (-resetForGSWindowStyle:w32Style:): Remove method. 2008-03-06 Richard Frith-Macdonald * Headers\win32\WIN32Server.h: make 'orderedIn' and 'level' 32bit fields at start of structure so that we can easily use GetWindowLong() and SetWindowLong() with them. * Source\win32\w32_movesize.m: * Source\win32\WIN32Server.m: Change to accessing 'orderedIn' and 'level' directly using GetWindowLong() and SetWindowLong() so that code works when windows are owned by another app. 2008-03-06 Richard Frith-Macdonald * Source\win32\w32_movesize.m: Bypass all existing code to send a resize when a window is minimised ... just call the miniaturise: method of the gui. Should fix bug 22274 2008-03-06 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Correct the cairo version #ifdef. 2008-03-06 Richard Frith-Macdonald * Source\win32\WIN32Server.m: Improve window level code ... when moving a window to the top of a level, jump it right to the top of the window z-order so that it is above any non-gnustep windows. * Source\win32\w32_movesize.m: If a window is jumped to the top of the z-order and hence breaks the level rules, use a bubble sort to get the windows back in level order by raising any windows which are lower than they should be. 2008-03-05 Richard Frith-Macdonald * Headers\win32\WIN32Server.h: Add fields to track window level/ordering * Source\win32\WIN32Server.m: add code to implement window levvel/order management. NB. This is incomplete ... it seems that direct user action like clicking on a window will reorder it without going through the orderwindow::; method, so we need to deal with that somehow. * Source\win32\w32_movesize.m: Ensure that desktop level windows are pinned to the bottom. 2008-03-04 Xavier Glattard * configure.ac, configure : Display warning msgs when cairo backend is selected on win32 * Headers/cairo/Win32CairoSurface.h, Headers/cairo/Win32CairoGlitzSurface.h, Source/cairo/Win32CairoSurface.m, Source/cairo/Win32CairoGlitzSurface.m, Source/cairo/CairoContext.m, : Cairo and Cairo/Glitz experimental backends on win32 2008-02-26 Fred Kiefer * Source/x11/XGServerWindow.m (-_checkStyle:): Restructure code for double parent handling to avoid wrong computation path. 2008-02-25 Fred Kiefer * Source/x11/XGServer.m (-_screenContextForScreen:): Remove wrong local variable declaration and reorder code. * Source/x11/XGServer.m (-_initXContext:): Don't create default screen. 2008-02-15 Fred Kiefer * Source/win32/WIN32Server.m (-windowStyleForGSStyle:): Rewrite to handle all combination of styles. 2008-02-14 Fred Kiefer * Headers/win32/WIN32Server.h, * Source/win32/WIN32Server.m, * Source/win32/w32_activate.m, * Source/win32/w32_movesize.m, * Source/win32/w32_create.m, * Source/win32/w32_general.m, * Source/win32/w32_text_focus.m, * Source/win32/w32_windowdisplay.m: General cleanup and reformatting. * Source/win32/w32_Events.h: Removed this file. 2008-02-14 Fred Kiefer * Headers/win32/WIN32Server.h: Extend WIN_INTERN with backingStoreEmpty flag. * Source/win32/WIN32Server.m (-windowbacking::): Set backingStoreEmpty to YES; * Source/win32/w32_windowdisplay.m: Use backingStoreEmpty to determine drawing method. Patch by Christopher Armstrong . 2008-02-14 Fred Kiefer * Tools/win32pbs.m (-receivedEvent:...forMode:): Don't call NSApp to terminate the program. 2008-02-08 Fred Kiefer * Source/art/ARTContext.m (-GSDrawImage:): Hack to allow the handling of pre-multiplied bitmaps. 2008-01-31 Fred Kiefer * Tools/win32pbs.m: Use event polling code from WIN32Server.m. 2008-01-31 Fred Kiefer * Tools/xpbs.m: Improve support for RTF and add TIFF support. 2008-01-29 Fred Kiefer * Tools/xpbs.m: Add support for variable available clipboard types and minimal support for RTF. 2008-01-26 Fred Kiefer * Tools/xpbs.m: Add secondary selection support. Define some more MIME types and add support for more standard targets. 2008-01-24 Fred Kiefer * Source/xlib/GSXftFontInfo.m (-setupAttributes): Use FC_PIXEL_SIZE instead of FC_SIZE. Fixes #21912. 2008-01-21 Fred Kiefer * Headers/x11/XGOpenGL.h, * Source/x11/XGGLContext.m, * Source/x11/XGGLFormat.m: Get to work with newer versions of GLX. Patch by Thomas Gamper , slightly reworked. 2008-01-19 Fred Kiefer * Source/win32/WIN32Server.m (-setWindowdevice:forContext:): Correct wrong parameter name. 2008-01-19 Fred Kiefer * Source/x11/XGServerWindow.m: (-setWindowdevice:forContext:), * Source/win32/WIN32Server.m (-setWindowdevice:forContext:): Method replaces windowdevice:. * Source/gsc/GSContext.m, * Source/gsc/GSStreamContext.m, * Source/art/ARTContext.m, * Source/cairo/CairoContext.m, * Source/xlib/XGContext.m, * Source/winlib/WIN32Context.m (+GStateClass, +handlesPS): New methods to simplify the implementation of initWithContextInfo:. In that method call setWindowdevice:forContext: when the destination is a window. * Source/art/ARTContext.m (-setupDrawInfo): New method, code comes from old initWithContextInfo:, now called in GSSetDevice:::. 2008-01-11 Richard Frith-Macdonald * Source/XGServerWindow.m: Try to find window offsets using off-screen windows unless the GSBackChecksOffsetsOnScreen user default is set to YES. 2008-01-07 Fred Kiefer * Source/win32/WIN32Server.m (-receivedEvent:...forMode:): Add #ifdef for Cygwin. 2008-01-01 Adam Fedor * Version 0.13.1 2007-12-11 Isaiah Beerbower * Source/cairo/* * Headers/cairo/* Reverting back to fontconfig font system. 2007-12-10 Isaiah Beerbower * Source/cairo/CairoFontEnumerator.m (-enumerateFontsAndFamilies, cacheFolder, bundleModificationDate, cacheFont, cacheNFontBundle, mergeFontInfo): Rewrite to cache fonts in a plist and support nfont bundles. (-defaultSystemFontName, -defaultBoldSystemFontName, -defaultFixedPitchFontName): Added actual PostScript name for Bitstream Vera fonts. * Source/cairo/CairoFaceInfo.m (-fontFace, -initWithfamilyName:fullName:weight:italicAngle:traits:files:index:, -setFullName:, -fullName, -setItalicAngle:, -italicAngle, -setIndex:, -index): Update to reflect changes in CairoFontEnumerator. * Headers/cairo/CairoFaceInfo.m: Same. * Source/cairo/CairoFontInfo.m (-setupAttributes): Take italicAngle & fullName from CairoFaceInfo. 2007-12-10 Fred Kiefer * Source/xlib/GSXftFontInfo.m: Explicitly include NSDictionary.h header for better MacOS-X compatibility. * Headers/gsc/GSGState.h: Change fillColorS and strokeColorS to NSColorSpace. * Source/gsc/GSGState.m (NSColor-colorWithValues:colorSpaceName:): Removed. * Source/gsc/GSGState.m (-GSSetFillColorspace:, -GSSetStrokeColorspace:, -GSSetFillColor:, -GSSetStrokeColor:): Changed to use NSColorSpace. 2007-12-03 Riccardo Mottola * Source/winlib/WIN32GState.m: Implement Greyscale image handling 2007-11-29 Richard Frith-Macdonald * Source/art/ReadRect.m: * Source/art/ARTContext.m: * Source/art/shfill.m: Explicitly include NSDictionary.h header for better MacOS-X compatibility. 2007-11-29 Richard Frith-Macdonald * Source/x11/XGServerWindow.m: ([imagecursor::::::]) don't flip the hot point coordinates ... NSCursor coordinates are already supposed to be flipped. 2007-11-29 Fred Kiefer * Headers/x11/XGGeneric.h: Add atoms for new window types. Add definition of _NET_WM_STATE_ADD and _NET_WM_STATE_REMOVE * Source/x11/XGServerWindow.m (-setwindowlevel::): Better setting of skip state for window. * Source/x11/XGServerWindow.m (-orderwindow:::): Use it here as well. 2007-11-22 Fred Kiefer * Source/gsc/GSContext.m (-GSDrawImage:):Implement via NSDrawBitmap::::::. 2007-11-09 Adam Fedor * Version 0.13.0 2007-11-05 Fred Kiefer * COPYING: Add GPL 3 licence file. 2007-11-05 Fred Kiefer * Source/cairo/CairoGState.m (-DPSsetflat:, -DPSsetlinewidth:, -DPSsetmiterlimit, -DPScurrentflat:, -DPScurrentlinewidth:, -DPScurrentmiterlimit:, -DPSsetdash:::): Convert floats from user space to drawing space and visa versa. * Source/cairo/CairoGState.m (-DPSsetdash:::): Adjust dash values slightly. * Source/cairo/CairoFontEnumerator.m: Change NSLog to NSDebugLog. 2007-10-31 Fred Kiefer * Source/x11/XGServerWindow.m (-_setupRootWindow): Use objectForKey: instead of stringForKey:. Patch by Wolfgang Lux . 2007-10-30 Adam Fedor * gnustep-back.spec.in: Change Copyright to License. 2007-10-30 Fred Kiefer * Change files to use GPL 3 and LGPL 3. * Prepare for next release. 2007-10-18 Fred Kiefer * Source/cairo/CairoContext.m, * Source/cairo/CairoGState.m: Format cleanup. * Source/cairo/XGCairoXImageSurface.m (-initWithDevice:): Use XGCairoSurface when a NSBackingStoreNonretained type window is used. 2007-10-12 Fred Kiefer * Source/x11/XGServerWindow.m (-placewindow:): Change window to be temporary resizable. Patch by Wolfgang Lux . * Source/x11/XIMInputServer.m: Clean up includes to avoid compiler warning. * Source/x11/raster.c (calculateCombineArea): Change parameter signedness to avoid compiler warnings. * Source/x11/convert.c (convertTrueColor_generic, convertPseudoColor_to_8): Change parameter signedness to avoid compiler warnings. 2007-10-08 Fred Kiefer * Source/cairo/CairoFontInfo.m (-appendBezierPathWithGlyphs:count:toBezierPath:): First implemenation. 2007-10-07 Fred Kiefer * Headers/gsc/GSFunction.h: Declare the -getsample:: method in header. 2007-10-05 Fred Kiefer * Source/art/shfill.m (-DPSshfill:): Correct typing error. Remove now obsolete method declaration. * Headers/gsc/GSFunction.h, * Source/gsc/GSFunction.m: New files. Implementation of Postscript function taken from art/shfill.m. * Source/gsc/GNUmakefile: Compile new file. * Source/gsc/GSContext.m (-DPSshfill:), * Source/gsc/GSGState.m (-DPSshfill:): Implement new method. 2007-10-05 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Only use cairo 1.4 functions when cairo version fits. * Source/cairo/XGCairoXImageSurface.m (-initWithDevice:): Use depth from window device. 2007-10-01 Fred Kiefer * Source/x11/XGDragView.m: Add missing include. 2007-10-01 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): No error logging when copy of path fails. This is normal in cairo 1.4.10 for empty paths. 2007-09-12 Fred Kiefer * Headers/cairo/CairoGState.h, * Source/cairo/CairoGState.m (-setSize, -DPSgsave, -DPSgrestore): Remove unused methods. * Headers/cairo/CairoPDFSurface.h, * Source/cairo/CairoPDFSurface.m: New files. * Source/cairo/GNUmakefile: Add new source file. * Source/cairo/CairoContext.m (-initWithContextInfo:, -beginPrologueBBox:...title:) Rewrite to support PDF output. 2007-09-09 Fred Kiefer * Source/cairo/CairoGState.m (-DPSeofill, -DPSfill, -DPSstroke): Clear the GNUstep path after operation. 2007-09-06 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Copy dash and clipping. * Source/cairo/CairoGState.m (-_setPath:): Clear the cairo path. 2007-09-05 Fred Kiefer * Headers/x11/XGGeneric.h: Add ivars for event time keeping. * Headers/x11/XGServer.h: Declare new event time keeping methods. * Source/x11/XGServerEvent.m (-setLastTime:, -lastTime): Implement new methods and use them to store event time. * Source/x11/XGServerWindow.m: Use these methods to get event time. 2007-09-05 Fred Kiefer * Source/cairo/CairoGState.m: Add more checks for cairo status. 2007-09-05 Fred Kiefer * Source/x11/XGServerWindow.m (-_checkStyle:, -windowlist): Use defScreen instead of 0. 2007-09-05 Fred Kiefer * configure.ac, * configure: Move checking for Xrender extension. * Source/cairo/XGCairoXImageSurface.m: Add include for config.h. Patch by Yen-Ju Chen . 2007-09-04 Fred Kiefer * Source\winlib\WIN32FontInfo.m (-coveredCharacterSet): Create the NSMutableCharacterSet to store the character ranges in. 2007-09-03 Nicolas Roard * configure: * configure.ac: check that Xrender lib is present and add it to the link process. Only use Xrender for Cairo. * Source/cairo/XGCairoXImageSurface.m: use 32 bits surfaces when available, else stay with 24bits surface. * Source/cairo/CairoGState.m: some cleaning, and fixed the scrolling bug. 2007-09-02 Nicolas Roard * configure: * configure.ac: * config.h.in: added checking for Xrender extension * Source/x11/context.c: Now check for 32 bit surface + alpha channel * Source/cairo/XGCairoSurface.m: Modified to get the correct visual, not the default one * Source/cairo/CairoGState.m: Use cairo groups to allow recopy on the same surface 2007-08-21 Fred Kiefer * Source/art/ftfont.m, * Source/art/ftfont-old.m: Extracted code shared between these two files into new files. * Source/art/FTFaceInfo.h, * Source/art/FTFaceInfo.m, * Source/art/FTFontEnumerator.h, * Source/art/FTFontEnumerator.m: New files with extracted code. * Source/art/GNUmakefile: Add new source files. 2007-08-21 Fred Kiefer * Source/x11/XGServerWindow.m (-_setupRootWindow): Revert last change. * Source/x11/XGServerWindow.m (-setinputfocus:): Use CurrentTime instead of generic.lastTime. 2007-08-21 Fred Kiefer * Source/x11/XGServerEvent.m (-processEvent:): Made handling of focus in and out more explicit. 2007-08-16 Fred Kiefer * Source/xlib/XGFontManager.m (load_cache), * Tools/font_cacher.m (-writeCacheTo): Increase version number of font format, as font mask values have changed. 2007-08-16 Fred Kiefer * Source/x11/XGServerWindow.m (-_setupRootWindow): Set lastTime to CurrentTime not 1 to get setinputfocus working for the first activation of the application. 2007-08-15 Fred Kiefer * Source/x11/XGServerWindow.m (-_checkWMSupports:, -_tryRequestFrameExtents:): Correct minor errors. * Source/art/ftfont.m (-coveredCharacterSet): Protect against illegal characters. 2007-08-15 Fred Kiefer * Source/x11/XGServerWindow.m: Add more EWMH methods and helper methods for them. * Tools/xpbs.m: Simplify dragging support code. 2007-08-13 Fred Kiefer * Source/art/ftfont.m (-coveredCharacterSet): Correct code. Patch by Yen-Ju Chen . 2007-08-07 Fred Kiefer * Source/art/ftfont.m (-coveredCharacterSet): Use local FT_Size variable instead of ivar. The ivar is sometimes invalid. Cleaned up compiler warnings. 2007-08-02 Fred Kiefer * Source/x11/XGServer.m (+initializeBackend): Handle SIGINT by calling ([NSApp terminate: NSApp]) to shut down cleanly. 2007-07-03 Sergii Stoian * Source/cairo/CairoGState.m (-_setPoint): Adjust point. (-_adjustPath:): Optimize and cleanup. (-compositeGState:fromRect:toPoint:op:fraction:): Adjust toPoint. 2007-07-02 Sergii Stoian * Source/cairo/CairoGState.m (-DPSshow:): Apply correct scale and translate transformation matrix. (-DPSsetstrokeadjust:): Implement. (-DPSinitgraphics): Set _strokeadjust to 1 by default. (-_adjustPath:): Implement new method that place the path to pixel boundaries. (-_setPath:): Change method definition adding fillOrClip argument. Use _adjustPath: method. (-DPSclip): Change call of _setPath: to new format. (-DPSeoclip): Ditto. (-DPSeofill): Ditto. (-DPSfill): Ditto. (-DPSstroke): Ditto. (-compositerect:op:): Ditto. * Headers/cairo/CairoGState.h: Define _strokeadjust variable. * Source/cairo/CairoFontInfo.m: (-widthOfString:): Add sanity check. 2007-06-29 Fred Kiefer * Headers/cairo/CairoSurface.h, * Source/cairo/CairoSurface.m (-setSize:): Add method. * Headers/cairo/CairoGState.h, * Source/cairo/CairoGState.m (-setSize:, -showPage): Add methods. * Source/cairo/CairoContext.m (-beginPrologueBBox:...title:, -showPage): New methods. * Source/cairo/CairoGState.m (-GSShowGlyphs::): Handle rotated text correctly. 2007-06-05 Fred Kiefer * Source/art/image.m (-DPSimage:): Replaced appendTransform: with prependTransform:. Undoes change from 2004-01-25. 2007-05-02 Nicola Pero * Source/GNUmakefile.postamble (after-clean): Remove $(BUNDLE_NAME)Info.plist on clean. 2007-04-27 Fred Kiefer * Headers/cairo/CairoSurface.h, * Source/cairo/CairoSurface.m: Remove default surface type setting. * Headers/cairo/XGCairoSurface.h: Remove includes. * Source/cairo/XGCairoSurface.m: Add includes. * Headers/cairo/XGCairoXImageSurface.h: Remove includes. * Source/cairo/XGCairoXImageSurface.m: Add includes, add missing dealloc method. * Headers/cairo/CairoPSSurface.h, * Source/cairo/CairoPSSurface.m: New files. * Source/cairo/GNUmakefile: Add CairoPSSurface. * Headers/cairo/CairoGState.h, * Source/cairo/CairoGState.m: Replace method -GSSetDevice::: with -GSSetDevice::: and GSCurrentDevice::: with GSCurrentSurface:::. * Source/cairo/CairoGState.m (-DPSshowpage): Implement this method. * Source/cairo/CairoContext.m (-DPSgrestore, -DPSgsave): Remove these newly added methods. * Source/cairo/CairoContext.m (-initializeBackend): No longer set default surface type. * Source/cairo/CairoContext.m (-GSSetDevice:::): Create the surface here. * Source/cairo/CairoContext.m (-initWithContextInfo:): For PS output set the surface here. 2007-04-24 Fred Kiefer * Source/x11/XGDragView.m (-sendExternalEvent:... toWindow:) Tell xdnd about available types and selection owner. * Source/x11/XGServerEvent.m (processEvent:): Handle case SelectionRequest to get some simple xdnd support. Based on a patch by Matt Rice . 2007-04-14 Adam Fedor * Version: Bump version 2007-04-04 Fred Kiefer * Headers/gsc/GSContext.h: Remove ivar gtable. * Source/gsc/GSContext.m: Changed to use a gtable object shared between all contexts. * Headers/cairo/CairoGState.h: Declare new methods for save and restore. * Source/cairo/CairoContext.m (-DPSgrestore, -DPSgsave): Use these methods. * Source/cairo/CairoGState.m (-DPSgrestore, -DPSgsave): Implement these methods. * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Another try on conversion of the coordinates. 2007-04-14 Adam Fedor * Version 0.12.0 (From gnustep-stable branch) 2007-03-30 Fred Kiefer * header/xlib/XGGeometry.h: Replace calls to the now deprecated methods on NSAffineTransform with correct ones. 2007-03-23 Fred Kiefer * Source/art/ReadRect.m, * Source/art/composite.m, * Source/art/shfill.m, * Source/cairo/CairoGState.m, * Source/gsc/GSGState.m, * Source/winlib/WIN32GState.m, * Source/xlib/XGGState.m: Replace calls to the now deprecated methods on NSAffineTransform with correct ones. 2007-03-22 Fred Kiefer * Source/art/ARTGState.h: Declare internal methods. * Source/art/ARTGState.m: New file split out from ARTContext.m. * Source/art/ARTConext.m: Removed ARTContext bits. * Source/art/blit-main.m: New file split out from blit.m. * Source/art/blit.m: Removed self include stuff. * Source/art/GNUmakefile: Add new source files. * Source/art/composite.m: Adopt to GNUstep coding style. 2007-03-22 Fred Kiefer * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Correct computation of source rectangle and add flip correction. The later is currently commented out. 2007-03-21 Fred Kiefer * Source/cairo/CairoGState.m: General clean-up and optimisation of this class. 2007-03-21 Fred Kiefer * Source/cairo/CairoGState.m (-setColor:state): Always call cairo_set_source_rgba(). * Source/cairo/CairoGState.m (-GSReadRect:): Correct placement of rectangle. * Source/cairo/CairoGState.m (-compositerect:op:): Use cairo_paint() instead of cairo_fill(). 2007-03-18 Fred Kiefer * Source/cairo/CairoGState.m: A complete rewrite, now path and transformation handling from the super class get used. * Source/cairo/CairoFontInfo.m (-setupAttributes:, -drawGlyphs:length:on:): Don't invert the font matrix. * Source/gsc/GSGState.m (-DPSrectclip::::, -DPSrectfill::::, -DPSrectstroke::::): Use NSBezierPath to get correct results when rotated. 2007-03-11 Fred Kiefer * Source/x11/XGDragView.m (GSActionForDragOperation, GSDragOperationForAction): Completed and corrected drag type mapping between xdnd and OpenStep. NSDragOperationAll should now be map back correctly when converted to xdnd and back again. 2007-03-07 Xavier Glattard * Source/win32/Event_format.sed, * Source/win32/GSDisplayServer_details.m, * Source/win32/RELEASE_NOTES, * Source/win32/w32_config.h, * Source/win32/w32_debug.m, * Source/win32/w32_notifications.m: Delete files. * Source/win32/WIN32Server.m (and other files): Deletion of all non-GNUstep debug stuff (printf...) Deletion of all Notification hooks (used for a debugging purpose) Deletion of the Application preference Panel that pops up the 1st time you run _any_ application. Deletion of the check of GSWINHandlesWindowDecorations and GSWIN32HandlesWindowDecorations options (none worked because of a typo and are now deprecated). Use of GSBackHandlesWindowDecorations option like X11 backend instead of GSUseWMStyles (marked as deprecated). Use of GSBackUsesNativeTaskbar option instead of GSUseWMTaskbar (marked as deprecated) All these options are read in -initWithAttribute: (no more in +inializeBackend) and set an instance (not class) variable. Add methods -handlesWindowDecorations/-setHandlesWindowDecorations Add methods -usesNativeTaskbar/-setUsesNativeTaskbar * Source/win32/w32_GLcontext.m: Fix a bug in OpenGL sub-window placement when handlesWindowDecorations == YES 2007-03-06 Richard Frith-Macdonald * configure.ac: Add check for syslog * config.h.in: regenerate * configure: regenerate * Tools/gpbs.m: add --auto option to shut down when all connections from apps requiring pasteboard services are closed. 2007-03-02 Fred Kiefer * Source/cairo/CairoGState.m (-DPSinitmatrix, -GSCurrentCTM): Don't consider flipped state. * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Simplified the code and now use cairo_paint and cairo_paint_with_alpha. 2007-03-01 Fred Kiefer * Source/cairo/CairoGState.m (-DPSinitgraphics): Set more cairo state. * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Use either mask or fill, but not both. 2007-03-01 Fred Kiefer * Source/cairo/CairoGState.m (-setColor:state:): Use fillColor instead of parameter. Only in the former is the alpha field set. Bug found by using valgrind. 2007-02-28 Fred Kiefer * Source/cairo/CairoContext.m (-initWithContextInfo:): Set self from super call to get PS contexts working. 2007-02-28 Nicola Pero * configure.ac: Use gnustep-config to set GNUSTEP_MAKEFILES if not set. * GNUmakefile: Same change. * configure: Regenerated. 2007-02-28 Nicola Pero * Tools/win32pbs.m (WINVER): Define to make it compile with new releases where HWND_MESSAGE is not defined unless you explicitly request recent Microsoft Windows APIs by setting WINVER. 2007-02-27 Fred Kiefer * Source/winlib/Win32FontInfo.m (-setupAttributes:): Correct setting of maximumAdvancement and add xHeight. * Source/art/ftfont.m (-initWithFontName:matrix:screenFont:): Correct setting of maximumAdvancement and xHeight. * Source/xlib/GSXftFontInfo.m (-setupAttributes:): Correct setting of maximumAdvancement. * Source/xlib/XGFont.m(-setupAttributes:): Correct setting of maximumAdvancement. * Headers/cairo/CairoFontInfo.h: Add new ivar lineHeight. * Source/cairo/CairoFontInfo.m (-setupAttributes:): Correct setting of descender and add lineHeight and xHeight. * Source/cairo/CairoFontInfo.m (-drawGlyphs:length:on:): Remove adjustment. * Source/cairo/CairoGState.m: Better protection against _ct being null. 2007-02-27 Nicola Pero * Source/GNUmakefile.postamble (config.h): Use MKDIRS, not GNUSTEP_MAKEFILES/mkinstalldirs, to create local directories. 2007-02-27 Nicola Pero * Source/x11/GNUmakefile.preamble (GNUSTEP_INSTALL_LIBDIR): Do not set this obsolete/unused variable. * Source/xdps/GNUmakefile.preamble: Same change. * Source/xlib/GNUmakefile.preamble: Same change. * Source/win32/GNUmakefile.preamble: Same change. * Source/winlib/GNUmakefile.preamble: Same change. * gnustep-back-debug.spec.in: Obsolete file removed. * GNUmakefile (CVS_MODULE_NAME): Obsolete variable removed. 2007-02-27 Nicola Pero * configure.ac: Fixed typo: store XFT_LIBS in CAIRO_LIBS, not in CAIRO_CFLAGS. * configure: Regenerated. 2007-02-24 Graham J Lee * Source/cairo/CairoGState.m (DPSmoveto::, DPSlineto::, DPSnewpath): check for valid context. 2007-02-18 Fred Kiefer * Source/cairo/CairoGState.m (_set_op): Change cairo operators for NSCompositeHighlight and NSCompositePlusDarker. * Source/cairo/CairoGState.m (DPSrectstroke::::, DPSrectfill::::, DPSrectclip::::): Use cairo_rectangle. * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Changed to work like the other backends for the Gorm palette images. 2007-02-17 Richard Frith-Macdonald * GNUmakefile.postamble: fix typo 2007-02-15 Nicola Pero * configure.ac: Source GNUstep.sh then use GNUSTEP_SYSTEM_HEADERS and GNUSTEP_SYSTEM_LIBRARIES if available rather than using hardcoded paths. * configure: Regenerated. 2007-02-14 Nicola Pero * Fonts/GNUmakefile (back-resources_INSTALL_DIR): New variable. * Fonts/GNUmakefile.postamble (before-uninstall): Updated the install rules to not use GNUSTEP_INSTALLATION_DIR. 2007-02-13 Xavier Glattard configure.ac: opengl fixups for win32 2007-02-11 Fred Kiefer * Source/cairo/CairoGState.m (-DPScharpath::, -DPSshow:, -GSSetFont:, -GSSetFontSize:, -GSShowText::, -GSShowGlyphs::): Protect all font operation from _ct being NULL. * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Small improvement for scrolling. 2007-02-11 Fred Kiefer * Source/cairo/CairoGState.m (-GSReadRect:): Implemented this method. 2007-02-10 Fred Kiefer * Source/gsc/GSGState.m (-bezierPath): New method. * Source/gsc/GSGState.m (-DPSpathbbox::::): Corrected to use new method. * Source/cairo/CairoGState.m (-GSSetPatterColor:, -pointInMatrixSpace:, -deltaPointInMatrixSpace:, -rectInMatrixSpace:, -DPSarct:, -GSReadRect:): New methods to override super implementation. * Source/cairo/CairoGState.m (-GSCurrentCTM, -GSConcatCTM:, -DPStranslate::, -DPSscale::, -DPSrotate:, -DPSinitmatrix, -DPSconcat:) Protect all matrix operation from _ct being NULL. * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Small improvents to both unflipped case. 2007-02-08 Richard Frith-Macdonald * Source/winlib/WIN32FontInfo.m: Fix error calculating advancement. 2007-01-31 Richard Frith-Macdonald * Source\winlib\WIN32FontInfo.m: * Source\winlib\GNUmakefile.preamble: * Source\win32\GNUmakefile.preamble: * Headers\winlib\WIN32FontInfo.h: Implement number of glyphs and covered characterset. Set maximumAdvancement. 2007-01-31 Richard Frith-Macdonald * Source/art/ftfont.m: Implement methods to get count of characters and characterset based on code by Yen-Ju Chen * Source/cairo/CairoFontEnumerator.m: Tidy layout * Source/cairo/CairoFaceInfo.m: ditto * Source/cairo/CairoFontInfo.m: ditto 2007-01-31 Richard Frith-Macdonald * Source/win32/WIN32Server.m: * Source/win32/GNUmakefile: * Source/win32/w32_GLcontext.m: * Source/win32/w32_GLformat.m: * Headers/win32/WIN32OpenGL.h: OpenGL support patch by: Xavier Glattard . 2007-01-31 Richard Frith-Macdonald * Source\winlib\WIN32FontInfo.m: Attempt to make unicode clean * Source\winlib\WIN32FontEnumerator.m: ditto * Source\win32\WIN32Server.m: Implement -windowlist method. 2007-01-15 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]): Set icon hints regardless of window manager (patch #5434 from Yen-Ju Chen). 2007-01-14 Richard Frith-Macdonald * Source/x11/XGGLContext.m: Fixup coordinates of subwindow for bug report by Xavier Glattard. 2006-12-31 Fred Kiefer * Source/cairo/CairoGState.m (-setOffset:, -DPSinitmatrix): Use cairo functions to handle offset. * Source/cairo/CairoGState.m (-GSCurrentCTM): Changed order of transformations. * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Corrected cases for flipped surface. 2006-12-31 Richard Frith-Macdonald * configure.ac: Explicitly add freetype libs and flags when building cairo, in case the cairo config stuff has left them out. Should fix bug #18508 * configure: regenerate 2006-12-30 Mark Tracy * Source/art/ReadRect.m (-GSReadRect:): incorporate offset into coordinate transformation calculations. Fixes bug #18260 2006-12-28 Matt Rice * Source/x11/XGServerWindow.m (-flushwindowrect::): Don't convert rect origin sent to handleExposeRect:forDriver: to int and back to float. 2006-12-27 Richard Frith-Macdonald * Source/cairo/CairoContext.m: declare XWindowBuffer class * configure.ac: disable glitz (if it cannot be found) in such a way that Cairo backend still builds/runs. * configure: regenerate 2006-12-26 Fred Kiefer * Headers/x11/XGGeneric.h: Added XGWMNetStates. * Source/x11/XGServerWindow.m (-_checkWindowManager, -setwindowlevel::): Prevent some window types from showing up in the taskbar for old window managers that cannot handle window types. Patch by Yen-Ju Chen . 2006-12-26 Fred Kiefer * Headers/cairo/XGCairoXImageSurface.h: * Source/cairo/XGCairoXImageSurface.m (-initWithDevice:): Use XWindowBuffer to draw on. * Source/cairo/CairoContext.m (+initializeBackend): Use XGCairoXImageSurface as surface. * Source/cairo/CairoGState.m (-DPSimage:...:): Respect endianess, when creating a cairo image surface. Patch by Yen-Ju Chen . 2006-12-19 Fred Kiefer * Source/cairo/XGCairoGlitzSurface.m (-initWithDevice:): Correct getting of visual ID. Patch by: Xavier Glattard . 2006-12-08 Richard Frith-Macdonald * Source/x11/XGServerEvent.m: Fix incorrect setting for second help key. * Documentation/Back/DefaultsSummary.gsdoc: Document mappings of X keys to help keys. 2006-11-25 Matt Rice * Source/art/ftfont.m (appendBezierPathWithGlyphs:count:toPath:): Uncomment code and switch to using FTC_Manager_LookupSize. 2006-11-19 Richard Frith-Macdonald * Source/winlib/WIN32GState.m: * Source/art/path.m: * Source/art/ftfont.m: * Source/art/ftfont-old.m: * Source/art/shfill.m: * Source/art/image.m: * Source/xlib/XGGState.m: * Source/x11/XGServerWindow.m: Use accessor method (-transformStruct) to get at affine transform internals. Make art code closer to coding standards in an attempt to improve readability. 2006-11-15 Nicola Pero Notice: you should now use 'make DESTDIR=/tmp/xxx install' if you want to relocate all the installation into /tmp/xxx/ * GNUmakefile.postamble: Use DESTDIR instead of INSTALL_ROOT_DIR everywhere. * Documentation/Back/GNUmakefile: Use GNUSTEP_INSTALLATION_DOMAIN instead of GNUSTEP_INSTALLATION_DIR. * Documentation/GNUmakefile: Same change. * Fonts/GNUmakefile: Same change. * Source/GNUmakefile: Same change. * Source/art/GNUmakefile: Same change. * Source/cairo/GNUmakefile: Same change. * Source/gsc/GNUmakefile: Same change. * Source/x11/GNUmakefile: Same change. * Source/xdps/GNUmakefile: Same change. * Source/xlib/GNUmakefile: Same change. * Source/win32/GNUmakefile: Same change. * Source/winlib/GNUmakefile: Same change. * Tools/GNUmakefile: Same change. 2006-11-03 Richard Frith-Macdonald * Source/xlib/XGFont.m: Assume ascii encoding as a fallback if no mapping can be found from the font registry to the encoding. 2006-10-31 Matt Rice * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:): Unset ignore_take_focus for the key window. 2006-10-29 Richard Frith-Macdonald * Source/xlib/XGFont.m: Use encodingFromCharset (undeprecated and handles more cases than GSEncodingForRegistry) 2006-10-28 Adam Fedor * back.make.in: Use correct flags; * Source/GNUmakefile.preamble: Add library depends for backend. (Partial fix for Bug #16453, see also gui). 2006-10-27 Fred Kiefer * Source/x11/XIMInputServer.m (-initWithDelegate:display:name:): Replace call to GetStringEncoding with [NSString localizedNameOfStringEncoding:] * Source/x11/XGServerWindow.m (-_setupMouse): Make log message on multiple mouse buttons a debug log message. Seems like newer X servers detect loads of mouse buttons which are not there. 2006-10-21 Matt Rice * Source/win32/WIN32Server.m: Update -windowlist implementation. * Source/x11/XGServerWindow.m (-orderwin:::): Replace desiredOrderedWindow with ignore_take_focus. (windowlist): Implement. (setinputfocus:): Replace desiredOrderedWindow with ignore_take_focus. * Headers/x11/XGGeneric.h (XGGeneric): Remove desiredOrderedWindow. * Headers/x11/XGServerWindow.h (gswindow_device_t): Add ignore_take_focus. 2006-10-15 22:48-EDT Gregory John Casamento * Source/gsc/GSStreamContext.m: GSRectClipList() copied implementation from GSGState.m. 2006-10-15 11:14-EDT Mark Tracy * Source/gsc/GSStreamContext.m: GSStreamContext did not implement GSRectFillList fix: copied code from GSGState.m. Patch applied by Gregory Casamento 2006-10-12 Adam Fedor * Source/xlib/XGFontSetFontInfo.m (-drawGlyphs:length:onDisplay:drawable:with:at:], [-widthOfGlyphs:length:]): Fix spelling of length 2006-10-11 Nicola Pero * GNUmakefile (GNUSTEP_INSTALLATION_DOMAIN): Use GNUSTEP_INSTALLATION_DOMAIN instead of GNUSTEP_INSTALLATION_DIR. 2006-10-04 Richard Frith-Macdonald * Source/x11/XGServerEvent.m: For help key, generate key/down/up ewvent as well as flag changes. Use X Super_L key symbol as default backup help key, since many keyboards don't have a help key mapping by default, but the super keys are often the 'windows' keys available on PC keyboards. * Version: bump version number for next release 2006-10-04 Fred Kiefer * Headers/gsc/GSGState.h: Added copying protocol. * Headers/cairo/CairoGState.h: Removed duplicated ivars that are already defined in the new super class GSGState. * Source/cairo/CairoGState.m: Changed to use super class ivars where apropriate. Removed all compiler warnings. Changed colour setting and getting to work with super class methods. Reimplemented DPSinitmatrix to handle offset and use this from everywhere. Removed methods duplicating super class code. * Source/cairo/CairoContext.m (GSWSetViewIsFlipped:): Removed as super class implementation should be used. 2006-10-03 Richard Frith-Macdonald * Source/x11/XWindowBuffer.m: ([_exposeRect:]) Clip draw area to size of buffer rather than size of wiondow, in case the two have become out of sync somehow. * Source/win32/WIN32Server.m: Add help key mask * Source/x11/XGServerEvent.m: ditto 2006-10-02 Nicola Pero * configure.ac: Check the new variable GNUSTEP_IS_FLATTENED, and default to yes. * configure: Regenerated. 2006-09-29 Hans Baier * Source/cairo/CairoGState.m: Added hack to retrieve current rgb and alpha from cairos internal structures. Will be replaced by proper code when the cairo functions are available * Source/cairo/CairoGState.m: * Headers/cairo/CairoGState.h: refactored class as a subclass of GSGState. Removed all unimplemented methods implemented in the superclass. * Headers/cairo/CairoFaceInfo.h: fixed header file to include the needed freetype headers * Source/cairo/XGCairoGlitzSurface.m: fixed glitz api change glitz_glx_find_drawable_format -> glitz_glx_find_drawable_format_for_visual. Compiles now but doesnt work yet, because I don't know how to retrieve a proper VisualID. someone who knows, please fix it! 2006-09-28 Richard Frith-Macdonald * Source/win32/WIN32Server.m: Use GSBackHandlesWindowDecorations * Source/x11/XGServerWindow.m: ditto New user default to turn on backend handling of window decorations for all backends which support it. 2006-09-27 Richard Frith-Macdonald * Source/x11/XGServerWindow.m: Add more debug for checking style Use _NET_FRAME_EXTENTS or _KDE_NET_WM_FRAME_STRUT to determine offsets if our window manager supports them. 2006-09-26 Richard Frith-Macdonald * Source/x11/XGServerWindow.m: Add more debug for checking style offsets. Wait for up to a second for visibility events in case XSync() does not work to ensure we receive them. 2006-09-25 Richard Frith-Macdonald * Headers/x11/XGGeneric.h: Extra fielkd to flag when style offsets are known. * Source/x11/XGServerEvent.m: Add a lot more debug logging for reparenting. Ignore and log changes to 'known' style offsets. * Source/x11/XGServerWindow.m: On startup we now check to see if style offsets have been recorded in the root window, and if not we briefly create a test window of each style to determine style offsets, so we know what the offsets are for each style before anything attempts to use them. 2006-09-24 Richard Frith-Macdonald * Source/x11/XGServerEvent.m: Use #if to disable old window exposure mechanism in favour of sending exposure events to the front end. Hopefully this will fix a bug where the old bypassing of the gui event queue could cause an attempt to copy from a region outside the image buffer. If there are no problems with this, we should remove the old, complex mechanism. 2006-09-13 Richard Frith-Macdonald * Source/x11/XGServerWindow.m: use generic.wintypes.win_modal_atom for popup menu in gnome/ewmh window manager so that popup menus work in modal windows. Reported as bug 17713 by Yen-Ju Chen. 2006-09-12 Richard Frith-Macdonald * Source/art/ARTContext.m: * Source/art/path.m: * Source/art/composite.m: * Source/art/shfill.m: * Source/art/image.m: * Source/xlib/XGGState.m: * Source/x11/XGServerWindow.m: * Source/x11/XGServerEvent.m: Get backend to generate NSEvent objects with event location given in OpenStep coordinates. Fix flushwindowrect coordinate handling. Update art backend to try to honor the x and y window offsets provided in the graphics state. 2006-09-09 Richard Frith-Macdonald * Source/x11/XGServerWindow.m: ([_XFrameToOSFrame:for:]) fix transform error. 2006-09-08 Adam Fedor Tools/gpbs.1: Add documentation on options (from Dennis Leeuw). 2006-09-06 Richard Frith-Macdonald * Headers/x11/XGGeneric.h: New ivars to hold offsets for different window styles. * Source/x11/XGServerWindow.m: Offset handling and frame management routines rewritten to try to get it right more often. Fix long-standing bug positioning windows ... so initial positions of titled windows should not conflict with horizontal menu. * Source/x11/XGServerEvent.m: Rewritten code which handles reparenting notification so that we calculate the offsets of our window properly. NB. these fixups require corresponding fixups in the gui library. 2006-08-17 Fred Kiefer * Source/xlib/GSXftFontInfo.m: changed method signatures to fix typos (lenght->length) Patch by: Hans Baier 2006-08-13 Christopher Armstrong * Source/winlib/WIN32GState.m: Fixups to last patch 2006-08-10 Christopher Armstrong (carmstrong@fastmail.com.au) (patch committed by Greg Casamento) * Source/winlib/WIN32GState.m: Better 24bit image support, Slightly extended composite method, Dashed-line handling (for selections) * Headers/winlin/WIN32FontInfo.m: Changed method signature draw:length:onDC:at: to correct spelling of length. 2006-08-01 Riccardo Mottola * Headers/xlib/XGPrivate.h, Headers/xlib/GSXftFontInfo.h, Headers/xlib/XGFontSetFontInfo.h: changed method signatures to fix bug intruduced by RFM during typo fixes 2006-07-09 Fred Kiefer * Header/x11/XGGeneric.h, * Source/x11/XGServerWindow.m (-_setupRootWindow, -window::::), * Source/x11/XGServerEvent.m (-processEvent:): Impelemented handling for _NET_WM_PING. 2006-07-07 Richard Frith-Macdonald * Source/x11/XGServer.m: Handle SIGTERM by calling ([NSApp terminate: NSApp]) to shut down cleanly. 2006-07-04 Richard Frith-Macdonald * Source/art/ftfont.m: * Source/x11/XGServer.m: * Source/x11/XGDragView.m: * Source/GSBackend.m: * Source/gsc/GSGState.m: * Tools/gpbs.m: Avoid spurious warnings produced by gcc-4.1 2006-06-22 Richard Frith-Macdonald * Tools/gpbs.m: Fix to get profiling to work for this daemon 2006-05-29 Fred Kiefer * Source/xlib/XGGState.m (-dealloc, -deepen): Free XFT drawing structures and don't reuse the same ones for copies of the gstate. Fixes bug #13705. 2006-05-29 Fred Kiefer * Source/xlib/GSXftFontInfo.m (FcFontEnumerator -defaultSystemFontName, -defaultBoldSystemFontName, -defaultFixedPitchFontName): Added this methods which return values similar to the art and cairo backend. Removed compiler warnings from this file. * Source/xlib/XGFontSetFontInfo.m (-dealloc): Call super dealloc. * Source/xlib/XGGeometry.m * Source/xlib/XGFont.m * Source/xlib/XGGState.m: * Tools/font_cacher.m: Removed compiler warnings. 2006-05-27 Fred Kiefer * Source/x11/XGServerWindow.m (-_DPSsetcursor::): Don't set cursor on root window. Patch by Mircea Trache . 2006-05-13 Fred Kiefer * Headers/x11/XGServer.h, * Source/x11/XGServerWindow.m (-_XFrameToXHints:for:): New method to compute X hints directly from X frame. Previously the X frame was converted to an OS frame and from this the X hints were computed. * Source/x11/XGServerWindow.m, Source/x11/XGServerEvent.m: Replaced all usages of [_OSFrameToXHints:for:] with [_XFrameToXHints:for:]. 2006-05-04 Fred Kiefer * Source/x11/XGServerWindow.m (-styleoffsets::::::): New method to compute window frame offset based on the _NET_FRAME_EXTENTS or _KDE_NET_WM_FRAME_STRUT property. This is based on a slightly extended patch by Yen-Ju Chen . Call this new method from [styleoffsets:::::] and [_OSFrameToXHints:]. * Source/x11/XGServerWindow.m (-iconTileImage): Make sure the window pointer gets freed. 2006-05-03 Fred Kiefer * Source/x11/XGServerWindow.m (-nativeWindow:::::): Implemented to support using an X window for GNUstep drawing. 2006-04-30 David Ayers * Source/x11/raster.c (RCreateImage): Remove unused variables. * Source/x11/XGServerEvent.m (gotShmCompletion:) Declare privat interface for shared memory handling. 2006-03-13 Adam Fedor * Source/x11/XGServerWindow.m (titlewindow::): Set NAME and ICON_NAME WM properties (Patch #5014 from Yen-Ju Chen). 2006-03-12 Fred Kiefer * Source/cairo/XGCairoGlitzSurface.m * Headers/cairo/XGCairoGlitzSurface.h: Rewrote to fit with changed glitz interface. 2006-03-13 Adam Fedor * Version 0.10.3 2006-03-13 Fred Kiefer * Source/x11/XGServerWindow.m (-termwindow:): Reset the window cache, if it points to the terminated window. 2006-03-12 Fred Kiefer * Source/cairo/NSBezierPathCairo.m * Source/cairo/NSBezierPathCairo.h * Source/cairo/CairoDevice.m * Source/cairo/CairoFontManager.m * Source/cairo/CairoFreeTypeFontInfo.m * Headers/cairo/CairoDevice.m * Headers/cairo/CairoFontManager.m * Headers/cairo/CairoFreeTypeFontInfo.m: Removed these files. * Source/cairo/GNUmakefile: Removed references to obsolete files. * Source/cairo/CairoFontInfo.m (-setCacheSize:): Fill the cache with zeros. * Source/cairo/CairoFontInfo.m (-setupAttributes): Free the font options. * Source/cairo/CairoGState.m (:bezierPath, -GSSendBezierPath:): Added NSBezierPath methods. * Source/cairo/XGCairoXImageSurface.m * Source/cairo/CairoContext.m * Source/cairo/XGCairoSurface.m * Source/cairo/CairoSurface.m * Source/cairo/XGCairoGlitzSurface.m * Headers/cairo/CairoSurface.h: Clean up of cairo backend code. 2006-03-07 Fred Kiefer * Source/cairo/CairoGState.m (-compositeGState:...fraction:, DPSimage::...:): Handle flipped views correctly. 2006-02-22 Richard Frith-Macdonald * Source/gsc/GSStreamContext.m: Fix opening of file on mingw32 Don't log where we are printingf to unless debugging is on. 2006-02-13 Fred Kiefer * Source/cairo/CairoGState.m (-copyWithZone:): Handle more of the state parameters in copy. * Source/cairo/CairoGState.m (-compositerect:op:): Protect operator setting with save/restore. 2006-02-12 Fred Kiefer * Source/cairo/CairoGState.m (-compositeGState:...fraction:): Deal with flipped views. Also some cleanup in the whole file and a hack to set alpha. 2006-02-11 Fred Kiefer * Source/cairo/CairoGState.m (-DPSImage::::::::): Handle missing parameters, row end padding and destroy the temporary image at the very end. 2006-02-06 Fred Kiefer * Source/x11/XGServer.m (_initXContext): Don't set the environment value for NSHOST. Patch by Tim MacIntosh . See mails on dev mailing list for more explaination. 2006-02-06 Fred Kiefer * Headers/x11/xdnd.h: Declare two more functions used in xpbs.m. * Tools/gpbs.m: Removed compiler warnings about mismatching declarations. 2006-01-29 Fred Kiefer * Source/cairo/CairoFontInfo.m (_cairo_extents_for_NSGlyph, -drawGlyphs:length:on:) Corrected the conversion from NSGlyph to UTF8. * Source/cairo/CairoFontEnumerator.m: Use the same default fonts as the art backend. 2006-01-23 Fred Kiefer * Headers/cairo/CairoFaceInfo.h, * Source/cairo/CairoFaceInfo.m, * Source/cairo/CairoFontEnumerator.m, * Source/cairo/CairoFontInfo.m: Rewrite of all cairo font handling to work with exported cairo functions and enumerate fonts with the font config library. 2006-01-14 Richard Frith-Macdonald * Source/gsc/GSContext.m: * Source/x11/XGServer.m: * Source/x11/XGServerWindow.m: * Source/x11/XWindowBuffer.m: * Headers/x11/XGServerWindow.h: Some fixes for 64bit processor support. In particular, allow for bug/feature of X that 32bit data supplied in XChangeProperty must actually be 64bit on a 64bit machine. The X client library discards the upper 32bits of each value when encoding the data to be sent to the server. These changes fix WindowMaker interaction on AMD64. 2006-01-09 Richard Frith-Macdonald * Source/win32/WIN32Server.m: Attempt to terminate gracefully when a quit message is received. 2005-12-22 Adam Fedor * Version 0.10.2 * Source/art/ARTContext (-beep): Removed, unused. * Source/xdps/NSDPSContext.m (-beep): Idem. 2005-12-20 Adam Fedor * Source/art/ARTContext.m ([ARTContext -beep]): Respect user setting of bell volume. * Source/x11/XGServe.m: Idem. 2005-12-16 Adam Fedor * configure.in: Check for Xutf8LookupString * Source/x11/XIMInputServer.m: Use it. 2005-12-10 Fred Kiefer * Source/x11/XGServerWindow.m (-titlewindow::): Use UTF8 window title where possible. 2005-11-20 Adam Fedor * configure.ac: Check for winlib as well so we don't get invalid backend. 2005-11-19 21:39 Alexander Malmberg * Source/art/ARTContext.m (flip_bytes, byte_order) (-initWithContextInfo:): Detect if the server doesn't have the same endianness and adjust the color bitmasks if necessary. 2005-11-18 Fred Kiefer * Source/x11/XGServerWindow.m (-window::::): Don't use the NET WM window icon for Window Maker. * Source/x11/XGServerWindow.m (_createNetIcon:::, _setNetWMIconFor:): Rewrote this methods to be prepared to use the mini window icon, when that gets available in back. 2005-11-16 Richard Frith-Macdonald * Source/art/composite.m: * Source/art/ftfont-old.m: * Source/art/ftfont.m: * Source/art/shfill.m: * Source/cairo/CairoDevice.m: * Source/cairo/CairoFreeTypeFontInfo.m: * Source/cairo/CairoGState.m: * Source/gsc/GSContext.m: * Source/gsc/GSStreamContext.m: * Source/win32/GSDisplayServer_details.m: * Source/win32/WIN32Server.m: * Source/win32/w32_activate.m: * Source/win32/w32_debug.m: * Source/win32/w32_movesize.m: * Source/win32/w32_notifications.m: * Source/win32/w32_windowdisplay.m: * Source/winlib/WIN32GState.m: * Source/x11/XGGLContext.m: * Source/x11/XGGLFormat.m: * Source/x11/XGServerEvent.m: * Source/x11/XGServerWindow.m: * Source/xdps/AFMFileFontInfo.m: * Source/xdps/NSDPSContext.m: * Source/xdps/NSDPSContextOps.m: * Source/xlib/XGBitmap.m: * Source/xlib/XGCommonFont.m: * Source/xlib/XGFontSetFontInfo.m: * Source/xlib/XGGState.m: * Tools/font_cacher.m: * Tools/xpbs.m: Some fixups for coding style violations. Should have no effect other than to render code more consistent/readable. 2005-11-07 Fred Kiefer * Source/x11/XGServerWindow.m (_createNetIcon, _setNetWMIconFor:): New methods to create and set NET WM icon for window. * Source/x11/XGServerWindow.m (-window::::): Use this methods to set window icon. * Source/cairo/CairoGState.m (-DPSImage::::::::): Try to deal with flipped views. * Source/cairo/CairoFontInfo.m: Reduced the amount of unexported cairo functions we use. 2005-10-30 Richard Frith-Macdonald * Source/win32/WIN33Server.m: synchronize defaults so settings are not lost. Tidy a lot of stuff to conform to coding standards. Update event handling code to use ET_WINMSG rather than less versatile deprecated API. 2005-10-23 Adam Fedor * configure.ac: Check for invalid backend graphics name. Error if no X11 libraries if using x11 server. 2005-10-20 Adam Fedor * Headers/win32/WIN32Server.h: uint -> unsigned int * Source/win32/...: Idem. * Source/win32/w32_notifications.m: Comment out unimplmented windows method. 2005-10-20 Tom MacSween * Source/win32/: Fixed a compile error when debug flags were activated. Removed detailed documation from MS. Read and write correctly from defaults. 2005-09-19 Adam Fedor * Version 0.10.1 * configure.ac: Make art the default graphics module. 2005-09-14 Tom MacSween * Restructuring of the windows server to handle various window and toolbar issues (See Source/win32/RELEASE_NOTES for more info). * Headers/win32/WIN32Server.h: Added ivars and flags and methods. * Headers/winlib/WIN32GState.h: Added method to avoid confliting types with superclass. * Source/win32/GNUmakefile: Add new files. * w32_debug.m, w32_activate.m, w32_create.m, w32_general.m, w32_movesize.m, w32_text_focus.m, w32_windowdisplay.m, GSDisplayServer_details.m: New files. * Source/win32/WIN32Server.m: Large changes. Merged with WIN32ServerEvent. Lots of documentation. * Source/winlib/WIN32GState.m: Variable name changes to avoid shadowing. 2005-08-28 Fred Kiefer * Headers/cairo/CairoSurface.h, * Source/cairo/CairoSurface.m, * Source/cairo/XGCairoGlitzSurface.m, * Source/cairo/XGCairoSurface.m, * Source/cairo/XGCairoXImageSurface.m, * Source/cairo/CairoGState.m (-GSSetDevice:::): Rewrote the device handling to work for resized windows. * Headers/cairo/CairoFontInfo.h, * Source/cairo/CairoFontInfo.m (-drawGlyphs:length:on:, -setupAttributes), * Source/cairo/CairoGState.m (-GSShowGlyphs::): Moved adjustment of font size and positioning to CairoFontInfo. * Source/cairo/CairoContext.m: Clean up. 2005-08-20 Fred Kiefer * Source/cairo/CairoGState.m (-DPSImage::::::::): For the ARGB32 case sort the colour fields in the bitmap correctly. 2005-08-20 Fred Kiefer * Source/cairo/CairoFaceInfo.m (-fontFace): Use _cairo_toy_font_face_create, as Cairo did rename this function. * Source/cairo/CairoFontInfo.m (_cairo_glyph_for_NSGlyph): Use Cairo function _cairo_scaled_font_text_to_glyphs to convert to glyphs. 2005-08-16 Adrian Robert * Source/art/ftfont.m (-[FTFontInfo drawString:...]): Initialize index d for delta_data[]. (Already done in ftfont-old.) 2005-07-28 Fred Kiefer * Headers/cairo/CairoFaceInfo.h, * Headers/cairo/CairoFontEnumerator.h, * Headers/cairo/CairoFontInfo.h, * Headers/cairo/CairoSurface.h, * Headers/cairo/XGCairoSurface.h, * Source/cairo/CairoContext.m, * Source/cairo/CairoGState.m, * Source/cairo/CairoFaceInfo.m, * Source/cairo/CairoFontInfo.m, * Source/cairo/CairoFontEnumerator.m, * Source/cairo/CairoSurface.m, * Source/cairo/NSBezierPathCairo.m, * Source/cairo/XGCairoGlitzSurface.m, * Source/cairo/XGCairoSurface.m, * Source/cairo/XGCairoXImageSurface.m: Adopted to changes in latest release of cairo. * Source/cairo/GNUmakefile: Removed file CairoFontManager.m 2005-07-22 Adam Fedor * Version 0.10.0 2005-07-17 Adam Fedor * Version: Add interface version number * Source/GNUmakefile: Use it. * Source/GNUmakefile.postamble: Idem, add custom Info.plist. * Source/GNUmakefile.preamble: Update for interface version. 2005-07-14 Adam Fedor * Source/winlib/WIN32GState.m ([WIN32GState -compositeGState:...]): Fall through to default operation if alpha blend not sucessful. 2005-07-09 Fred Kiefer * Headers/gsc/GSGState.h, Source/gsc/GSGState.m: New methods [-compositeGState:fromRect:toPoint:op:fraction:] and [GSSetPatterColor:]. Also added ivar pattern. * Source/gsc/GSGState.m (-dealloc, -deepen, -setColor:state:): Deal with pattern ivar. * Source/gsc/GSContext.m, Source/gsc/GSStreamContext.m: New methods [-GScomposite:toPoint:fromRect:operation:fraction:] and [-GSSetPatterColor:]. * Source/xlib/XGGState.m: New method [-compositeGState:fromRect:toPoint:op:fraction:] use this to implement [-compositeGState:fromRect:toPoint:op:] and [-dissolveGState:fromRect:toPoint:delta:]. 2005-07-04 Adam Fedor * Documentation/news.texi: Update. 2005-07-01 Adam Fedor * Documentation/Back/Back.gsdoc, Documentation/Back/DefaultsSummary.gsdoc, Documentation/Back/WindowFocus.gsdoc, Headers/art/ARTContext.h, Headers/x11/XGDragView.h, Headers/xlib/XGFontSetFontInfo.h, Headers/xlib/XGGeometry.h, Source/x11/wrasterP.h, Source/xlib/XGFontSetFontInfo.m, Source/xlib/linking.m, Tools/GNUmakefile.postamble, Tools/GNUmakefile.preamble, Tools/gpbs.1: Add/fix copyright and licenses. 2005-06-17 Adam Fedor * Tools/gpbs.m ([PasteboardServer -connectionBecameInvalid:]): Use isKindOfClass. 2005-06-07 Fred Kiefer * Source/winlib/Win32GState.m (GSCreateBitmap): Allow NSCalibratedRGBColorSpace as well. (-_compositeGState:fromRect:toPoint:op:fraction:) Removed the leading underscore of the method name. 2005-05-26 Adam Fedor * Update FSF Address. 2005-05-20 Adrian Robert * Headers/xlib/XGGState.h, Source/xlib/XGGState.m: Changed HAVE_LIBXFT #ifdefs to HAVE_XFT. * configure.ac, config.h.in: Changed comments for HAVE_XFT to clarify that it is different from HAVE_LIBXFT (latter is just the runtime lib, while former implies a functional installation). 2005-05-14 Adrian Robert * Source/xlib/XGGState.m: Added missing #ifdefs to last patch so compilation on non-libxft system is unaffected. 2005-05-12 Adrian Robert * Headers/xlib/XGGState.h (xft_draw, xft_alpha_draw, xft_color, -xftDrawForDrawable, -xftColor): New ivars and methods for caching Xft (freetype) draw state. * Source/xlib/XGGState.m (-xftDrawForDrawable:, -xftColor): Cache Xft draw state. * Source/xlib/GSXftFontInfo.m: Use cached Xft draw state for rendering. 2005-04-20 Adam Fedor * Fonts/GNUmakefile.postamble: Make sure to install in $(GNUSTEP_INSTALLATION_DIR). * GNUmakefile: Add check to not install fonts if fonts=no. Fixes bug #12749 2005-04-19 Adam Fedor * Source/art/path.m ([ARTGState -_stroke:]): Change floorf->floor. Fixes bug #12731. 2005-04-16 Fred Kiefer * Source/xlib/XGGState.m (-_compositeGState:sourcefromRect:fromRecttoPoint:toPointop:opfraction:]): New way to compute drect. This fixes bug #12459. 2005-04-07 Fred Kiefer * Source/x11/XGServerWindow.m (-iconSize): Use XFree to free xiconsize. Fixes bug #12578. 2005-04-04 Richard Frith-Macdonald * Source/winlib/WIN32GState.m: tunr on alpha blending and swap colors to correct format. 2005-04-01 Adam Fedor * Source/win32/WIN32Server.m: Re-add 2005-02-23 change. * Source/xlib/GSXftFontInfo.m (-setupAttributes): Make log message more verbose. 2005-04-01 Richard Frith-Macdonald * Source/x11/XGDragView.m: Complete code changes to factor out as much as possible into the superclass and avoid duplication. 2005-03-30 Adam Fedor * Version 0.9.5 * Headers/x11/XGDragView.h, Source/x11/XGDragView.m: Tag previous version of file for release. * Source/win32/WIN32Server.m: Revert 2005-02-23 change for this release. 2005-03-29 Richard Frith-Macdonald * Headers/x11/XGDragView.h: Make this a subclass of GSDragView * Source/x11/XGDragView.m: Rewrite to be a subclass of GSDragView so that bugfixes from it are in XGDragView. Remove lots of redundant code. Still quite a bit to do. * Source/win32/WIN32Server.m: Add code to draw own window decorations and GSWIN32HandlesWindowDecorations user default to turn it off. Fixed code for detecting window at a screen point to ignore invisible windows (fixes crash in DnD). Altered window type to 'tool' for borderless windows, so that we don't get a button in the taskbar for every window we create. 2005-03-29 Adrian Robert * Source/art/ftfont.h, Source/art/ftfont.m, Source/art/ftfont-old.m: Support DPSxshow, xyshow, ashow, widthshow, and awidthshow in same drawString:... method that was just implementing DPSshow, and drop the stub that was slated to handle the former methods. * Source/art/ARTContext.m: Use the methods defined above. 2005-03-28 Richard Frith-Macdonald * Source/win32/WIN32Server.m: fix for locating window at point. 2005-03-21 Adam Fedor * Source/art/blit.m (artcontext_setup_draw_info): Add mail address to log message. 2005-02-23 Luis Cabellos * Source/win32/WIN32Server.m: Use new run loop api under mingw32 2005-02-22 Adam Fedor * configure.ac: Rewrite, avoid setting vars unecessarily. Use pkg-config if possible. Switch back to xlib/winlib when other backends don't satisfy dependancies. * config.make, config.h: Update to match. * GNUmakefile (SUBPROJECTS): Add Fonts * Fonts: New folder with default nfont * Source/x11/GNUmakefile: Remove unneeded file. 2005-02-12 Fred Kiefer * Source/x11/XGServerWindow.m (-setalpha::): Support for window alpha handling on X servers that implement this. 2005-02-12 13:58 Alexander Malmberg * Headers/x11/XGServerWindow.h: Make the border and depth ivars unsigned. 2005-02-12 13:54 Alexander Malmberg * Source/x11/XGServerWindow.m (setNormalHints): If the window isn't resizable, force the min and max sizes to be equal to the current size. (-placewindow::): Set the hints after updating xframe. Fixes bug #11713. 2005-02-10 00:50 Alexander Malmberg * Tools/gpbs.m (init): Remove the program name from the arguments passed to the new task. 2005-02-08 Richard Frith-Macdonald * Tools/gpbs.m: Use NSTask to re-execute as daemon. 2005-02-05 00:44 Alexander Malmberg * Source/art/path.m (-_clip_add_svp:): Handle the case where no spans are generated for the path. 2005-01-31 07:30 Christian * Tools/gpbs.m: Correct missplaced bracket when built for windows. 2005-01-21 21:51 Alexander Malmberg Various warning and whitespace cleanups. * Headers/x11/XGServerWindow.h, * Source/art/ftfont.m, * Source/gsc/GSGState.m, * Source/win32/WIN32Server.m, * Source/x11/XGDragView.m, * Source/x11/XGServerEvent.m, * Source/x11/XGServerWindow.m: Change signedness of various variables. * Tools/gpbs.m: Add missing ctype.h include. * Source/x11/XGDrawView.m (-_setCursor): Initialize variables. 2005-01-20 22:39 Alexander Malmberg * Source/art/ARTContext.m (-initWithContextInfo:): Enable stroke adjusting for the default gstate. 2005-01-20 17:58 Alexander Malmberg * Source/xlib/XGGState.m (-DPSrectstroke::::): Don't decrease the width/height. 2005-01-15 Adrian Robert * Source/x11/XGServerEvent.m (-processEvent:): For XdndPosition event (ClientMessage), convert the point from root coordinates using XTranslateCoordinates() instead of relying on cached window position. Update cached window position from this. 2005-01-12 00:32 Alexander Malmberg * Source/gsc/GSStreamContext.m (-DPSsetstrokeadjust:): Give 'setstrokeadjust' a boolean argument. 2005-01-11 21:57 Alexander Malmberg * Headers/x11/XWindowBuffer.h: Make the pending_rect ivar a struct of int:s. * Source/x11/XWindowBuffer.m: Add casts to remove pointer sign warnings. (-_exposeRect:, -_gotShmCompletion): Update uses of pending_rect. 2005-01-11 20:27 Alexander Malmberg * Source/art/ARTGState.h: Add strokeadjust ivar. * Source/art/ARTContext.m (-DPScurrentstrokeadjust) (-DPSsetstrokeadjust): Use the strokeadjust ivar. * Source/art/path.m (-DPSrectclip::::): Don't use the optimized path if the clipping path is complex. (-_stroke::): Remove second argument, rename to ... (-_stroke:): ... this. If strokeadjust is active, adjust the path to make it clearer. (-DPSrectstroke::::): Update _stroke::: call. Remove dash adjustment code. (-DPSstroke): Update _stroke:: call. * Source/art/composite.m: Fix comment typo. Remove some old debugging code. 2005-01-11 16:15 Alexander Malmberg * Source/art/blit.m: Remove #warning:s. * Source/art/blit_scrapheap.m: Add mmx implementation of 15/16bpp blit_alpha_opaque. 2005-01-11 16:01 Alexander Malmberg * Source/art/ftfont.m: Copy old contents to ftfont-old.m and include that file if the freetype version is <2.1.8. Rewrite this file to work with freetype >=2.1.8. * Source/art/ftfont-old.m: New file. 2004-12-30 18:38 Gregory John Casamento * Source/x11/XGDragView.m: _handleDrag: method correction for bug#11352 and for fixes to allow compilation with gcc < 3.0. 2004-12-09 Fred Kiefer * Source/win32/WIN32Server.m (-standardcursor:): Don't set default cursor, when no standard cursor is available. * Source/x11/XGServerWindow.m (-standardcursor:): Don't set default cursor, when no standard cursor is available. Replaced the usage of the type xgps_cursor_id_t with Cursor throughout this file. 2004-12-06 Fred Kiefer * Source/x11/XGServerWindow.m (-setwindowlevel::): Stop using the KDE override atom for window levels. The old behaviour may be reactivated via the define USE_KDE_OVERRIDE. 2004-11-28 Matt Rice * Source/x11/XGGLFormat.m (-initWithAttributes:,append,append1): Add missing curly brackets, fix append and append1 macros so they can safely be used without curly brackets. 2004-11-28 Richard Frith-Macdonald * Tools/gpbs.m: When run as daemon, re-execute with --no-fork flag so that we can work with threading using pth library (default on some BSD versions). 2004-11-10 18:41 Alexander Malmberg * Source/x11/XWindowBuffer.m (test_xshm): New function. (test_xshm_error_handler): New function. (+windowBufferForWindow:depthInfo:): Move XShm detection code to test_xshm and use it to decide whether to use XShm or not. (+initialize): Move use_xshm setting code to test_xshm. (+_gotShmCompletion:): Don't warn if we can't find an XWindowBuffer for the event. 2004-11-10 Matt Rice * Source/x11/XGServerWindow.m (-iconSize): Implement new method. (-iconTileImage:): ditto. 2004-11-09 22:42 Alexander Malmberg * Source/x11/XGBitmapImageRep.m: Remove dead file. * Source/x11/GNUmakefile: Remove reference. 2004-11-09 22:15 Alexander Malmberg * Source/art/ftfont.m (fix_path): Don't prepend the path to absolute file names. (-initWithFontName:matrix:screenFont:): Initialize cachedGlyph. (-advancementForGlyph:): Handle NSNullGlyph. (-glyphForCharacter:): Return NSNullGlyph if there's no glyph for the character. 2004-11-09 19:00 Alexander Malmberg * Tools/gpbs.m (main): If we get a -GSStartupNotification argument, post the notification after initializing. Fixes bug #10876. 2004-11-04 Adrian Robert * Source/x11/XGServerEvent.m (process_key_event): Modifier detection: If default "GSModifiersAreKeys" is YES, ignore 'shift' and/or other state and just map keypress to first modifier for they key. * Documentation/Back/DefaultsSummary.gsdoc: Document new default "GSModifiersAreKeys". * Source/xlib/XGBitmap.m (_bitmap_combine_alpha()): corrected typo in error message. 2004-10-30 Fred Kiefer * Source/xlib/XGContext.m (+initializeBackend): Use anti-aliaesd fonts when available and not specified otherwise. * Documentation/Back/DefaultsSummary.gsdoc: Document that AA fonts are now the default for xlib. 2004-09-28 Fred Kiefer * Source/x11/XGServerEvent.m (initialize_keyboard): Corrected typo reported by Benhur Stein . 2004-09-24 Adrian Robert * Source/x11/XGServerEvent.m: Improvement of earlier update to determine modifiers from KeySyms rather than KeyCodes: in process_key_event, KeySym is now looked up taking shift/compose modifier state into account, while in handling of KeyMapNotify in processEvent: this state is also considered in the majority of cases. Base on suggestions by Kazunobu Kuriyama (kazunobu.kuriyama@nifty.com). 2004-09-23 Adam Fedor * Version 0.9.4 * Documentation/news.texi: Update 2004-09-21 19:19 Alexander Malmberg * Source/art/ftfont.m: Add lineHeight ivar to FTFontInfo. (+defaultLineHeightForFont): Implement. (-initWithFontName:matrix:screenFont:): Set lineHeight. 2004-09-19 Fred Kiefer * Source/win32/WIN32Server.m: Added missing include for new Cygwin event pooling. 2004-09-17 Fred Kiefer * Source/winlib/Win32GState.m (-_compositeGState:...fraction:): Made the use of AlphaBlend depend on a define, which by default is missing. 2004-09-09 Fred Kiefer * Tools/xpbs.m (-[XPbOwner getSelectionData:type:], -[XPbOwner xProvideSelection:]): Removed some compiler warnings. * Source/cairo/CairoGState.m (-DPSimage:...:): Slightly improved. (-compositeGState:fromRect:toPoint:op:fraction:) New method (-compositeGState:fromRect:toPoint:op:, -dissolveGState:fromRect:toPoint:delta:) Implemented via new method. Added all missing colour conversions. (GSShowGlyphs::) Use new method on CairoFontInfo. * Header/cairo/CairoFontInfo.h (-drawGlyphs:length:on:atX:y:) New method. * Source/cairo/CairoFontInfo.m (-drawGlyphs:length:on:atX:y:) New method. Moved some includes from header to here, extracted method [setupAttributes] and other cleanup. 2004-09-08 Adam Fedor * Headers/x11/XGServer.h: Add 8bit fast drawing. * Source/x11/XGServer.m ([XGScreenContext -initForDisplay:screen:]): For 8bit, test for RGB_BEST_MAP. * Source/xlib/XGBitmap.m (_pixmap_combine_alpha, _bitmap_combine_alpha, _pixmap_read_alpha): Add 8 bit case. (patch from Paul Secchia ). * Documentation/Back/DefaultsSummary.gsdoc: Document it. * Documentation/news.texi: Update for new release. 2004-09-05 00:05 Alexander Malmberg * Tools/GNUmakefile.preamble: Compile with -Wall. * Tools/xpbs.m: Rename to +initializePasteboard. Return NO iff XOpenDisplay fails. * Tools/win32pbs.m (+initialize): Rename to +initializePasteboard. Return YES. * Tools/gpbs.m ([PasteboardServer -init]): Call +initializePasteboard instead of +class. Set xPbClass to nil if the call fails. 2004-09-01 Adam Fedor * configure.ac: Prepend don't overwrite CFLAGS and LDFLAGS given in environment. 2004-08-31 Adrian Robert * Source/x11/XGServerEvent.m: Changed mapping of GNUstep modifier keys to X11 KeySyms instead of KeyCodes. (Added check_key(); updated check_modifier(), -processEvent: (KeyMapNotify), changed default_key_code() to key_sym_from_defaults(), updated initialize_keyboard().) 2004-08-30 Fred Kiefer * Source/xlib/GSXftFontInfo.m: Changed usage of CString for font name and family into UTF8String for XFT. Patch by Yen-Ju Chen . 2004-08-24 Fred Kiefer * Source/win32/WIN32Server.m (-windowbounds:): Corrected variable name, so the fiel compiles again. (-setupRunLoopInputSourcesForMode:): Added new event polling code for Cygwin. * Source/cairo/CairoContext.m (-NSReadPixel:, beep): Removed methods. 2004-08-23 Fred Kiefer * Source/cairo/CairoContext.m (-DPScurrentalpha:, -DPSsetoffset::): Removed methods. * Source/cairo/CairoGState.m (-offset, -setoffset:): Added methods. (-forwardInvocation:): Improved output. (-GSSetDevice:::) Commented out NSLog calls. * Source/gsc/GSGState.m (-_showString:lenght:): Removed this method which was a left over from last patch. 2004-08-09 14:38 Alexander Malmberg * Source/win32/WIN32Server.m, Source/win32/WIN32ServerEvent.m, Headers/win32/WIN32Geometry.h (MSScreenRectToGS, GSScreenRectToMS): The 'GS' rect is, in the terminology of NSWindow.h, the window frame, not the screen frame. make the conversions match this and update the callers. * Source/x11/XGServerWindow.m (-_OSFrameToXFrame:for:, -_OSFrameToXHints:for:, -_XFrameToOSFrame:for:): Update conversions. (-windowdevice:): Remove artificial delays and geometry querying. Update based on the frame from the last ConfigureNotify. (-placewindow::): Remove event coordinate adjustments. Always send move/resize events to -gui right away. 2004-08-03 Fred Kiefer * Header/cairo/*: * Source/cairo/*: * Source/GSBackend.m: * configure.ac: * configure: Added cairo backend from Banlu Kemiyatorn . 2004-07-30 15:52 Alexander Malmberg * Headers/gsc/GSCStateOps.h, Source/gsc/GSContext.m, Source/gsc/GSGState.m (-GSReadRect:): New method. * Source/art/GNUmakefile: Add ReadRect.m. * Source/art/ReadRect.m: New file. * Source/art/blit.m, Source/art/blit.h: Add read_pixels_a and read_pixels_o. Fix spurious low bits in BLEAN_READ for 16bpp and 15bpp modes. * Source/xlib/XGContext.m (-GSReadRect:): Remove. * Source/xlib/XGGState.m (-GSReadRect:): Update key names and set all keys even if the rectangle is degenerate. Return nil if the image can't be read. Set the Matrix key. 2004-07-26 15:37 Matt Rice Alexander Malmberg * Source/x11/XGServerWindow.m (-_createAppIconPixmaps): New method. (-orderwindow:::): Use -_createAppIconPixmaps to set IconPixmapHint if we're using windowmaker. 2004-07-14 Adam Fedor * Documentation/Back/Standards.txt: update. 2004-07-13 03:11 Alexander Malmberg * Source/art/shfill.m (function_setup, -DPSshfill:): NSDebugLLog helpful error messages if something was wrong in the shader dictionary. 2004-07-09 Adam Fedor * Documentation/Back/Standards.txt: New EWMH file. 2004-07-06 Fred Kiefer * Source/winlib/Win32GState.m (-_compositeGState:...fraction:): Applied alpha blending patch by MA Garcias . Disabled GDI_WIDELINE_BEZIERPATH_BUG. * configure.ac: Added test for msimg32, needed for AlphaBlend. * configure: Regenerated. * Source/xlib/XGGState.m: Moved additional show methods to super class. * Source/gsc/GSGState.m: Implemented additional show methods based on (-showGlyphs::) and simple glyph conversion. 2004-06-19 Fred Kiefer * Source/x11/XGServerWindow.m (-standardcursor::): Added more standard cursors. * Source/win32/WIN32Server.m (-standardcursor::): Added more standard cursors. 2004-06-28 00:45 Alexander Malmberg * Headers/x11/XGServerWindow.h: Add buffer_width and buffer_height ivars. * Source/x11/XGServerWindow.m (-windowdevice:): Use buffer_width and buffer_height instead of xframe to keep track of the size of the buffer and alpha_buffer. 2004-06-28 00:41 Alexander Malmberg * Source/xlib/XGGState.m (-setWindowDevice:): Remove use of cast-as-lvalue. 2004-06-26 13:04 Alexander Malmberg * Source/x11/XGServerEvent.m (-processEvent: ConfigureNotify): Don't ignore the event for unmapped windows. Use XTranslateCoordinates to get the size and position right for both real and artificial events. Only update the position hints if we're mapped. * Source/x11/XGServerWindow.m: Add handlesWindowDecorations variable. (-handlesWindowDecorations): New method. (setWindowHintsForStyle, -styleoffsets:::::): If we aren't handling window decorations, treat all windows as borderless. (-stylewindow::, -setinputstate::): Assert that we're handling window decorations. (-window::::): Create the window structure earlier so it can be used to convert frames. (-_setupRootWindow): Set handlesWindowDecorations based on the GSX11HandlesWindowDecorations defaults value. * Documentation/Back/DefaultsSummary.gsdoc: Document GSX11HandlesWindowDecorations. 2004-06-19 Fred Kiefer * Source/win32/WIN32Server.m (-findWindowAt:windowRef:excluding:) New method for D&D. (-dragInfo), (-slideImage:from:to:) Removed. 2004-06-11 Adam Fedor * Version 0.9.3 * Documentation/news.texi: Update. * configure.ac: Remove WindowMaker/libwraster check 2004-05-27 Fred Kiefer * Source/win32/WIN32ServerEvent.m (-windowEventProc:::) Added handling of size and move events and extracted end of resize event handling into the same new method. PAINT now always validates the whole window. Patch by MA Garcias . New method [-resizeBackingStoreFor:] used for end of resize events. 2004-05-13 17:11 Alexander Malmberg * Source/art/ftfont.m (-advancementForGlyph:): Return a zero size for control glyphs. (-positionOfGlyph:precededByGlyph:isNominal:): Check if either glyph is a control glyph before converting to freetype glyph indices. 2004-05-12 Fred Kiefer * Headers/win32/WIN32Geometry.h: (GSWindowOriginToMS) corrected computation. * Source/win32/WIN32Server.m (-orderwindow:::) Removed obsolte "return" in non-NSWindowOut case and use flag SWP_NOACTIVATE. (-placewindow::, -movewindow::) Don't use flag SWP_NOREDRAW. Patch by MA Garcias . * Source/win32/WIN32ServerEvent.m Corrected definition of the GET_X_LPARAM and GET_Y_LPARAM macros. 2004-03-30 01:49 Alexander Malmberg * Source/x11/XGGLFormat.m (-initWithAttributes:): Fix handling of 15bpp and 16bpp modes (NSOpenGLPFAAccumSize). 2004-02-29 21:42 Alexander Malmberg * Source/art/ftfont.h, Source/art/ftfont.m: Add -drawGlyphs::at::to::::::alpha::color::::transform:drawinfo: method. * Source/art/ARTContext.m (-GSShowGlyphs::): Use it if the destination window has an alpha buffer. (-initWithContextInfo:): Try to find a DirectColor or TrueColor visual before falling back on the default visual. 2004-02-28 Adam Fedor * Version 0.9.2 2004-02-28 Fred Kiefer * Source/win32/WIN32Server.m (-setupRunLoopInputSourcesForMode:): Use a shorte timer interval. 2004-02-24 15:45 Alexander Malmberg * Source/art/image.m: Add support for grayscale, one-is-black color spaces. (_image_get_color_rgb_cmyk_gray): Invert gray value if one is black. (-DPSimage:::::::::::): If the color space is NSDeviceBlackColorSpace or NSCalibratedColorSpace, treat one as black. 2004-02-17 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]): Don't try to raise the root window. 2004-02-08 23:20 Gregory John Casamento * Source/xlib/XGGState.m: Added necessary calibrated colorspaces to the DPSimage: method. 2004-02-04 01:48 Alexander Malmberg * Source/x11/XGServerEvent.m: Remove uses of the now deprecated "casts as lvalues" gcc extension. 2004-01-27 Adam Fedor * Documentation/Back/DefaultsSummary.gsdoc: Fix doc markup * Documentation/Back/GNUmakefile: Change install location. 2004-01-25 Fred Kiefer * Source/art/shfill.m (-DPSshfill:): * Source/winlib/Win32GState.m (-DPSimage::::): * Source/xlib/XGGState.m (-DPSimage::::): Replaced appendTransform: with prependTransform:. * Source/art/image.m (-DPSimage:): Replaced prependTransform: with appendTransform:. 2004-01-25 13:52 Alexander Malmberg * Source/art/image.m (-_image_do_rgb_transform:::): Fix off-by-one error in horizontal clipping. 2004-01-10 Adam Fedor * configure.ac: Check if XShm is really implemented (it isn't on Cygwin even though the headers are there). * Source/x11/XGServerEvent.m ([XGServer -processEvent:event]): ifdef around XShm call. 2004-01-10 Adam Fedor * Prevent orderwindow:relativeTo: from making a window key. * Headers/x11/XGGeneric.h: Add Ivar. * Source/x11/XGServerEvent.m (-_handleTakeFocusAtom:forContext:): Don't take focus if we ordered this window previously. * Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]): Set desiredOrderWindow. ([XGServer -setinputfocus:]): Reset it. 2004-01-10 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]): When otherWin == 0, make sure the window does not go in front of the current key window. * Source/win32/WIN32Server.m ([WIN -orderwindow:op:otherWin:winNum]): Allow otherWin < 0. 2004-01-10 16:25 Alexander Malmberg * Source/art/blit.m: Replace uses DI_16_B5G5R5A1 and DI_16_B5G6R5 with uses of DI_16_B5_G5_R5_A1 and DI_16_B5_G6_R5. (sover_ao): Add an optimized version for the 16/15 bpp modes. (satop_aa): Simplify calculation of da'. (datop_aa): Simplify calculation of da'. Fix the rounding. (xor_aa): Fix the rounding. (DI_16_B5_G5_R5_A1, DI_16_B5_G6_R5): Unpack pixels in a more efficient way. * Source/art/blit_scrapheap.m: New file. 2004-01-07 14:51 Alexander Malmberg * Source/art/composite.m (-_composite_func::::::): If the source has alpha, the destination is opaque, and the operator is NSCompositeCopy, set dst_needs_alpha to YES. (-compositerect:op:): If alpha is needed, make sure alpha is always created _before_ setting up the alpha destination pointers. Only write alpha for NSCompositeCopy if the current color isn't opaque. 2004-01-07 Fred Kiefer Added missing .cvsignore files and extended the existing ones. 2003-12-31 Fred Kiefer * Tools/win32pbs.m New file to handle windows clipboard interaction. * Tools/GNUmakefile Compile new file for windows backend. * Tools/gpbs.m (PasteboardServer -init) for windows backends use Win32PbOwner as the pasteboard owner class. 2003-12-30 Fred Kiefer * Source/gsc/path.m (-GSSendBezierPath:) preset the count variable, as this is expected by the method [NSBezierPath getLineDash:count:phase:]. * Source/xlib/XGGState.m (-_doPath::draw:) allways set fill rule for path_fill. 2003-12-30 Fred Kiefer * Source/art/path.m (-DPSrectstroke::::, -_axis_rectangle::::vpath:axis::::pixel:): Adopted to change in NSAffineTransform.h. 2003-12-28 Fred Kiefer * Source/win32/WIN32Server.m (initWithAttributes:): Adjusted spelling of useWMTaskBar to header, to get it compile. 2003-12-26 Adam Fedor * Focus fixes. * Headers/win32/WIN32Server.h: Add flags ivar * Source/win32/WIN32Server.m (orderwindow:::): If useWMTaskBar flag set, don't show app icon and don't order out menu window. * Source/win32/WIN32ServerEvent.m (windowEventProc:::): On activation message, activate app, on deactivation message, deactivate app (if message comes from menu window). 2003-12-25 Fred Kiefer * Source/win32/WIN32Server.m (-_initWin32Context) set a default cursor, which is used each time the window is entered. 2003-12-23 Fred Kiefer * Source/winlib/WIN32GState.m (-copyBits:fromRect:toPoint:): Made save against self and source being the same object and corrected computation for flipped views. This code is copied over from xlib. * Source/winlib/WIN32FontEnumerator.m Reimplemented the whole file. * Source/winlib/WIN32FontInfo.m (-setupAttributes) assign font family ivar and use common functions with font enumerator. * Source/win32/WIN32ServerEvent.m (WIN32Server -windowEventProc::::) flag that we handle erasing of the background ourselves. (invalidateWindow) copy from backing store if possible. 2003-12-03 Adam Fedor * Headers/win32/WIN32Server.h: Add ivars currentFocus, desiredFocus. * Source/win32/WIN32Server.m (setinputfocus:): Don't set if window already has focus * Source/win32/WIN32ServerEvent.m (-windowEventProc::::): Main event handler. (mainWindowProc): Call -windowEventProc::::. (-handleGotFocus:): Handle main/key directly without sending event to frontend. 2003-12-02 Adam Fedor * Source/win32/WIN32Server.m: Add a bunch of DebugLLog statements (WTrace, NSEvent, Focus). Move event functions to... * Source/win32/WIN32ServerEvent.m: here. 2003-12-02 Leigh Smith * Source/winlib/WIN32GState.m ([WIN -_paintPath:drawType]): Corrected bug in Bezier curves, a bug in line widths and adds a workaround for a Windows GDI drawing bug when drawing curved wide lines. 2003-11-25 20:12 Alexander Malmberg * Source/x11/XGServerEvent.m (initialize_keyboard): Make sure that no _*_keycodes contains the same keycode twice. 2003-11-25 12:09 Alexander Malmberg * Source/art/ftfont.m ([FTFontInfo_subpixel -drawGlyphs::at::to::::::color::::transform:drawinfo:): If freetype is sufficiently new, use its LCD subpixel support instead of scaling manually. 2003-11-23 Adam Fedor * Version 0.9.1 2003-11-23 Fred Kiefer * Source/x11/XGServerEvent.m (process_modifier_flags()) treat caps lock as alpha shift and not as shift modifier. 2003-11-20 Adam Fedor * Source/xlib/XGBitmap.m (_pixmap_combine_alpha): Use RGetClosestXColor to get colors on 8bit displays. (_bitmap_combine_alpha): Likewise. Fixes PR #6341 2003-11-19 Benhur Stein * Source/x11/XGServerEvent.m ([XGServer -processEvent:event]): Correct off-by-one error. 2003-11-19 Adam Fedor * Source/x11/XGServer.m: Add some docs. * Window focus fixes. * Source/x11/XGServerEvent.m ([XGServer -processEvent:event]): Move take focus code... ([XGServer -_handleTakeFocusAtom:forContext:]): ...to here. Check for common problems before passing event to frontend. ([XGServer -processEvent:event])(FocusOut): Invalidate current focus window and focus request. 2003-11-18 16:57 Alexander Malmberg * Source/art/ftfont.m: Remove fallback ivar. Add advancementImgd and a simple glyph size cache for use in -advancementForGlyph:. (-initWithFontName:matrix:screenFont:): Set up advancementImgd. (-advancementForGlyph:): Use advancementImgd instead of setting up a FTC_ImageTypeRec on each call. Cache glyph sizes to avoid expensive freetype calls. 2003-11-05 Adam Fedor * Source/x11/XGServerEvent.m ([XGServer -processEvent:]): New method broken off from -receivedEvent:type:extra:forMode:. 2003-11-05 03:29 Alexander Malmberg * Source/x11/XGServerEvent.m (-receivedEvent:type:extra:forMode:): Casts as lvalues will be deprecated in gcc 3.4. Thus, don't assign to the cWin macro. Reported by Lyndon Tremblay. 2003-11-02 02:58 Alexander Malmberg * Source/gsc/GSStreamContext.m Whitespace cleanups. (writeHex): Use index properly; don't always write the first byte. Use fputc() instead of fprintf() (was doing the hex conversion manually anyway, might as well make it efficient). 2003-11-02 02:27 Alexander Malmberg * Source/gsc/GSStreamContext.m (fpfloat, writeHex): Make static. 2003-10-29 Yen-Ju Chen * Source/x11/XGServerWindow.m ([XGServer -_setupRootWindow]): Always set WindowMaker app icon property ([XGServer -window::::]): Idem for GNUstep window styles. ([XGServer -stylewindow::win]): Idem. ([XGServer -docedited::win]): Idem. ([XGServer -setwindowlevel::]): Idem. 2003-10-22 Adam Fedor * configure.ac: Check for X11 function prototypes (Fixes problems on Solaris 2.6). 2003-10-20 20:09 Alexander Malmberg * Tools/xpbs.m (-xProvideSelection:): Copy all characters and the terminating nul in XG_COMPOUND_TEXT handling. 2003-10-20 16:20 Alexander Malmberg * Tools/xpbs.m (+xSelectionNotify:): Don't call XGetAtomName() if the property is None. 2003-10-19 Adam Fedor * Source/xlib/XGBitmap.m: Cache color lookup to reduce use of XQueryColor (based on code from Marko Riedel). * configure.ac: Add 2.57 prereq 2003-10-15 Adam Fedor * configure.ac: Don't look for jpeg/tiff (already linked in by gui). 2003-10-08 15:58 Alexander Malmberg * Source/xlib/XGContext.m (+initializeBackend): Give NSLog an objective-c string (@""), not a c string (""). Reported by Matt Rice. 2003-10-05 Adam Fedor * Documentation/GNUmakefile: Make Back documentation * Documentation/Back/GNUmakefile: Set DocumentationDirectory. * Source/x11/raster.c (RMakeCenteredImage): Remove (unused). 2003-10-04 14:27 Alexander Malmberg * Source/art/path.m (-DPSrectclip::::): Move the call to -DPSnewpath so it gets called on all paths through the method. 2003-10-03 Adam Fedor * configure.ac: Use -Wl for netbsd linker options. 2003-10-02 Adam Fedor * Source/xlib/XGGState.m (-DPSrectclip::::): Clear path. * Source/winlib/WIN32GState.m (-DPSrectclip::::): Idem. * Source/art/path.m (-DPSrectclip::::): Idem. 2003-09-30 Adam Fedor * Source/gsc/GSGState.m ([GSGState -DPSrectclip::::]): Clear the current path after clipping. 2003-09-29 Adam Fedor * Version 0.9.0 2003-09-22 13:03 Alexander Malmberg * Source/art/image.m (-_image_do_rgb_transform:::): Check if the coordinates involved are too large to handle normally. If they are, scale down the numbers a bit (gives less accuracy, but no overflow). 2003-09-20 Adam Fedor * Headers/xlib/XGGState.h: Add GSReadRect def. * Headers/xlib/XGPrivate.h: Add _pixmap_read_alpha def. * Source/xlib/XGBitmap.m (_pixmap_read_alpha): Implement. * Source/xlib/XGGstate.m (-GSReadRect:): Idem. 2003-09-15 Adam Fedor * Source/gsc/GSGState.m ([GSGState -deepen]): Typo fix - copy textCtm (reported by Banlu Kemiyatorn ). 2003-09-09 Adam Fedor * Source/gsc/GSContext.m (-DPSsetgstate:): Copy gstate so we don't modify original. 2003-09-08 01:39 Alexander Malmberg * Source/art/blit.m (artcontext_setup_draw_info): Add some debug logging. 2003-09-03 Adam Fedor * Source/xdps/GNUmakefile: include config.make (patch from Aredridel ). 2003-09-02 Adam Fedor * Tools/gpbs.m (init): Don't mess with file descriptors on MinGW. 2003-09-02 Fred Kiefer * Tools/xpbs.m Made all calls to XGetAtomName() free their memory later on. Removed function osTypeToX(). Extracted method [getSelectionData:type:] from [xSelectionNotify:]. [xSelectionNotify:] now supports incremental data transfer and is save against failing string conversions. Complete rewrite of [xProvideSelection:] to better follow the ICCCM specification. This now implements TIMESTAMP, MULTIPLE and COMPOUND_TEXT (all untested!) 2003-08-31 Adam Fedor * Tools/gpbs.m (init): Close file descriptors so gpbs can be a proper daemon. 2003-08-26 Adam Fedor * Version 0.8.9 2003-08-19 Fred Kiefer * Tools/xpbs.m Made some of the NSLog messages more explicit on what did go wrong. 2003-08-17 Fred Kiefer * Tools/gpbs.m [PasteboardServer init] made sure that class XPbOwner gets initialized, by adding a dummy call to class. * Tools/xpbs.m [XPbOwner requestData:] added loop to get data of size bigger that 32K bytes. [XPbOwner pasteboard:provideDataForType:] and [XPbOwner pasteboardChangedOwner:] removed the remaining ifdef tests for X_HAVE_UTF8_STRING. Removed function xTypeToOs() as this was not used. 2003-08-16 Fred Kiefer * Source/xlib/XGFontManager.m In load_cache() enclosed loading of archive in exception handling and removed the writing of the archive previously done to update the format. 2003-08-05 Martin Brecher * Tools/gpbs.1: Updated, fixed typos, added BUGS and HISTORY section, file is now unprocessed as it should be. 2003-08-10 23:26 Alexander Malmberg * Source/art/ftfont.m: Override the new default font name methods. Log the glyph when logging FTC_SBitCache_Lookup errors. 2003-08-09 Fred Kiefer * Tools/xpbs.m Reworked the X interaction so that both STRING and UTF8_STRING are supported both ways. 2003-08-08 Fred Kiefer * Tools/xpbs.m [XPbOwner initialize] switched the usage of PRIMARY and CLIPBOARD. * Documentation/Back/DefaultsSummary.gsdoc Add new GSOldClipboard deafult. 2003-08-02 Kazunobu Kuriyama * Tools/xpbs.m: Multi-lingual cut & paste support 2003-08-02 13:29 Alexander Malmberg * Source/x11/XGServer.m (-dealloc): Only use the rcontext freeing hack when using our own wraster. 2003-08-01 Adam Fedor * configure.ac: Move freetype check before Xft check and fix up flags. 2003-07-30 David Ayers * Created tag 'pre-header-reorg-20030731'. * Source/art/GNUmakefile: Do not make headers publilc. * Source/gsc/GNUmakefile: Ditto. * Source/x11/GNUmakefile: Ditto. * Source/xdps/GNUmakefile: Ditto. * Source/xlib/GNUmakefile: Ditto. * Headers/win32/*.h: Update includes for new header structure. * Headers/winlib/*.h: Ditto. * Headers/x11/XGServer.h: Ditto. * Headers/xlib/*.h: Ditto. * Source/art/ftfont.m: Ditto. * Source/gsc/*.m: Ditto. * Source/x11/*.m: Ditto. * Source/xdps/*.m: Ditto. * Source/xlib/*.m: Ditto. * Tools/gpbs.m: Ditto. 2003-07-26 Fred Kiefer * Source/x11/XGServer.m In [XGScreenContext dealloc] free hermes_data of RContext. 2003-07-26 Fred Kiefer * Source/gsc/GSGState.m In [GSCurrentCTM] autorelease the returned value. 2003-07-23 Adam Fedor * Version 0.8.8 2003-07-22 Kazunobu Kuriyama * Headers/xlib/XGFontSetFontInfo.h: New file. * Source/xlib/XGFontSetFontInfo.m: New file. * Source/xlib/XGContext.m: ([XGContext +initializeBackend]): Modified to use XGFontSetFontInfo. * Source/xlib/GNUmakefile: Modified to include XGFontSetFontInfo.m. 2003-07-22 Adam Fedor * Headers/x11/XGOpenGL.h (GSglxMinorVersion): New * Source/x11/XGGLContext.m (+clearCurrentContext): Use it to call correct function. (-initWithFormat:shareContext:, makeCurrentContext): Idem. * Source/x11/XGGLFormat.m ([ XGGLPixelFormat -getValues: forAttribute:forVirtualScreen:]): Idem. (initWithAttributes:): Idem. (Patch from Damien Genet with some changes). 2003-07-21 Adam Fedor * Documentation/Back/DefaultsSummary.gsdoc: Add new GSXIMInputMethodStyle deafult (Adam Fedor). * Source/x11/context.c, StdCmp.c, convert.c, raster.c, scale.c: Updated to 0.80.2 version 2003-07-13 Kazunobu Kuriyama * Header/x11/XGInputServer.h: Add the new category InputMethod. * Header/x11/XGServer.h: Add the new category InputMethod. * Source/x11/XIMInputServer.m: ([XIMInputServer (XIMPrivate) -ximStyleInit]): Cover the input method styles RootWindow, OffTheSpot, OverTheSpot, and OnTheSpot. ([XIMInputServer (XIMPrivate) -ximCreateIC:]): Implement OffTheSpot and OverTheSpot. Implement the category InputMethod. * Source/x11/XGServer.m: Implement the category InputMethod. Add overriding methods to NSTextView (NSView (InputMethod)). 2003-07-27 Richard Frith-Macdonald * Tools/gpbs.m: Use protocols * Source/x11/XGServerWindow.m: Use UTF8String rather than cString to avoid crashes using non-ascii strings ... is this right? 2003-07-16 Fred Kiefer * Source/x11/XGServer.m Added [XGScreenContext dealloc] to clean up RContext. * Source/x11/XGServerWindow.m [_checkWindowManager] better clean up of memory. [_setupRootWindow] and [titlewindow::] free the value of the XTextProperty. 2003-07-16 Fred Kiefer * Tools/xpbs.m [XPbOwner xSelectionNotify:] and [XPbOwner xProvideSelection:] explicit conversion of transferd strings from/to NSISOLatin1StringEncoding. 2003-07-05 Adam Fedor * Documentation/Back/DefaultsSummary.gsdoc: New file. * Tools/gpbs.1: Unziped * Tools/GNUmakefile.postamble: gzip man files. * configure.ac: Add openbsd flags like freebsd. 2003-07-06 Fred Kiefer * Header/x11/XGGeneric.m Added some new Atoms to structure XGWMWinTypes. * Source/x11/XGServerWindow.m [_checkWindowManager] initializes the new atoms. In [setwindowlevel::] changed the EWMH case, so that it works correctly with KDE 3.1. There we used to have borders on menu windows. 2003-07-05 14:05 Alexander Malmberg * Source/art/ftfont.m: Handle freetype <=2.1.2 in the error reporting. 2003-07-03 22:03 Alexander Malmberg * Source/art/ftfont.m: Give more information when reporting FTC_SBitCache_Lookup() errors. 2003-07-02 17:28 Alexander Malmberg * Source/art/ftfont.m (-initWithFontName:matrix:screenFont:): Return nil if it's not a valid font. 2003-07-01 16:37 Alexander Malmberg * Source/art/ftfont.m: Use the correct set of flags when loading glyphs for freetype >=2.1.3. Anti-alias by default if there is no defaults value for GSFontAntiAlias. 2003-06-30 18:11 Alexander Malmberg * Source/xlib/XGFont.m (-xCharStructForGlyph:): Don't try to treat NSGlyph pointers as unichar pointers; break on non-little-endian systems. 2003-06-29 17:34 Alexander Malmberg * Source/art/ftfont.m (-initWithFontName:matrix:screenFont:): Round the matrix entries for screen fonts to integers to get consistent handling of non-integer sized screen fonts. 2003-06-28 15:27 Alexander Malmberg * Source/art/ftfont.m: Use a specific table when translating face names. Add a list of standard face names so make_strings can generate .strings files. * Source/GNUmakefile: Add nfontFaceNames.strings to the list of localized resources. Set the language list to English and Swedish. * Source/GNUmakefile.preamble: Add a quick hack to make make_strings pick up the .m files in all subprojects. * Source/English.lproj/nfontFaceNames.strings, Source/Swedish.lproj/nfontFaceNames.strings: Add English (dummy) and Swedish translations of the nfont face names. 2003-06-27 Richard Frith-Macdonald * Tools/gpbs.m: Removed unused methods no longer in protocol. 2003-06-25 Adam Fedor * Tools/gpbs.1.gz: New file (from Martin Brecher). * Tools/GNUmakefile.postamble (after-install): Install it. 2003-06-26 00:33 Alexander Malmberg * Source/ftfont.m (-_generateGlyphsForRun:at:): Add (experimental) handling of utf16 to glyph generation so planes beyond the BMP can be used. 2003-06-20 Adam Fedor * Version 0.8.7 2003-06-17 20:07 Alexander Malmberg * Source/art/composite.m, Source/art/ftfont.m, Source/art/path.m: Minor cleanups. 2003-06-17 Fred Kiefer * Source/gsc/GSStreamContext.m (GSShowGlyphs::, output:length:) Removed compiler warnings about signed/unsigned comparision. Declared the extension method [GSFontInfo nameOfGlyph:]. In [NSDrawBitmap:::::::::::] initiliale variable alpha to stop the compiler from complaining. * Source/x11/xdnd.c (xdnd_is_dnd_aware(), xdnd_get_type_list) Removed compiler warnings about signed/unsigned comparision. * Header/x11/XGGeneric.h Made ivar focusRequestNumber unsigned. * Source/x11/XGServerEvent.m (receivedEvent:type:extra:forMode:) Removed compiler warnings about signed/unsigned comparision. [receivedEvent:type:extra:forMode:] initialiase deltaY in all cases. * Source/x11/XGServerWindow.m (PropGetCheckProperty(), _setupRootWindow, windowdevice:, setwindowlevel::, imagecursor::::::) Removed compiler warnings about signed/unsigned comparision. Adopted to changes in GSDisplayServer.h. * Source/x11/XGDragView.m (_handleEventDuringDragging:, _updateAndMoveImageToCorrectPosition, _xWindowAcceptingDnDunderX:Y:, _xWindowAcceptingDnDDescendentOf:underX:Y:) Removed compiler warnings about signed/unsigned comparision. * Source/xlib/XGGState.m (_doComplexPath:::) Removed compiler warnings about signed/unsigned comparision. * Source/xlib/GSXftFontInfo.m (setupAttributes) Removed compiler warnings about unused variable. * Source/win32/WIN32Server.m Adopted to changes in GSDisplayServer.h. windowStyleForGSStyle() changed parameter style to unsigned. * Tools/xpbs.m Removed include for file GSPasteboardServer.h to remove some compiler warnings. 2003-06-12 21:44 Alexander Malmberg * Source/art/ftfont.m: Handle 2.0.* correctly in the freetype version check. 2003-06-12 19:22 Alexander Malmberg * Source/x11/XWindowBuffer.m: Add XWindowBufferUseXShm defaults variable. 2003-06-11 15:32 Alexander Malmberg * Source/art/ftfont.m: Implement -glyphWithName: and -appendBezierPathWithGlyphs:count:toBezierPath:. 2003-06-07 23:05 Alexander Malmberg * Source/art/ftfont.m: Add some ifdef:s to get it to compile with both freetype <=2.1.2 and >=2.1.3. 2003-06-06 Adam Fedor * Source/x11/XGServerWindow.m (setWindowHintsForStyle): Specifically check for success of XGetWindowProperty call. 2003-05-25 Adam Fedor * Version 0.8.6 2003-05-19 15:56 Alexander Malmberg * Source/art/shfill.m (function_getsample): Clamp to range. (function_setup): Use -doubleValue, not -intValue, for values that are allowed to be real numbers. 2003-05-18 Benhur Stein * Source/xlib/XGGState.m (-copyBits:fromRect:toPoint:): Draw correctly when source and dest have different flip'ness. (-_compositeGState:sourcefromRect:fromRecttoPoint:toPointop:opfraction:]): Draw correctly when source is flipped. 2003-05-18 00:03 Alexander Malmberg * Source/art/GNUmakefile, Source/art/shfill.m: Implement basic version of shfill operator. 2003-05-17 14:49 Alexander Malmberg * configure.ac: Make sure to add -lm when adding -ltiff (wasn't done in one case). * configure: Regenerate. 2003-05-11 19:21 Alexander Malmberg * Source/art/ftfont.m: Report errors in more cases. 2003-05-07 Adam Fedor * configure.ac: Check for freetype separetely and add to xlib flags if present. 2003-05-02 Adam Fedor * Documentation/Back/GNUmakefile: Remove GNUSTEP_MAKEFILES 2003-04-27 Adam Fedor * Updates for filesystem change. * GNUmakefile (GNUSTEP_MAKEFILES): Remove * Documentation/GNUmakefile, Source/GNUmakefile, Source/*/GNUmakefile, Tools/GNUmakefile: Idem * configure.ac: Replace $GNUSTEP_SYSTEM_ROOT/Makefiles with $GNUSTEP_MAKEFILES. Replace Libraries with Library/Libraries. Replace Headers with Library/Headers. 2003-03-01 Fred Kiefer * Source/winlib/Win32FontInfo.m * Source/xlib/GSXftFontInfo.m * Source/xlib/XGFont.m In [setupAttributes] removed setting of fontDictionary values. * Source/xdps/AFMFileFontInfo.m Create the fontDictionary in [_setFontInfo]. 2003-04-27 Richard Frith-Macdonald * Tools/xpbs.m: ([xSendData:format:items:type:to:]) Fix bug calculating offset into data buffer. Prevent crashing and provision of garbage data. 2003-04-10 12:12 Alexander Malmberg * Source/x11/XWindowBuffer.m (-dealloc): Don't explicitly set the X window's background pixmap back to None. 2003-04-02 14:04 Alexander Malmberg * Source/art/ARTContext.m, Source/art/blit.h: Clean up includes. * Source/art/blit.m (plusd_aa): Fix calculation of alpha. 2003-03-29 19:13 Alexander Malmberg * Source/art/ARTContext.m, Source/art/blit.h, Source/art/blit.m, Source/art/ftfont.h, Source/art/ftfont.m: Implement rendering of text to buffers with destination alpha. Change the subpixel font rendering to override the glyph operator since it's the one actually being used. 2003-03-25 Adam Fedor * Source/xlib/GSXftFontInfo.m: Protect 'id' when including fontconfig/fontconfig.h (suggestion from Pete French). 2003-03-26 00:24 Alexander Malmberg * Source/x11/XWindowBuffer.m (-dealloc): Free the shared memory pixmap (if one was allocated). * Source/art/composite.m: When checking whether the overlap handling should be used, compare windows, not gstates. 2003-03-22 Willem Rein Oudshoorn * Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]): Use XWithDrawWindow instead of XUnmapWindow as suggested by Xlib programming manuals. 2003-03-03 20:05 Alexander Malmberg * Source/art/ftfont.m: Remap glyph numbers from freetype so NSNullGlyph is never used. 2003-03-01 Fred Kiefer * Source/xlib/GSXftFontInfo.m In [setupAttributes] moved the call to open the XFT font further to the back as Derek Zhou claims that this takes over the ownership of the pattern, which then results in strange behaviour. 2003-02-27 Fred Kiefer * configure.ac Check for FreeType 2 fontconfig. * configure * config.h.in Regenerated * Header/xlib/GSXftFontInfo.h Define font enumerator for fontconfig. * Source/xlib/XGContext.m Use new enumerator in anti-alias mode if available. * Source/xlib/GSXftFontInfo.m Added fontconfig specific code. Patch from Derek Zhou dzhou@chrontel.com with some adaption 2003-03-24 Adam Fedor * Version: 0.8.5 2003-03-11 Adam Fedor * configure.ac: Only add libgdi32 for winlib 2003-03-08 Adam Fedor * Headers/x11/XGOpenGL.h: Standardize BOOL redefine to XWINDOWSBOOL. 2003-02-24 Adam Fedor * Version: 0.8.4 2003-02-20 Willem Rein Oudshoorn * Source/xlib/XGFont.m ([XGFontInfo -setupAttributes]): Use ascender and descender informaton of the X11 font instead of using maximum bounding box. 2003-02-19 Adam Fedor * Source/gsc/GSStreamContext.m (fpfloat): New function. Used everywhere to print a float regardless of current locale. 2003-02-17 Willem Rein Oudshoorn * Source/x11/XGDragView.m ([XGDragView -drawRect:]): use [self frame] instead of `rect'. Fixes #101846. ([XGDragView -_handleDrag:]): Fixed typo in comment ([XGDragView -_handleEventDuringDragging:theEvent]): Removed old comment. 2003-02-16 Richard Frith-Macdonald * Source/x11/XGDragView.m: Set drag window at NSPopUpMenuWindowLevel so that it lies above pretty much anything apart from screensaver. 2003-02-09 Fred Kiefer * Source/x11/XGServerWindow.m Removed implementation of image sliding. Corrected xgps_cursor_image compiler warning. * Header/x11/XGSlideView.h * Source/x11/XGSlideView.m Removed files as they are now in the front end. * Source/x11/GNUmakefile Removed XGSlideView.m 2003-02-10 18:44 Alexander Malmberg * Source/art/ftfont.m: Implement -glyphIsEncoded:. (add_face): Avoid calling malloc(0). 2003-02-09 Adam Fedor * Source/gsc/GSStreamContext.m (-GSShowGlyphs::): Implement to use glyphshow if font gives back glyph names, otherwise use previous hack. 2003-02-09 Fred Kiefer * Source/gsc/GSStreamContext.m [DPSconcat:] simplify the output for common cases. [GSShowGlyphs::] added hack implementation, so that some usefull output is still provided. 2003-02-08 21:10 Alexander Malmberg * Source/art/ftfont.m: Add somewhat experimental -nameOfGlyph: method to try to get printing to work. 2003-02-06 Richard Frith-Macdonald * Tools/gpbs.m (ihandler): Fix for mingw, which doesn't have kill() * Headers/winlib/WIN32FontInfo.h: New method to draw glyphs * Source/winlib/WIN32FontInfo.m: New method to draw glyphs * Source/winlib/WIN32GState.m: New method to draw glyphs 2003-02-02 22:00 Alexander Malmberg * Source/art/ftfont.m (-initWithFontName:matrix:screenFont:): Use better guess for x-height value. * Source/x11/XGServerWindow.m: Use safer order of includes. * Source/xlib/GSXftFontInfo.m (-widthOfGlyphs:lenght:, -drawGlyphs:lenght:onDisplay:drawable:with:at:): Convert glyph buffers to 16-bit buffers that the Xft functions can handle. * Source/xlib/XGFont.m: Whitespace cleanups. 2003-01-31 Chris B. Vetter * Tools/gpbs.m (-dealloc): Remove observer. (ihandler): Reset all signals and try to reraise original signal. (init): Set NSIG signals. (main): release server before exiting. 2003-02-02 Fred Kiefer * Source/xlib/GSXftFontInfo.m Added glyph methods needed for new text system. 2003-01-31 Fred Kiefer * Source/x11/XGServerWindow.m Implemented [movewindow::] and [restrictWindow:toImage:]. * Source/x11/XGBitmapImageRep.m Removed the xPixmap methods. * Source/x11/XGSlideView.m Use new display server methods to implement without X calls. This class can now be moved to frontend. * Source/x11/XGDragView.m Use new display server methods. 2003-01-31 22:33 Alexander Malmberg * Source/art/ftfont.m (-_generateGlyphsForRun:at:): Implement handling of text attachments. 2003-01-27 18:10 Alexander Malmberg * Source/art/ftfont.m: Clean up includes. (-initWithFontName:matrix:screenFont:): Use absolute values of the matrix entries when checking if a screen font entry should be used. 2003-01-26 21:24 Alexander Malmberg * Source/xlib/GSXftFontInfo.m: Update with screen font changes in backend/gui interface. 2003-01-26 20:07 Alexander Malmberg * Source/x11/XWindowBuffer.m (-_exposeRect:): Round rectangle to expose outwards so all pixels intersected by the expose rectangle are actually exposed. 2003-01-26 20:04 Alexander Malmberg * Headers/xlib/XGPrivate.h, Source/art/ARTContext.m, Source/art/ARTGState.h, Source/art/composite.m, Source/art/ftfont.h, Source/art/ftfont.m, Source/art/image.m, Source/art/path.m, Source/winlib/WIN32FontInfo.m, Source/xdps/AFMFileFontInfo.m, Source/xlib/XGFont.m, Source/xlib/XGGState.m: Merge in text-system-branch. 2003-01-26 18:17 Alexander Malmberg * Source/xlib/XGFont.m: Make -GSShowGlyphs::'s helpers actually work. 2003-01-26 17:22 Alexander Malmberg * Headers/xlib/XGPrivate.h, Source/xlib/XGFont.m, Source/xlib/XGState.m: Implement basic version of -GSShowGlyphs:: with a few helpers. 2003-01-26 17:15 Alexander Malmberg * Source/art/ftfont.m (-advancementForGlyph:): Return correct metrics for both screen and printer fonts. 2002-11-26 12:58 Alexander Malmberg * Source/winlib/WIN32FontInfo.m, Source/xdps/AFMFileFontInfo.m, Source/xlib/XGFont.m, Source/xlib/XftFontInfo.m: Update with new screen font changes in backend/gui interface. Source/art/ftfont.m: Update with new interface. Add basic support of screen fonts. 2002-11-24 00:40 Alexander Malmberg * Source/x11/XWindowBuffer (-_exposeRect:): Round coordinates explicitly to avoid truncating problems. 2002-11-24 00:35 Alexander Malmberg * Source/art/ARTContext.m, Source/art/ftfont.h, Source/art/ftfont.m: Implement the glyph generation backend methods. Implement the GSShowGlyphs operator. Handle glyphs properly in FTFontInfo. 2003-01-23 Adam Fedor * Headers/xlib/GSXftFontInfo.h: Renamed from XftFontInfo * Source/xlib/GSXftFontInfo.m: Idem. * Source/xlib/GNUmakefile: Update for change. * Source/xlib/XGContext.m: Idem. 2003-01-23 Adam Fedor * Documentation/Back: Some documentation. 2003-01-20 Adam Fedor * Source/gsc/GSStreamContext.m (-GSSetCTM:): Implement. (-GSConcatCTM:): Idem. (-NSDrawBitmap:::::::::::): Don't flip images in a flipped view. Correct scaling of images. Tue Jan 21 02:08:05 2003 Alexander Malmberg * Source/xlib/XGFont.m ([XGFontInfo -dealloc]): Fixed memory leak: use XFreeFont(), not XUnloadFont(). 2003-01-14 Adam Fedor * configure.ac: Check for GLX_RGBA_TYPE in glx.h 2003-01-14 Fred Kiefer * Source/xdps/NSDPSContext.m Removed unneeded method [xrContext]. Moved context access into [createDPSContext] and call [XGServer xrContextForScreen:] instead of [XGServer xrContext]. 2002-12-31 Adam Fedor * Headers/x11/XGOpenGL.h: Redefine BOOL to avoid name collision 2002-11-27 Frederic De Jaeger * configure.ac: add the flag --disable-glx. * configure: regenerated 2002-11-24 Fred Kiefer * Source/x11/XIMInputServer.m In [lookupStringForEvent:window:keysym:] autorelease the string, so it gets freed late on. 2002-11-21 Adam Fedor * Version: 0.8.3 * Source/gsc/GSStreamContext.m (-GSSendBezierPath:): Add back and implement. * Source/x11/XGServerEvent.m ([XGServer -receivedEvent:type:extra:forMode:] (ClientMessage:TAKE_FOCUS)): minor correction. 2002-11-21 Fred Kiefer * Source/gsc/GSGState.m Implemented [GSSendBezierPath:]. * Source/gsc/GSStreamContext.m Removed (empty) implementation of [GSSendBezierPath:]. * Source/x11/XGServer.m Added #ifdef around include of XGOpenGL.h. 2002-11-16 Adam Fedor * Source/x11/XGGLContext.m (-initWithFormat:shareContext:): Remove assert. * Source/x11/XGServerWindow.m ([XGServer -setinputstate::]): Return if window is NULL. 2002-11-16 Gregory John Casamento * Headers/x11/XGOpenGL.h: Added define to avoid collision of parameters named "id" in some versions of the OpenGL headers with the Objective-C type "id". This was causing build of back to fail. 2002-11-15 Frederic De Jaeger * Source/x11/XGGLFormat.m, Source/x11/XGGLContext.m Headers/x11/XGOpenGL.h: New files. * Source/x11/Makefile: Updated. * configure.ac: add a test for GLX * Source/x11/XGServer.m (glContextClass, glPixelFormatClass): Implement. 2002-11-08 Adam Fedor * Source/x11/XGServerEvent.m ([XGServer -receivedEvent:type:extra:forMode:] (ClientMessage:TAKE_FOCUS)): Reassert focus and/or send FocusIn event in all cases. 2002-10-29 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -_checkWindowManager]): Make sure not to dereference possible NULL pointer. 2002-10-28 Adam Fedor * Source/gsc/GSStreamContext.m (-DPSsetalpha:): Use GSsetalpha as defined in frontend, for printers that don't support setalpha. 2002-10-27 Adam Fedor * Tools/font_cacher.m: Add @end (Reported by Caba Conti <520040438669-0001@t-online.de>). 2002-10-21 Adam Fedor * Source/x11/XIMInputServer.m ([XIMInputServer -initWithDelegate:display:name:]): Use GSEncodingFromLocale. * Source/xlib/XGFont.m ([XGFontInfo -setupAttributes]): Idem. * Source/xlib/XftFontInfo.m ([XftFontInfo -setupAttributes]): Idem. 2002-10-19 Adam Fedor * Source/x11/XGServerEvent.m ([XGServer -receivedEvent:type:extra:forMode:] (ClientMessage:TAKE_FOCUS)): Don't set desiredFocusWindow to 0. ([XGServer -receivedEvent:type:extra:forMode:] (FocusOut): Hack: if focus went nowhere, don't deactivate app. 2002-10-18 Adam Fedor * Source/x11/XGServerEvent.m ([XGServer -receivedEvent:type:extra:forMode:] (ClientMessage:TAKE_FOCUS)): Only send event if we don't have a key window. 2002-10-15 01:37 Alexander Malmberg * Tools/GNUmakefile: Use BUILD_SERVER to decide whether to build X specific parts of gpbs or not. 2002-10-13 Adam Fedor * Version: 0.8.2. * Documentation/news.texi: Update. Fri Oct 11 00:47:04 2002 Nicola Pero * Source/xlib/XGFont.m ([XGFontInfo -setupAttributes]): Return NO if the font can't be loaded. (Patch by Georg Fleischmann ). 2002-10-10 Adam Fedor * GNUmakefile.postamble: Only install back.make if building as a library. 2002-10-10 Fred Kiefer * Source/xlib/XGGState.m DPSsetdash::: now accepts an empty dash pattern, signaling a reset to a solid line. 2002-10-08 Adam Fedor * Update for front-end passing colorspaces and fonts in overridable way. * Headers/gsc/GSGStateOps.h: Update changed methods. * Source/art/ARTContext.m: Font ivar is now a GSFontInfo class, so use 'font' instead of '[font fontInfo]'. * Source/gsc/GSContext.m (-GSSetFont): Idem. (-GSSetFillColorspace:): Implement. (-GSSetStrokeColorspace:): Idem. (-GSSetFillColor:): Idem. (-GSSetStrokeColor:): Idem. * Source/gsc/GSGState.m: Update font ivar handling. * Source/gsc/GSStreamContext.m: Idem. * Source/winlib/WIN32GState.m: Idem. * Source/xlib/XGGState.m: Idem. * Window focus fixes * Source/x11/XGServerEvent.m ([XGServer -receivedEvent:type:extra:forMode:](ClientMessage/TAKE_FOCUS)): Use given window as focus window, not one under mouse. * Source/x11/XGServerWindow.m ([XGServer -setinputfocus:]): Don't reset focus if we already requested it on this window. 2002-09-28 22:04 Alexander Malmberg * Source/art/ftfont.m: Add .font package handling again. 2002-09-28 17:30 Alexander Malmberg * Source/art/ftfont.m (load_font_configuration): Handle the 'Family' key. 2002-09-26 16:08 Alexander Malmberg * Source/art/ftfont.m: Implement handling of the 'ScreenFonts' key in .nfont packages. 2002-09-25 22:39 Alexander Malmberg * Source/art/ftfont.m: Rework font configuration code to handle the updated (and rather different) .nfont package format. 2002-09-24 14:38 Alexander Malmberg * Source/art/ftfont.m: Use GSFontAntiAlias defaults value to decide whether antialiasing should be enabled in the default rendering hints. 2002-09-24 13:22 Alexander Malmberg * Source/x11/XWindowBuffer.m (+windowBufferForWindow:depthInfo:): Detect and handle errors properly. Only use shared memory for reasonably large windows. (-needsAlpha): Make data isn't NULL before trying to do anything. 2002-09-23 19:30 Alexander Malmberg * Source/art/ftfont.m (-initWithFontName:matrix:): Retain familyName correctly. 2002-09-21 12:14 Alexander Malmberg * Headers/x11/XWindowBuffer.h, Source/x11/XWindowBuffer.m (+windowBufferForWindow:depthInfo:): If possible, create a shared pixmap from the image data and set it as the background of the window. 2002-09-20 18:36 Alexander Malmberg * Source/art/path.m (clip_svp_callback): Use correct x coordinate for final span. (-_clip_add_svp:): Place the last entry at the correct place in clip_index. 2002-09-20 18:05 Alexander Malmberg * Source/art/path.m (clip_svp_callback, -_clip_add_svp:): Update the clipping bounding box. 2002-09-19 Adam Fedor * Source/win32/WIN32Server.m ([WIN -setbackgroundcolor::]): New. * Source/x11/XGServerWindow.m ([XGServer -_createBuffer:]): Remove setting background pixmap. ([XGServer -setbackgroundcolor::]): New * Source/xlib/XGGState.m (-_compositeGState:sourcefromRect:fromRecttoPoint:toPointop:opfraction): Convert destination point not rect. (-DPSimage:matrix:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:bitsPerPixel:bytesPerRow:isPlanar:hasAlpha:colorSpaceName:data): Remove flipping. 2002-09-19 00:33 Alexander Malmberg * Header/x11/XGInputServer.h, Source/x11/XIMInputServer.m: Track all created XIC:s and destroy them explicitly. 2002-09-18 19:59 Alexander Malmberg * Source/art/blit.h, Source/art/blit.m, Source/art/composite.m: Implement -dissolveGState:fromRect:toPoint:delta:. 2002-09-18 00:36 Alexander Malmberg * Source/art/image.m (-DPSimage:::::::::::): Treat input as pre-multiplied in the common case to (really) match xlib/. 2002-09-16 16:43 Alexander Malmberg * Source/art/ftfont.m (add_face): Change default rendering hints. 2002-09-16 16:36 Alexander Malmberg * Source/art/ARTGState.h, Source/art/ARTContext.m, Source/art/image.m, Source/art/composite.m, Source/art/path.m: Handle NSBackingStoreNonretained. 2002-09-14 13:39 Alexander Malmberg * Source/art/ftfont.m: Keep track of the family name in FTFaceInfo so FTFontInfo can set it correctly. 2002-09-14 13:03 Alexander Malmberg * Source/art/ftfont.m: Add support for some simple rendering hints in .nfont packages. 2002-09-12 02:29 Alexander Malmberg * Source/art/image.m (_image_get_color_rgb_8, _image_get_color_rgb_cmyk_gray): Fix clamping of y. 2002-09-10 22:11 Alexander Malmberg * Headers/x11/XWindowBuffer.h: Add more documentation. 2002-09-10 21:36 Alexander Malmberg * Source/art/ARTWindowBuffer.h, Source/art/ARTWindowBuffer.m, Source/x11/XWindowBuffer.m, Headers/x11/XWindowBuffer.h: Rename ARTWindowBuffer to XWindowBuffer and move it to x11/ so other backends can use it. Update many files in Source/art/. 2002-09-10 17:35 Alexander Malmberg * Source/art/composite.m: Implement handling of tranformations and clipping. 2002-09-08 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -_XWinFrameToOSWinFrame:for:]): New. ([XGServer -_addExposedRectangle::]): Convert rect to OS coords. ([XGServer -_processExposedRectangles:]): Invalidate exposed rects in view. (patch from Frederic De Jaeger). 2002-09-06 Adam Fedor * Source/gsc/GSContext.m (-initWithContextInfo:): Fix for GSStreamContext subclass. * Source/GSStreamGState.m: New file. * Source/GSStreamContext.m: Make a subclass of GSContext. Call superclass implementation where appropriate. * Source/GSStreamContext.m: Fix for 'show'ing parenthesis characters (patch from Stefan Urbanek). 2002-09-01 Adam Fedor * Version: 0.8.1 2002-09-01 12:58 Alexander Malmberg * Source/art/ARTContext.m ([ARTGState -GSCurrentDevice:::]): Check for NULL pointers before setting values. 2002-08-31 19:54 Alexander Malmberg * Source/art/path.m (DPSrectfill::::): Calculate alpha pointer correctly when clipped. * Source/art/composite.m (-compositeGState:fromRect:toPoint:op:): Fix detection of horizontal-only overlap (order==2), and handling it in the general case. * Source/blit.m: Whitespace cleanups. 2002-08-31 15:52 Alexander Malmberg * Source/art/image.m: Implement clipping of images using the clipping spans. 2002-08-31 14:40 Alexander Malmberg * Source/art/ARTContext.m, Source/art/ARTGState.h, Source/art/path.m: Store clipping path as a set of spans instead of as an svp. Build spans from DPSclip and DPSeoclip, and use it when clipping (only implemented for paths, so far). 2002-08-30 15:42 Alexander Malmberg * Source/art/blit.h, Source/art/blit.m, Source/art/path.m: Move svp rendering code to path.m. 2002-08-30 01:29 Alexander Malmberg * Source/art/GNUmakefile, Source/art/ARTContext.m, Source/art/path.m: Move remaining path handling code to path.m. Reformat. 2002-08-30 00:33 Alexander Malmberg * Headers/gsc/GSGStateOps.h, Source/art/ARTContext.m: Remove ARTGState's own path handling and have it use GSGState's again. 2002-08-28 Fred Kiefer * Source/gsc/GSGState.m New method [currentPoint], gets used in [DPScurrentpoint::]. Corrected [DPSarc:::::] and [DPSarcn:::::] to draw the arc in user space and transfrom it afterwards and implemented [DPSarct:::::]. 2002-08-28 18:55 Alexander Malmberg * Source/x11/XGBitmapImageRep.m, Source/xlib/XGBitmapImageRep.m, Source/x11/GNUmakefile, Source/xlib/GNUmakefile: Move XGBitmapImageRep.m from xlib/ to x11/. * Source/art/ARTContext.m: Remove the copy of the XGBitmapImageRep code. * Source/art/blit.m: Add missing include of NSDebug.h. 2002-08-28 16:01 Alexander Malmberg * Source/art/blit.m (artcontext_setup_draw_info): Change NSLog to NSDebugLLog. 2002-08-28 13:29 Alexander Malmberg * Source/art/ftfont.m: Make the filters used in subpixel rendering configurable. 2002-08-28 00:34 Alexander Malmberg * Source/art/blit.m: Do basic gamma correction when rendering text. 2002-08-27 12:10 Alexander Malmberg * Source/art/: Fix copyright notices. 2002-08-27 11:58 Alexander Malmberg * Source/art/ftfont.m: Add experimental subpixel text renderer. * Source/art/blit.h, Source/art/blit.m: Add render_blit_subpixel function, used in subpixel rendering. 2002-08-27 10:23 Alexander Malmberg * Source/art/ARTContext.m, Source/art/composite.m, Source/art/GNUmakefile: Move compositing code to its own file. Reformat. (-_composite_func::::::): Handle the plusl_oo case correctly. (-compositerect:op:): Handle inline alpha in the general case. 2002-08-26 16:36 Alexander Malmberg * Source/art/image.m: Assume that input isn't premultiplied in all cases (to match -xlib behavior, for now). Reformat to fit coding standards better. 2002-08-26 15:59 Alexander Malmberg * Headers/art/ARTContext.h, Source/art/ARTContext.m, Source/art/ARTWindowBuffer.m, Source/art/GNUmakefile, Source/art/blit.h, Source/art/ARTGState.h, Source/art/image.m: Move image handling (-DPSimage...) to its own file. Add handling of arbitrary transformations, arbitrary bits/samples, bits/pixel, etc., planar data, and gray and cmyk colorspaces. 2002-08-26 01:09 Alexander Malmberg * Source/art/blit.m: Reformat to fit coding standards better. 2002-08-26 00:33 Alexander Malmberg * Source/art/ARTContext.m (-DPSimage:::::::::::): Assume input is pre-multiplied. 2002-08-25 21:41 Alexander Malmberg * Source/art/ARTContext.m (-_composite_func::::::): Implement special optimized handling of transparent source. 2002-08-25 20:48 Alexander Malmberg * Headers/gsc/GSGState.h, Headers/gsc/gscolors.h, Source/art/ARTContext.m, Source/gsc/GSGState.m, Source/gsc/gscolors.c, Source/winlib/WIN32GState.m, Source/xlib/XGGState.m: Optimize color handling by passing around pointers to device_color_t structures (instead of the structures themselves). 2002-08-23 01:54 Alexander Malmberg * Source/art/ARTWindowBuffer.m (+artWindowBufferForWindow:): Mark the segment for destruction after X has attached to it. 2002-08-23 01:44 Alexander Malmberg * Source/art/ARTContext.m: Implement handling of non-rectangle clipping paths. Use it when rendering paths (but not for other operators yet). 2002-08-22 02:34 Alexander Malmberg * Source/art/ARTContext.m: (-DPSrectclip::::): Fix rounding when converting to pixel coordinates. 2002-08-21 20:27 Alexander Malmberg * Source/art/ARTContext.m, Source/art/ARTWindowBuffer.h, Source/art/ARTWindowBuffer.m, Source/art/GNUmakefile: Renamed the WinImage class to ARTWindowBuffer and moved it to its own file. 2002-08-21 14:52 Alexander Malmberg * Source/art/blit.h, Source/art/blit.m, Source/art/ftfont.h, Source/art/ftfont.m: Reformat to fit coding standards better. 2002-08-21 13:50 Alexander Malmberg * Source/art/ARTContext.m: Move common code from _fill and DPSstroke to convert the current path to an ArtVpath to a new method. Update callers. (-compositerect:op:): Create alpha buffer for NSCompositeCopy if the current color isn't completely opaque. 2002-08-21 Alexander Malmberg * Source/art/ARTContext.m: ([WinImage -_exposeRect:]) Guard against invalid coordinates to (hopefully) fix the problem with windows turning all white and BadValue warnings appearing. 2002-08-20 Alexander Malmberg * Headers/art/, Source/art/: Add back-art, a backend based on libart and freetype. 2002-08-15 Adam Fedor * configure.ac: Add NetBSD header/ldflag support (Patch from Peter Cooper). Cleanup freebsd support. 2002-08-06 Adam Fedor * Source/x11/XGServerEvent.m ([XGServer -receivedEvent:type:extra:forMode:]): Add special gotShmCompletion call for libart backend. 2002-08-02 Adam Fedor * Merge from 0.8.0 into main branch. 2002-08-01 Adam Fedor * Version: 0.8.0 * configure.ac: Check for usleep. * Source/x11/XGServerWindow.m ([XGServer -windowdevice:]): Use alternate if no usleep. 2002-07-28 Adam Fedor * Source/xlib/XGBitmap.m (_pixmap_combine_alpha): Use interger arithmatic. (Patch from Jeff Teunissen) 2002-07-19 Adam Fedor * Source/xlib/XGGeometry.m (clipXRectsForCopying): Shift rect origin to account for clipping. * Source/xlib/XGGState.m (-setAlphaColor:): Correct colorspace of alpha color. 2002-07-17 Adam Fedor * Version: 0.7.9 2002-07-14 Adam Fedor * Source/x11/XIMInputServer.m (-ximCreateIC:): Don't set FocusWindow attrib. Causes a segfault at XCloseDisplay.. 2002-07-13 Adam Fedor * Source/xlib/XGBitmap.m (_pixmap_combine_alpha): Fix and cleanup alpha blending (Rescale by alpha) (_bitmap_combine_alpha): Idem. (Patch from Jeff Teunissen). 2002-06-28 Adam Fedor * Source/xlib/XGFont.m ([XGFontInfo -xCharStructForGlyph:glyph]): Fix variable typo - using wrong index to glyph (patch from stoyan@hologr.com). 2002-06-24 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -windowdevice:]): Use usleep instead of loop to wait for resize (rewritten patch from georg@vhf.de). Sat Jun 22 14:28:28 2002 Nicola Pero * Source/gsc/GSGState.m ([-DPScurrentpoint::]): Use -invert, not -inverse, to invert an affine transform. Sat Jun 22 14:24:20 2002 Nicola Pero * Source/gsc/GSContext.m ([-NSDrawBitmap:rect:pixelsWide:pixelsHigh: bitsPerSample:samplesPerPixel:bitsPerPixel:bytesPerRow: isPlanar:hasAlpha:colorSpaceName:data]): Use scaleXBy:yBy: rather than scaleBy::. * Source/gsc/GSGState.m ([-DPSscale::]): Idem. 2002-06-20 Adam Fedor * Source/x11/XGServer.m (_parse_display_name): New. ([XGServer -_initXContext]): Use it. 2002-06-15 Alexander Malmberg * configure.ac, configure: Use libart2-config and freetype-config to get libs and cflags for libart and freetype. Updated configure. * Source/gsc/GSGState.m (-DPSinitgraphics): Set alpha _before_ calling -setColor:state:. 2002-06-10 Adam Fedor * Version 0.7.8 2002-06-09 Adam Fedor * configure.ac: Set WIN32 and WINLIB only on mingw32 systems. 2002-06-08 Fred Kiefer * Headers/winlib/WIN32FontInfo.h Added ivar for font handle. * Source/winlib/WIN32FontInfo.m Implemented most of the code to support different fonts. 2002-06-08 Fred Kiefer * Source/gsc/GSGState.m Coorected [DPSrectfill::::], [DPSrectstroke::::] and [DPSrectclip::::] not to change the path. * Source/winlib/WIN32GState.m [DPSrectstroke::::] same correction. 2002-06-04 Fred Kiefer * Source/gsc/GSGState.m Added default implementation for [DPSrectfill::::], [DPSrectstroke::::] and [DPSrectclip::::]. * Header/winlib/WIN32GState.h Added ivar to store old clip region. * Source/winlib/WIN32GState.m [_paintPath:], [DPSrectclip::::], [DPSinitclip], [setStyle:] and [restoreStyle:]: Rewrote the whole clipping code. Added [deepen] and [dealloc] for consistency. Simplified [DPSrectstroke::::]. 2002-06-03 Adam Fedor * Source/win32/WIN32Server.m (-beep): Implement * Source/winlib/WIN32Context.m (-NSBeep): Remove. * Source/x11/XGServer.m (-beep): Implement. * Source/xlib/XGContext.m (-NSBeep): Remove. 2002-06-02 Fred Kiefer * Source/win32/WIN32Server.m Treat NSBackingStoreRetained the same as NSBackingStoreBuffered, just as the X backends do. * Source/winlib/WIN32GState.m Reimplemented creation of bitmaps. This should now work for all bitmaps with >16 bits per pixel. The bitmaps that are still missing are due to clipping problems, as can be seen by switching clipping off. 2002-05-12 Adam Fedor * Source/gsc/GSGState.m (-DPSsetalpha:): Call setColor:state:. Clamp value to 0 * Source/Source/xlib/XGFont.m: ([-xCharStructForGlyph:]) use newer GSGFromUnicode() API. 2002-05-09 Adam Fedor * Headers/gsc/GSGState.h: Add color and text ivars. * Headers/winlib/WIN32GState.h: Idem. * Headers/xlib/XGGState.h: Idem. * Source/gsc/GSContext.m: Implement font/text methods. * Source/gsc/GSGState.m (-setColor:state:) Implement Implement color DPS and GS ops to use it. Implement text/font ops. * Source/winlib/WIN32GState.m (-setColor:state:) Implement. Remove color ops (now in GSGState) * Source/xlib/XGGState.m (-setColor:state:) Implement. (-setAlphaColor:) New. Remove color ops (now in GSGState) 2002-05-07 Adam Fedor * Source/gsc/GSStreamContext.m (-GSSetFont:): Don't flip the font for a flipped view. 2002-05-06 Adam Fedor * configure.ac (BUILD_SERVER): Set to predefined define * Source/GSBackend.m: Use it. 2002-05-05 Adam Fedor * configure.ac: Simplify backend selection using --enable-server and --enable-graphics. Add --with-library-flags and --with-include-flags for adding additonal flags. Revert last change to XShm.h test. Add check for art libraries. * Source/GNUmakefile: Conform to new configure output * Source/GSBackend.m: Idem. * Headers/x11/wraster.h: Idem. * Source/x11/XIMInputServer.m: Correct define for HAVE_UTF8 * GNUmakefile.postamble (after-distclean): Remove config.h * Source/gsc/GSContext.m (-dealloc): Destroy gstate. * Source/x11/XGServerWindow.m([XGServer -_addExposedRectangle::]): Use current context class ([XGServer -flushwindowrect::]): Idem. (patches from alexander@malmberg.org). 2002-05-04 Adam Fedor * configure.ac: Improved check for XShm.h * Headers/x11/wraster.h: Use HAVE_X11_EXTENSIONS_XSHM_H * Source/x11/XIMInputServer.m: Fix #if for USE_XIM (patch from alexander@malmberg.org) * Source/xlib/XGContext.m: Idem for HAVE_XFT 2002-05-03 Adam Fedor * GNUmakefile.postamble: Remove '/' in $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES) so Windows won't complain. 2002-05-02 Adam Fedor * configure.ac: Updated to autoconf 2.53 from configure.in * configure, config.h.in: Regenerate. * acconfig.h: Remove 2002-05-01 Adam Fedor * config.make.in: Add newline at end - causes Solaris sed to barf. 2002-04-30 Adam Fedor * Version: 0.7.7 * Documentation/news.texi: Update * NEWS: Regenerate. 2002-04-27 Ludovic Marcotte * Source/xlib/XGFontManager.m: Added a RETAIN call to the allFontNames ivar in -enumerateFontsAndFamilies since we would reference a dealloc'ed object after this method call. 2002-04-27 Fred Kiefer * Headers/win32/WIN32Server.h * Headers/winlib/WIN32GState.h * Source/win32/WIN32Server.m * Source/winlib/WIN32GState.m Made sure only resources allocated by our code will ever be freed. 2002-04-26 Adam Fedor * acconfig.h: Define HAVE_UTF8 * config.h.in: Regen. 2002-04-24 Adam Fedor * configure.in: Don't enable wraster support if --with-wraster=none. Print error if no backend server or graphics configured. 2002-04-23 Adam Fedor * Headers/x11/XGServer.h: Rework to handle multiple screens. * Headers/xlib/XGContext.h: Simplify. * Source/win32/WIN32Server.m (-mouseLocationOnScreen:window:): Implement. * Source/x11/XGServer.m: Rework to handle multiple screens. New XScreenContext class. (-initXContext): Use it. (-_screenContextForScreen:): Implement. (-xrContextForScreen:): Idem. (-drawMechanismForScreen:): Idem. (-xDisplayRootWindowForScreen:): Idem. (-xColorFromColor:forScreen:): Idem. * Source/x11/XGServerEvent.m (-mouseLocationOnScreen:window:): Implement. * Source/x11/XGServerWindow.m (-window::::): Use screen arg. (_blankCursor): Use default screen for drawable (?). (imagecursor::::::): Idem. * Source/xlib/XGBitmapImageRep.m: Update for new server interface. * Source/xlib/XGGState.m: Idem. 2002-04-22 Georg Fleischmann * back/Source/xlib/XGGState.m [XGGState DPSsetlinewidth:]: scale line width. 2002-04-23 Fred Kiefer * Source/win32/WIN32Server.m [window::::] corrected and simplified the last change. 2002-04-22 Adam Fedor * configure.in: Check for gdi32. * Source/win32/WIN32Server.m (window::::): Update for new interface - frame is frame rect, not content rect. * Source/x11/XGServer.m (-_initXContext): Look for display attributes in server_info. * Source/x11/XGServerWindow.m (-window::::): Update for new interface. 2002-04-21 Fred Kiefer * Headers/win32 * Headers/win32/WIN32Server.h * Headers/win32/WIN32Geometry.h * Source/win32 * Source/win32/GNUmakefile * Source/win32/GNUmakefile.preamble * Source/win32/WIN32Server.m New directories and files with Display Server for MS Windows. * Headers/winlib * Headers/winlib/WIN32Context.h * Headers/winlib/WIN32GState.h * Headers/winlib/WIN32FontEnumerator.h * Headers/winlib/WIN32FontInfo.h * Source/winlib * Source/winlib/GNUmakefile * Source/winlib/GNUmakefile.preamble * Source/winlib/WIN32Context.m * Source/winlib/WIN32GState.m * Source/winlib/WIN32FontEnumerator.m * Source/winlib/WIN32FontInfo.m New directories and files for drawing on MS Windows. * configure Add library gdi32 for winlib back end. * Source/GSBackend.m Corrected to handle the winlib/win32 backend correctly. * Tools/gpbs.m Ifdefed some signals that are not defined in mingw and use spawn instead of fork on mingw. 2002-04-19 Richard Frith-Macdonald * Tools/gpbs.m: If given -NSHost specification for the current host, ignore it and use the standard name. 2002-04-15 Gregory John Casamento * configure.in: Added check to determine if libXft contains XftDrawStringUtf8 which is used to draw unicode strings. 2002-04-15 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -_addExposedRectangle::]): Use current server class ([XGServer -flushwindowrect::]): Idem. (Suggestion by alexander@malmberg.org) * Source/x11/XIMInputServer.m (-initWithDelegate:display:name:): Use defaultCStringEncoding if UTF8 doesn't work. (Patch from stoyan@on.com.ua). 2002-04-14 Adam Fedor * Headers/x11/XGServerWindow.h: Add graphics driver protocol information. * Source/x11/XGServerWindow.m (_createBuffer:): Use it. (-termwindow:): Idem. ([XGServer -windowbacking::win]): Idem. ([XGServer -windowdevice:]): Idem. ([XGServer -_addExposedRectangle::]): Idem. ([XGServer -flushwindowrect::]): Idem. * Source/xlib/XGBitmapImageRep.m: Use new GSCurrentDevice. * Source/xlib/XGContext.m: Idem. * Headers/xlib/XGGState.h: Use window device, not window number. * Source/xlib/XGGState.m: Idem. Thu Apr 11 22:24:01 2002 Nicola Pero * Source/x11/XGServerEvent.m: Added missing includes. * Source/x11/XGServerWindow.m: Idem. * Source/x11/XGDragView.m: Idem. 2 2002-04-11 Richard Frith-Macdonald * Tools/gpbs.m: Fixed bug in argument parsing ... was objecting to -NSHost! 2002-04-10 Adam Fedor * configure.in: Don't set X paths if no X found. Only set /usr/local paths for freebsd * Source/gsc/GSContext.m: Remove currentgstate, gstate * Source/x11/XGServerWindow.m (windowbacking:) Implement. 2002-04-06 Adam Fedor * configure.in: Renable XIM by default again. * Source/gsc/GSStreamContext.m (GSSetFont:): Implement. Fix up show methods and fix spaces in method names. * Source/xlib/XGContext.m (-initWithContextInfo:): Return alternate (PS) context when indicated. * Source/xlib/xrtools.c: Simplify color conversion routines. * Source/xlib/XGGState.m: Use them 2002-04-03 Adam Fedor * Source/GNUmakefile.preamble: Fix LIB_DIRS and LIBRARIES_DEPEND_UPON for compiling as a library. 2002-04-02 Adam Fedor * Source/gsc/GSContext.m (-GSDefineGState): Use new def - also creates a copy of the gstate. (-GSReplaceGState): Replace with copy of current gstate. * configure.in (--with-name): Configure the name of the backend * back.make.in: Idem. * config.make.in: Idem. * Source/GNUmakefile: Idem. * Documentation/install.texi: Document. * Source/GNUmakefile.preamble: Missing include. * Source/x11/XGServerWindow.m: Fix slideImage method name. 2002-04-01 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -_setupRootWindow]): Read GSAppOwnsMiniwindow default. ([XGServer -appOwnsMiniwindow]): Use it. ([XGServer -miniwindow:): Idem. * Source/gsc/GSContext.m (-GSSendBezierPath:): Implement (-GSRectClipList::): Likewise. (-GSRectFillList::): Likewise. (-GSCurrentCTM): Likewise. (-GSSetCTM:): Likewise. (-GSConcatCTM:): Likewise. * Source/xlib/XGGState.m ([XGGState -DPSsetmiterlimit:]): Implement to do nothing. * Source/x11/GNUmakefile: Remove unsed draw.c, gradient.c, misc.c 2002-03-31 Fred Kiefer * Source/x11/XGServerWindow.m In [window:::] set the initial hints for a window, as setWindowHintsForStyle() would otherwise never be called. 2002-03-30 Adam Fedor * Source/GNUmakefile.preamble: Add graphic includes, -Wall * Source/gsc/GNUmakefile.preamble: Likewise. * Source/x11/GNUmakefile.preamble: Likewise. * Source/xlib/GNUmakefile.preamble: Likewise. * Tools/font_cacher.m: Fix include. 2002-03-29 Adam Fedor * Source/gsc/GSGState.m (-GSSendBezierPath:): Append path in all cases. (- GSRectFillList): Implement. * Source/x11/XGServerWindow.m: ([XGServer -windowbounds:]): Don't get screen bounds. * Source/x11/*.c: Fix includes. 2002-03-27 Adam Fedor * Source/x11/GNUmakefile: Get headers from right place. * Source/xlib/GNUmakefile: Remove invalid header. * Source/x11/XGServerWindow.m (-window:::): Change method to match frontend (including setting of style). 2002-03-27 Adam Fedor * Version: Initial version (most code extracted from xgps). gnustep-back-0.29.0/Documentation/000077500000000000000000000000001404163720200167755ustar00rootroot00000000000000gnustep-back-0.29.0/Documentation/Back/000077500000000000000000000000001404163720200176355ustar00rootroot00000000000000gnustep-back-0.29.0/Documentation/Back/Back.gsdoc000066400000000000000000000014401404163720200215150ustar00rootroot00000000000000 Back $Revision$ $Date$ 2005 Free Software Foundation, Inc. Back

Documentation for understanding and writting GUI backends.

Window Focus User Default Options
gnustep-back-0.29.0/Documentation/Back/DefaultsSummary.gsdoc000066400000000000000000000232171404163720200240100ustar00rootroot00000000000000 User Defaults Summary for GNUstep Backend $Revision$ $Date$ 2005 Free Software Foundation, Inc. Defaults Summary

This document contains a summary of available user default values that one can set to control the operation of the GNUstep backend.

Backend Defaults

Below is a list of defaults used to control the x11-based backend. These defaults generally control system specific display and user interaction options which may not be available on all systems.

NSDefaultVisual

An integer that specifies the X-Windows visual class to use in the application. For instance one could display the application using the PsuedoColor visual class by setting the value to the id of this class. The default is the X-Windows default visual class.

NSColorsPerChannel

An integer which limits the maximum number of colors to display, per channel. For a psuedo-color display, this would limit the total number of colors that the application could use (normally 256). For a true-color display, this would limit the range of red, green, and blue values that could be used.

GSAppOwnsMiniwindow

GSAppOwnsMiniwindow is for miniwindows (not app icons). If it's YES or absent, GNUstep handles miniaturization itself and doesn't let the window manager do it. If it's NO, the window manager is allowed to do its own iconification. This does not affect app icons at all.

GSFontAntiAlias

With the xlib backend, this is a boolean value which defaults to YES. If set to YES and X Windows system has the XFT extension, then the application will use anti-aliased fonts as provided by XFT. If set to NO anti-aliased fonts will not be used even when available.

With the art backend, A boolean value which defaults to YES. If YES, text is anti-aliased at small sizes (9-16 pixels). The value is advisory (specific fonts can override this setting).

GSFontMask

[Xlib backend only] A string value which defaults to "*". It defines the pattern used to get the installed fonts from the X-Server. A value of "*-iso8859-1" would only include fonts available with ISO Western encoding. This feature might be helpfull if the font_cacher program is having problem with the X-Server.

GSBackHandlesWindowDecorations

A boolean value, which indicates if the backend should let the window-manager/native-window-system handle window decorations. When set to NO, GNUstep-GUI will handle the window decorations, which is particularly useful if you aren't running any window manager.

GSUseWMTaskBar

[W32 backend only] A string value which defaults to YES. If enabled, the backend assumes that miniwindows are displayed in a task bar. In this case, the app icon is not shown and the main menu behavior is changed so it is not ordered out, but minimized, so clicking on the minimized menu will activate the application.

GSXEnableFontSet

A string value which defaults to NO. If set to YES, then the backend font classes will support full multi-byte/unicode characters. This is useful for using many East Asian languages. However, the respose of the GUI is somwhat slower when this is enabled.

GSXIMInputMethodStyle

A string value used to specify the XIM input method for entering characters. Valid values are RootWindow, OffTheSpot, or OverTheSpot.

GraphicCompositing

[Xlib backend only] A boolean value which defaults to YES. If set to YES, then the application uses various tricks to get alpha colors to work when compositing images. This may slow down drawing of images, but it is generally recommended anyway, particularly on fast systems.

Fast Drawing on 8-bit Displays

[X11-based backends only] This is not a user default, but if you are using an 8-bit display and you define the standard X11 BEST colormap (via xstdcmap -best), then GNUstep will use this colormap and enable faster drawing onto 8-bit displays.

Keyboard Modifiers

The OPENstep specification requires three main different keyboard modifiers: CONTROL, COMMAND and ALTERNATE as well as the HELP modifier for context help. Some systems may not have these set up correctly. You can changed the defaults with the default keys.

GSFirstControlKey GSSecondControlKey GSFirstCommandKey GSSecondCommandKey GSFirstAlternateKey GSSecondAlternateKey GSFirstHelpKey GSSecondHelpKey

Default values are respectively:

Control_L Control_R Alt_L NoSymbol Alt_R NoSymbol Help Super_L

These strings correspond to "keysyms" on X11 systems. On X11, physical keys on the keyboard are equivalent to keycodes. A single keysym may be associated to more than one keycode, and can even be associated to a shifted key.

This is described more completely in the GUI documentation on keyboard setup.

GSModifiersAreNotKeys

On some keyboards, the default X11 mapping includes keycodes that are mapped to one or another modifier keysym depending on whether 'shift' (or in some cases, another key) is pressed. This is the case on some Apple USB keyboards for example: one key to the left of the spacebar maps to "Option" without shift pressed, and "Alt" with shift pressed. Such keyboard mappings are often useful in non-English contexts to access accents or non-Roman characters. However if such a key is used as a modifier in GNUstep problems can occur when trying to use the modifier in conjunction with a shifted character. In particular, you will need to hit and release the modifier and the shift key in a particular order, or else things will not work as expected, and the modifier may become "stuck".

Previously this default was called GSModifiersAreKeys, and Shift+Alt key equivalents only worked if Shift and Alt were pressed in the right order, unless the default was set to YES. That is now the default; to get back the previous default behaviour, set GSModifiersAreNotKeys to YES.

UseWindowMakerIcons

UseWindowMakerIcons is for app icons, and has no effect when the window manager isn't Window Maker. It displays the application's icon window in the window Window Maker provides instead of creating one controlled by the app. This allows the icon to be docked. It is a boolean value which defaults to YES.

XGPS-Shm

A boolean value which defaults to YES (as long as shared memory is available). If set to NO, shared memory is not used for various display specific operations.

GSOldClipboard

[X backends only] A boolean value which defaults to NO. If set to YES the old GNUstep way of X clipboard interaction will be used. That is PRIMARY as the general pasteboard and CLIPBOARD for the selection. Whereas the new X standard is the other way around. This setting may be needed for interaction in an old X enviornment.

gnustep-back-0.29.0/Documentation/Back/GNUmakefile000066400000000000000000000026001404163720200217050ustar00rootroot00000000000000# # Gui gsdoc makefile for the GNUstep Back Library # Copyright (C) 2000 Free Software Foundation, Inc. # # Written by: Adam Fedor # # This file is part of the GNUstep Back Library. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back include $(GNUSTEP_MAKEFILES)/common.make # The documents to be generated DOCUMENT_NAME = General General_AGSDOC_FILES = \ Back.gsdoc \ DefaultsSummary.gsdoc \ WindowFocus.gsdoc General_AGSDOC_FLAGS = \ -Up Back General_DOC_INSTALL_DIR = Developer/Back -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/documentation.make -include GNUmakefile.postamble gnustep-back-0.29.0/Documentation/Back/Standards.txt000066400000000000000000000101721404163720200223220ustar00rootroot00000000000000 EWMH hints ================================== [ ] : not implemented [*] : partially implemented [+] : supported [-] : not applicable/ignored Root Window Properties (and Related Messages) [+] _NET_SUPPORTED // WM property [-] _NET_CLIENT_LIST // WM property [+] _NET_CLIENT_LIST_STACKING // WM property [+] _NET_NUMBER_OF_DESKTOPS // WM property [ ] _NET_DESKTOP_GEOMETRY // use this in preference to X calls? [-] _NET_DESKTOP_VIEWPORT // WM property [+] _NET_CURRENT_DESKTOP // WM property [+] _NET_DESKTOP_NAMES // WM property [ ] _NET_ACTIVE_WINDOW // "main" window? [-] _NET_WORKAREA // WM property [+] _NET_SUPPORTING_WM_CHECK // WM property [-] _NET_VIRTUAL_ROOTS // WM property [-] _NET_DESKTOP_LAYOUT // Pager property [-] _NET_SHOWING_DESKTOP // WM property Other Root Window Messages [-] _NET_CLOSE_WINDOW // Pager property [-] _NET_MOVERESIZE_WINDOW // Pager property [ ] _NET_WM_MOVERESIZE // use with in-view mouse control? Application Window Properties [+] _NET_WM_NAME // need to implement [ ] _NET_WM_VISIBLE_NAME // WM property [+] _NET_WM_ICON_NAME // need to implement [-] _NET_WM_VISIBLE_ICON_NAME // WM property [+] _NET_WM_DESKTOP // [+] _NET_WM_WINDOW_TYPE // use with or replace Window Level? [*] _NET_WM_STATE // probably don't need this. [-] _NET_WM_ALLOWED_ACTIONS // WM property [-] _NET_WM_STRUT // GNUstep apps don't need this(?) [-] _NET_WM_STRUT_PARTIAL // GNUstep apps don't need this(?) [-] _NET_WM_ICON_GEOMETRY // GNUstep apps don't need this(?) [+] _NET_WM_ICON // [+] _NET_WM_PID [-] _NET_WM_HANDLED_ICONS // Pager property [ ] _NET_WM_USER_TIME // need to figure this out... [+] _NET_FRAME_EXTENTS // [+] _NET_REQUEST_FRAME_EXTENTS // [+] _NET_WM_STATE_SKIP_PAGER // [+] _NET_WM__WINDOW_OPACITY // [+] _NET_WM__WINDOW_SHADOW // Window Manager Protocols [+] _NET_WM_PING // need to implement WindowMaker Protocols and Client Messages ========================================= _GNUSTEP_WM_MINIATURIZE_WINDOW The _GNUSTEP_WM_MINIATURIZE_WINDOW protocol tells the WM that the application can handle miniaturization of a window. The WM can then send a CLientMessage of the WM_PROTOCOLS type telling the app to miniaturize the window. _GNUSTEP_TITLEBAR_STATE The app can send a ClientMessage with the _GNUSTEP_TITLEBAR_STATE message type, telling the WM which state the window is in, allowing the WM to change the appearance of the title bar appropriately. The states are: Key Window(0), Normal Window(1), Main Window(2). The main window is the window the user is currently working in. The key window is the window that has keyboard focus. _GNUSTEP_WM_ATTR Property for setting various attributes about the window. Can also be sent as a Client Message for faster handling. The structure passed in the property request is: typedef struct { CARD32 flags; CARD32 window_style; CARD32 window_level; CARD32 reserved; Pixmap miniaturize_pixmap; // pixmap for miniaturize button Pixmap close_pixmap; // pixmap for close button Pixmap miniaturize_mask; // miniaturize pixmap mask Pixmap close_mask; // close pixmap mask CARD32 extra_flags; } GNUstepWMAttributes; where flags is a set of ORed values: WindowStyle(1<<0), WindowLevel(1<<1), MiniaturizePixmap(1<<3), ClosePixmap(1<<4), MiniaturizeMask(1<<5), CloseMask(1<<6), ExtraFlags(1<<7). If ExtraFlags is set, then extra_flags can be: DocumentEditedFlag(1<<0), WindowWillResizeNotificationsFlag(1<<1), WindowWillMoveNotificationsFlag(1<<2), NoApplicationIconFlag(1<<5), WMFHideOtherApplications(10), WMFHideApplication(12) Window Style can be an ORed value consiting of any one or more of NSBorderlessWindowMask(0), NSTitledWindowMask(1), NSClosableWindowMask(2), NSMiniaturizableWindowMask(4), NSResizableWindowMask(8), NSIconWindowMask(64) NSMiniWindowMask(128). Window Level can be one of NSDesktopWindowLevel(-1000), NSNormalWindowLevel(0), NSFloatingWindowLevel(3), NSSubmenuWindowLevel(3), NSTornOffMenuWindowLevel(3), NSMainMenuWindowLevel(20), NSStatusWindowLevel(21), NSModalPanelWindowLevel(100), NSPopUpMenuWindowLevel(101), NSScreenSaverWindowLevel(1000). gnustep-back-0.29.0/Documentation/Back/WindowFocus.gsdoc000066400000000000000000000172661404163720200231410ustar00rootroot00000000000000 Window Focus Procedures $Revision$ $Date$ 2005 Free Software Foundation, Inc. Window Focus

This document describes how various events and user actions affect window focus of GNUstep applications. This document for the most part describes focus changes that occur outside of application control, since application window focus changes are well described in the class documentation.

Application Focus

The application can get focus in several ways:

Launch from the command line or another app Another app looses focus (e.g. by terminating) The user switches screens to the one the app is displayed on Double-click on the application icon

The first case does not directly affect window focus (because there are no windows at startup). However, as the application begins to create and order front windows (including the main menu) there will likely be a cascade of focus events generated by the window manager for each window ordered in.

In the second and third case, the window manager will likely try to give focus to the window that previously had it or perhaps to some random window based on some internal window manager code. GNUstep may ignore this request and try to give focus to another window, typically the application's idea of the current key window.

The last case is handled in the GUI front-end.

KeyboardFocus

The Key window is the window that has keyboard focus and has keyboard events sent to it. When an application receives focus, the window manager will typically ask one window to take keyboard focus (see above, Application Focus).

When an application is launched, in many cases, only the application icon and main menu may be displayed. In the OpenStep interface, neither of these is really supposed to be a key window, and in fact, many window managers control the application icon so this cannot be made key anyway. In X-Windows, however, there is no other way for an application to receive keyboard events unless a visible window has been made key. This leaves the main menu.

When an application receives focus, or if all the windows in an application are closed (see the private method [NSWindow-_lossOfKeyOrMainWindow]), then the main menu will request keyboard focus (see below).

The GUI front-end may function differently to accomadate different window manager behavior. Below is a list of the changes the front-end makes for different managers and windowing systems:

WindowMaker

WindowMaker controls the application icon so it cannot receive keyboard events. The main menu is made key if there is no other window capable of becoming key.

Requesting Keyboard Focus

A window may request to get keyboard focus in serveral instances. The window requests keyboard focus through the server method -setinputfocus::

If the window asks or is asked to become key, through the [NSWindow-becomeKeyWindow] method If the window is ordered front and the window is the key window. If during _lossOfKeyOrMainWindow, only the main menu is able to become key (for window systems where this is required).
Window Focus In/Out

The GUI front-end receives two types of focus events from the back-end (through an NSEvent object). Both of these are subsets of the NSAppKitDefined event: GSAppKitWindowFocusIn and GSAppKitWindowFocusOut. A FocusIn event can be received for several reasons:

The window manager deminiaturized the window. The WM should really tell the application to do this itself, but many WMs don't. In this case the window just posts a notification that it happened. The application is in the process of hidding. As each window is ordered out, the WM may send a focus message (spuriously) to the next window in line. In this case the message is just ignored. If the previous cases do not apply, the window checks if it can become key or main and activates the application if it is not active. If this window is the main menu, it looks for another window to become the key window, if possible, through the _lossOfKeyOrMainWindow mechanism

The back-end should keep track of the last window that requested to become key. This can be important in determining whether the back-end should send a FocusIn event to a window when it receives a signal from the window manager or windowing system. Sending a FocusIn event to a window that already requested it, may cause focus confusion in the GUI.

The front-end does nothing for FocusOut messages.

X-Windows messages

This section describes messages that X-Windows servers and the WM generally send to the application. Other window servers may send similar messages.

Take Focus

A message from the WM telling a window it should take keyboard focus. If the app is not active, the back-end should send a FocusIn event. Otherwise, the back-end should only send a FocusIn event to the front end if the message is due to a user action, such as a click on the title bar (i.e. the target window is not the current key window or the last window that requested key status). The back-end may also send an event if the window has just been mapped, although this is not typically necessary, unless it's due to a screen change.

In other cases, the back-end should do what is necessary to make sure that the last window to request key status receives it instead of the one the WM thinks should receive it.

Focus In

A message from the server telling the application that keyboard focus has been set for a window. The back-end should not send an event to the front-end in this case. However, the back-end should use this information to determine when to send a message in other cases (e.g. from a Take Focus message).

Focus Out

A message from the server telling the application that focus has left a window. If the focus has gone to a window that is not part of the application, the back-end should tell the NSApp to deactivate. Otherwise it should do nothing.

gnustep-back-0.29.0/Documentation/GNUmakefile000066400000000000000000000051111404163720200210450ustar00rootroot00000000000000# # Documentation makefile for the GNUstep Backend Library # Copyright (C) 1995 Free Software Foundation, Inc. # # Written by: Adam Fedor # # This file is part of the GNUstep Backend Library. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version # The documents to be generated DOCUMENT_NAME = SUBPROJECTS = Back # The text documents to be generated DOCUMENT_TEXT_NAME = \ INSTALL NEWS README ANNOUNCE TOP_DOC_FILES = INSTALL NEWS README ANNOUNCE INSTALL_TEXI_FILES = version.texi INSTALL_TEXT_MAIN = install.texi INSTALL_DOC_INSTALL_DIR = Developer/Back/ReleaseNotes/$(VERSION) NEWS_TEXI_FILES = version.texi NEWS_TEXT_MAIN = news.texi NEWS_DOC_INSTALL_DIR = Developer/Back/ReleaseNotes/$(VERSION) README_TEXI_FILES = version.texi README_TEXT_MAIN = readme.texi README_DOC_INSTALL_DIR = Developer/Back/ReleaseNotes/$(VERSION) ANNOUNCE_TEXI_FILES = version.texi ANNOUNCE_TEXT_MAIN = announce.texi ANNOUNCE_DOC_INSTALL_DIR = Developer/Back/ReleaseNotes/$(VERSION) -include Makefile.preamble include $(GNUSTEP_MAKEFILES)/documentation.make include $(GNUSTEP_MAKEFILES)/aggregate.make -include Makefile.postamble regenerate: $(DOCUMENT_TEXT_NAME) mv $(TOP_DOC_FILES) .. version.texi: ../Version rm -f version.texi echo '@set GNUSTEP-BACK-VERSION' $(GNUSTEP_BACK_VERSION) \ > version.texi echo '@set GNUSTEP-BACK-GCC $(GNUSTEP_BACK_GCC)' \ >> version.texi echo '@set GNUSTEP-BACK-DGS $(GNUSTEP_BACK_DGS)' \ >> version.texi if [ $(GNUSTEP_BACK_FTP_MACHINE) ]; then \ echo '@set GNUSTEP-BACK-FTP-MACHINE $(GNUSTEP_BACK_FTP_MACHINE)' \ >> version.texi; fi if [ $(GNUSTEP_BACK_FTP_DIRECTORY) ]; then \ echo '@set GNUSTEP-BACK-FTP-DIRECTORY $(GNUSTEP_BACK_FTP_DIRECTORY)' \ >> version.texi; fi gnustep-back-0.29.0/Documentation/announce.texi000066400000000000000000000041671404163720200215060ustar00rootroot00000000000000@c -*- texinfo -*- @chapter Announcement @ifset TEXT-ONLY @include version.texi @end ifset This is version @value{GNUSTEP-BACK-VERSION} of the GNUstep GUI Backend (@samp{gnustep-back}). @section What is the GNUstep GUI Backend? It is a back-end component for the GNUstep GUI Library. The implementation of the GNUstep GUI Library is designed in two parts. The first part is the front-end component which is independent of platform and display system. This front-end is combined with a back-end component which handles all of the display system dependent such as specific calls to the X Window System. This design allows the GNUstep applications to have the "look and feel" of the underlying display system without any changes to the application, and the library can be easily ported to other display systems. The GNUstep GUI Backend is for platforms using the X-Window System or Window's Systems. It works via a DPS emulation engine to emulate the DPS functions required by the front-end system. @set ANNOUNCE-ONLY @include news.texi @clear ANNOUNCE-ONLY @section Where can you get it? How can you compile it? @ifset GNUSTEP-BACK-FTP-MACHINE The gnustep-back-@value{GNUSTEP-BACK-VERSION}.tar.gz distribution file has been placed at @url{ftp://@value{GNUSTEP-BACK-FTP-MACHINE}/@value{GNUSTEP-BACK-FTP-DIRECTORY}}. It is accompanied by gnustep-back-@value{GNUSTEP-BACK-VERSION}.tar.gz.sig, a PGP signature which you can validate by putting both files in the same directory and using: @example gpg --verify gnustep-back-@value{GNUSTEP-BACK-VERSION}.tar.gz.sig @end example Signature has been created using the key with the following fingerprint: @example 83AA E47C E829 A414 6EF8 3420 CA86 8D4C 9914 9679 @end example @end ifset Read the INSTALL file or the GNUstep-HOWTO for installation instructions. @section Where do I send bug reports? Please log bug reports on the GNUstep project page @url{http://savannah.gnu.org/bugs/?group=gnustep} or send bug reports to @email{bug-gnustep@@gnu.org}. @section Obtaining GNUstep Software Check out the GNUstep web site. (@url{http://www.gnustep.org/}) and the GNU web site. (@url{http://www.gnu.org/}) gnustep-back-0.29.0/Documentation/install.texi000066400000000000000000000050201404163720200213330ustar00rootroot00000000000000@c -*- texinfo -*- @chapter Installation @node Top, Introduction, (dir), (dir) @include version.texi @menu * Introduction:: * Configuration:: * Compilation:: * Installing:: @end menu @node Introduction, Configuration, Top, Top @section Introduction This file documents the installation of the GNUstep Backend Library, @samp{gnustep-back}. If you are installing this package as part of the GNUstep core package, read the file GNUstep-HOWTO for more complete instructions on how to install the entire GNUstep package (including this library). GNUstep-HOWTO is located at @url{http://www.gnustep.org} You must have installed gnustep-gui before installing this library. @node Configuration, Compilation, Introduction, Top @section Configuration Configuration is performed by running the @file{configure} program at a shell prompt. You may want to use some of the optional arguments to the @file{configure} program. Type @code{configure --help} for a list. GNUstep specific options are at the end of this list (if any). The backend comes with several different window server and graphics drawing implementations. If you do nothing, the default ones will be chosen. You can can change this using configure. For instance, to choose the art graphical drawing implementation, run @example configure --enable-graphics=art @end example Type @code{configure --help} for a list of graphical drawing implementations. You can also change the name of the backend when configuring it. This is convienient if you want to have a different backend with different configurations. For instance, to create an xlib and and art backend, you could do this: @example configure --enable-graphics=xlib --with-name=xlib make install make distclean configure --enable-graphics=art --with-name=art make install @end example Before running an application, choose one backend using the defaults program: @example defaults write NSGlobalDomain GSBackend libgnustep-xlib @end example @node Compilation, Installing, Configuration, Top @section Compilation To compile this library, type make. After this is complete, type make install (make sure you are the root user). Some additional options you can use with make are @samp{debug=yes} to make a debugging version of the library and @samp{shared=no} to make a static version of the library. See the gstep-make package for more information on these options. @node Installing, , Compilation, Top @section Installing To install, type @example make install @end example @bye gnustep-back-0.29.0/Documentation/news.texi000066400000000000000000000246131404163720200206520ustar00rootroot00000000000000@c -*-texinfo-*- @ifclear ANNOUNCE-ONLY @chapter NEWS @end ifclear @ifset TEXT-ONLY @include version.texi @end ifset @section Noteworthy changes in version @samp{0.29.0} The release includes an alpha version of the wayland backend and a few bug fixes. @itemize @bullet @item Alpha version of the wayland backend. @item Improved focus handling for WindowMaker interaction. @item Speed up for font pattern resolving. @item Improved appicon behavior under WindowMaker. @item Prevent appicon flickering on WindowMaker at application start. @item On Windows, consistently use @code{GetWindowLongPtr} and @code{SetWindowLongPtr} in place of @code{GetWindowLong} and @code{SetWindowLong} for win32 and cairo for various win64 fixes. @end itemize @ifclear ANNOUNCE-ONLY @section Noteworthy changes in version @samp{0.28.0} This release includes a few bugfixes and a huge rework of multi monitor handling. @itemize @bullet @item Improved focus handling for WindowMaker interaction. @item Cursor improvements. @item Better handling of fonts with fontconfig. @item Simplify code that converts images for X11. @item art: Remove ftfont-old.m. @item Use Xrandr for multi monitor support. @end itemize @section Noteworthy changes in version @samp{0.27.0} This release includes a few bugfixes. @itemize @bullet @item configure: Improve configuration. @item xlib: Improve xft font classes. @item x11: Enable drawing in secondary threads. @item x11: Better handling of atoms. Method to get the window manager. @item opal: Improve colour handling @end itemize @section Noteworthy changes in version @samp{0.26.2} This release contains no changes since 0.26.1. It is released to coincide with gnustep-gui 0.26.2, which has important bugfixes related to printing. @section Noteworthy changes in version @samp{0.26.1} This release contains no changes since 0.26.0. It is released to coincide with gnustep-gui 0.26.1, released to mark gnustep-base 1.25.1 as the requirement for gnustep-gui. @section Noteworthy changes in version @samp{0.26.0} This release includes a few bugfixes, as well as compatibility improvements as a result of GSoC 2017 project. @itemize @bullet @item opal: Bridging categories between Opal and GNUstep GUI. Added onto NSColor, NSImage and NSImageRep. @item cairo: Get -DPSshow: to work on scaled windows. @item opal: Allow creating a NSGraphicsContext with a custom graphics port, other than a CGContext. @item misc: Fix reported static analyser warnings. @end itemize @section Noteworthy changes in version @samp{0.25.1} Small fixes and cleanups. @section Noteworthy changes in version @samp{0.25.0} Support for pattern phase, compositing operation, image interpolation and antialiasing per gstate. Improvements to Win32 code. Fix application menus under WindowMaker. Various fixes. @section Noteworthy changes in version @samp{0.24.1} Improvements in win32 display and mouse tracking. Various minor bugfixes and cleanups. @section Noteworthy changes in version @samp{0.24.0} Added experimental Opal backend. Allow for ARGB visual for OpenGL. @section Noteworthy changes in version @samp{0.23.0} Added cairo support for ms-windows. Updated for NSInteger/CGFloat support @section Noteworthy changes in version @samp{0.22.0} Added new user defaults to make app icons and mini windows sticky (omnipresent) Many improvements to Cairo rendering, including buffering, glyphs and DPI scaling. @section Noteworthy changes in version @samp{0.20.0} Cairo is now the default backend, but falls back to art and xlib gracefully. Fixed drawing and flipping (goes along with gui change). More Windows improvements. @section Noteworthy changes in version @samp{0.19.0} This is an (unstable) copy of the 0.18.0 release @section Noteworthy changes in version @samp{0.18.0} Many Windows improvements Implement pattern colours for all backends. @section Noteworthy changes in version @samp{0.17.1} Use DejaVu as another fallback font. @section Noteworthy changes in version @samp{0.17.0} Key repeat support implemented in X11. OpenGL fixes and improvements. @section Noteworthy changes in version @samp{0.16.0} Transparent windows implemented in WIN32 backend, better position and scaling of images. General cleanup of code. @section Noteworthy changes in version @samp{0.14.0} Added code to automatically make any window which uses the NSDesktopWindowLevel also be omnipresent. Many glyph drawing improvements. @section Noteworthy changes in version @samp{0.13.2} Added basic implementation of window levels on Windows. In general a bunch of improvements in the Windows backend. Experimental patch for using cairo on Windows. More support for RTF, TIFF and selctions in the pasteboard server. There has been change in the interaction of devices with the gui frontend. This version or greater of the backend needs to be used with gui 0.13.2 @section Noteworthy changes in version @samp{0.13.1} Minor improvements. @section Noteworthy changes in version @samp{0.13.0} Many improvements to the cairo backend. Add DPSshfill for all backends. Better handling of X event times. @section Noteworthy changes in version @samp{0.12.0} Big improvements to the cairo graphics and Window backend. Also better support for OpenGL. @section Noteworthy changes in version @samp{0.11.0} Bugfixes to art and xlib. There was some work on the Windows backend for the GDI interface by Christopher Armstrong. @section Noteworthy changes in version @samp{0.10.3} Fixes. A lot of Cairo backend work. @section Noteworthy changes in version @samp{0.10.2} The Backend can set UTF8 window titles where this is allowed. @section Noteworthy changes in version @samp{0.10.1} The art graphics module is the default now. As was previously the case, if the proper libraries are not found, the configuration will automatically switch to xlib on winlib (whichever is appropriate). There was a great deal of work by Tom MacSween on the windows module to get windows and taskbars working together, closing, opening, hiding, and just general good window management. The Cairo module has been significantly updated and now works with Cariro version 1.0, although you need to make some minor changes to the Cairo library before it will work with GNUstep. Due to this, this module is still considered beta. Ask on the mailing lists for help with this. @section Noteworthy changes in version @samp{0.10.0} The installed name of the backend now includes an interface version number. This avoids the potential version mismatch between the frontend (GUI) library and the backend. @itemize @bullet @item Alpha blending was implemented for Windows, although it does not seem to work on some machines. @end itemize @section Noteworthy changes in version @samp{0.9.5} @itemize @bullet @item Added support for window alpha on X servers. @item Add support for old and new freetype libs. @item Some improvements to the Windows backend. @end itemize @section Noteworthy changes in version @samp{0.9.4} @itemize @bullet @item Fast drawing on 8 bit displays was added (although it might only speed things up on old X11 servers and/or remote servers). @item GNUstep modifier keys are mapped to KeySyms instead of KeyCodes @item Added a Cairo backend, although it is probably non-functional. Anyone is invited to contribute to making it work. @item art backend supports reading from a window. @item Add internal window decoration handling. @end itemize @section Noteworthy changes in version @samp{0.9.3} @itemize @bullet @item A number of W32 window event enhancements @item art backend glyph drawing with alpha enhancements. @item libwraster is no longer checked for - image functions now in frontend @end itemize @section Noteworthy changes in version @samp{0.9.2} @itemize @bullet @item Art backend added support for grayscale, one-isblack colorspaces. @item Windows pasteboard interaction handling added. @item Better focus handling on Windows. @item Better font and draw handling on Windows. @end itemize @section Noteworthy changes in version @samp{0.9.1} Color on 8 bit displays works correctly now. WindowMaker properties are always set now in case another manager is emulating WindowMaker styles. @section Noteworthy changes in version @samp{0.9.0} Some more improvements to copy/paste support following ICCCM specifications (like COMPOUND_TEXT support). @section Noteworthy changes in version @samp{0.8.9} @itemize @bullet @item Much improved pasting support between X apps and GNUstep apps. @item Backend headers are no longer installed (now private). @end itemize @section Noteworthy changes in version @samp{0.8.8} Full multi-byte/unicode support for East Asian languages was added to the xlib backend. The X11 server now supports use of the XIM input method for entering non-keyboard characters. Both contributions thanks to Kazunobu Kuriyama. @itemize @bullet @item Also added slightly better EWMH support. @item Art backend works with more versions of freetype. @end itemize @section Noteworthy changes in version @samp{0.8.7} Handle NSBezierPath glyph drawing in art backend. art backend compiles with all freetype except 2.1.3 via ifdefs. @section Noteworthy changes in version @samp{0.8.6} Bug fixes. See the gnustep-gui NEWS for changes. @section Noteworthy changes in version @samp{0.8.5} Text system improvements. See the gnustep-gui NEWS for changes. @section Noteworthy changes in version @samp{0.8.3} See the gnustep-gui NEWS for changes. @section Noteworthy changes in version @samp{0.8.2} Improved font handling in art backend. Improved compositing with transformations and clipping in art backend. @section Noteworthy changes in version @samp{0.8.1} art (libart-based) backend added. Use ./configure --enable-graphics=art to choose this backend. @section Noteworthy changes in version @samp{0.8.0} Bug fixes. @section Noteworthy changes in version @samp{0.7.9} Bug fixes. @section Noteworthy changes in version @samp{0.7.8} Simplified backend selection using --enable-server and --enable-graphics. Add --with-library-flags and --with-include-flags for adding additonal flags. Set name with --with-name @section Noteworthy changes in version @samp{0.7.7} First release. Most components extracted from xgps. The old backends, xgps and xdps were depreciated in favor of this new backend, simply named back, which can be configured for a variety of window server and graphics implementations, and also allow for improved code sharing. In addition there is now a window server backend for Windows computers, although it is in a very alpha state. @end ifclear gnustep-back-0.29.0/Documentation/readme.texi000066400000000000000000000014001404163720200211200ustar00rootroot00000000000000@c -*-texinfo-*- @chapter README @ifset TEXT-ONLY @include version.texi @end ifset This is version @value{GNUSTEP-BACK-VERSION} of the GNUstep GUI Backend (@samp{gnustep-back}). Here is some introductory info to get you started: @section Initial reading @itemize @bullet @item The file @file{ANNOUNCE} contains a very brief overview of the library. It also tells you where to get the most recent version. @item The file @file{NEWS} has the library's feature history. @item The file @file{INSTALL} gives instructions for installing the library. @end itemize @section How can you help? @itemize @bullet @item Give us feedback! Tell us what you like; tell us what you think could be better. Send us bug reports at @email{bug-gnustep@@gnu.org}. @end itemize gnustep-back-0.29.0/Fonts/000077500000000000000000000000001404163720200152555ustar00rootroot00000000000000gnustep-back-0.29.0/Fonts/GNUmakefile000066400000000000000000000024571404163720200173370ustar00rootroot00000000000000# # Resources makefile for GNUstep Back Library # Copyright (C) 2005 Free Software Foundation, Inc. # # Written by: Adam Fedor # Date: Feb 2005 # # This file is part of the GNUstep Back Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../back.make include $(GNUSTEP_MAKEFILES)/common.make #RESOURCE_SET_NAME = back-resources back-resources_INSTALL_DIR = $(GNUSTEP_LIBRARY)/Fonts back-resources_RESOURCE_FILES = $(FONT_INSTALL_FILES) FONT_INSTALL_FILES = Helvetica.nfont include $(GNUSTEP_MAKEFILES)/rules.make -include GNUmakefile.postamble gnustep-back-0.29.0/Fonts/GNUmakefile.postamble000066400000000000000000000035611404163720200213210ustar00rootroot00000000000000# # GNUmakefile.postamble # # Copyright (C) 2000 Free Software Foundation, Inc. # # Written: Adam Fedor # Date: Oct 2000 # # This file is part of the GNUstep Base Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing after-install:: mkdir -p $(back-resources_INSTALL_DIR) for file in $(FONT_INSTALL_FILES); do \ ($(TAR) cfX - $(GNUSTEP_MAKEFILES)/tar-exclude-list $$file) | (cd $(back-resources_INSTALL_DIR); $(TAR) xf -) ;\ done # Things to do before uninstalling before-uninstall:: for file in $(FONT_INSTALL_FILES); do \ rm -rf $(back-resources_INSTALL_DIR)/$$file;\ done -rmdir $(back-resources_INSTALL_DIR) # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: gnustep-back-0.29.0/Fonts/Helvetica.nfont/000077500000000000000000000000001404163720200203045ustar00rootroot00000000000000gnustep-back-0.29.0/Fonts/Helvetica.nfont/FontInfo.plist000066400000000000000000000015271404163720200231100ustar00rootroot00000000000000{ Version = 2; Foundry = "URW"; Faces = ( { PostScriptName = "Helvetica"; Name = "Regular"; Files = ("n019003l.pfb","n019003l.pfm","n019003l.afm"); }, { PostScriptName = "Helvetica-Bold"; Name = "Bold"; Files = ("n019004l.pfb","n019004l.pfm","n019004l.afm"); }, { PostScriptName = "Helvetica-Italic"; Name = "Italic"; Files = ("n019023l.pfb","n019023l.pfm","n019023l.afm"); }, { PostScriptName = "Helvetica-BoldItalic"; Name = "Bold Italic"; Files = ("n019024l.pfb","n019024l.pfm","n019024l.afm"); }, { PostScriptName = "Helvetica-Oblique"; Name = "Oblique"; Files = ("n019023l.pfb","n019023l.pfm","n019023l.afm"); }, { PostScriptName = "Helvetica-BoldOblique"; Name = "Bold Oblique"; Files = ("n019024l.pfb","n019024l.pfm","n019024l.afm"); } ); } gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019003l.afm000066400000000000000000000760231404163720200220670ustar00rootroot00000000000000StartFontMetrics 3.0 Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development Comment Creation Date: 12/22/1999 Comment See the file COPYING (GNU General Public License) for license conditions. FontName NimbusSanL-Regu FullName Nimbus Sans L Regular FamilyName Nimbus Sans L Weight Regular ItalicAngle 0.0 IsFixedPitch false UnderlinePosition -151 UnderlineThickness 50 Version 1.05 Notice (URW)++,Copyright 1999 by (URW)++ Design & Development EncodingScheme AdobeStandardEncoding FontBBox -174 -285 1001 953 CapHeight 729 XHeight 524 Descender -218 Ascender 729 StartCharMetrics 316 C 32 ; WX 278 ; N space ; B 191 0 191 0 ; C 33 ; WX 278 ; N exclam ; B 124 0 208 729 ; C 34 ; WX 355 ; N quotedbl ; B 52 464 305 709 ; C 35 ; WX 556 ; N numbersign ; B 14 -20 542 697 ; C 36 ; WX 556 ; N dollar ; B 26 -126 518 770 ; C 37 ; WX 889 ; N percent ; B 29 -20 859 709 ; C 38 ; WX 667 ; N ampersand ; B 52 -23 637 709 ; C 39 ; WX 221 ; N quoteright ; B 64 497 157 729 ; C 40 ; WX 333 ; N parenleft ; B 73 -212 291 729 ; C 41 ; WX 333 ; N parenright ; B 38 -212 256 729 ; C 42 ; WX 389 ; N asterisk ; B 40 441 343 729 ; C 43 ; WX 584 ; N plus ; B 50 -10 534 474 ; C 44 ; WX 278 ; N comma ; B 87 -147 192 104 ; C 45 ; WX 333 ; N hyphen ; B 46 240 284 312 ; C 46 ; WX 278 ; N period ; B 87 0 191 104 ; C 47 ; WX 278 ; N slash ; B -8 -20 284 729 ; C 48 ; WX 556 ; N zero ; B 43 -23 507 709 ; C 49 ; WX 556 ; N one ; B 102 0 347 709 ; C 50 ; WX 556 ; N two ; B 34 0 511 709 ; C 51 ; WX 556 ; N three ; B 32 -23 506 709 ; C 52 ; WX 556 ; N four ; B 28 0 520 709 ; C 53 ; WX 556 ; N five ; B 35 -23 513 709 ; C 54 ; WX 556 ; N six ; B 43 -23 513 709 ; C 55 ; WX 556 ; N seven ; B 46 0 520 709 ; C 56 ; WX 556 ; N eight ; B 37 -23 513 709 ; C 57 ; WX 556 ; N nine ; B 38 -23 509 709 ; C 58 ; WX 278 ; N colon ; B 110 0 214 524 ; C 59 ; WX 278 ; N semicolon ; B 110 -147 215 524 ; C 60 ; WX 584 ; N less ; B 45 -9 534 474 ; C 61 ; WX 584 ; N equal ; B 50 111 534 353 ; C 62 ; WX 584 ; N greater ; B 50 -9 539 474 ; C 63 ; WX 556 ; N question ; B 77 0 509 741 ; C 64 ; WX 1015 ; N at ; B 34 -142 951 741 ; C 65 ; WX 667 ; N A ; B 17 0 653 729 ; C 66 ; WX 667 ; N B ; B 79 0 623 729 ; C 67 ; WX 722 ; N C ; B 48 -23 677 741 ; C 68 ; WX 722 ; N D ; B 89 0 667 729 ; C 69 ; WX 667 ; N E ; B 90 0 613 729 ; C 70 ; WX 611 ; N F ; B 90 0 579 729 ; C 71 ; WX 778 ; N G ; B 44 -23 709 741 ; C 72 ; WX 722 ; N H ; B 83 0 644 729 ; C 73 ; WX 278 ; N I ; B 100 0 194 729 ; C 74 ; WX 500 ; N J ; B 17 -23 426 729 ; C 75 ; WX 667 ; N K ; B 79 0 658 729 ; C 76 ; WX 556 ; N L ; B 80 0 533 729 ; C 77 ; WX 833 ; N M ; B 75 0 761 729 ; C 78 ; WX 722 ; N N ; B 76 0 646 729 ; C 79 ; WX 778 ; N O ; B 38 -23 742 741 ; C 80 ; WX 667 ; N P ; B 91 0 617 729 ; C 81 ; WX 778 ; N Q ; B 38 -59 742 741 ; C 82 ; WX 722 ; N R ; B 93 0 679 729 ; C 83 ; WX 667 ; N S ; B 48 -23 621 741 ; C 84 ; WX 611 ; N T ; B 21 0 593 729 ; C 85 ; WX 722 ; N U ; B 85 -23 645 729 ; C 86 ; WX 667 ; N V ; B 30 0 645 729 ; C 87 ; WX 944 ; N W ; B 22 0 929 729 ; C 88 ; WX 667 ; N X ; B 22 0 649 729 ; C 89 ; WX 667 ; N Y ; B 13 0 661 729 ; C 90 ; WX 611 ; N Z ; B 28 0 583 729 ; C 91 ; WX 278 ; N bracketleft ; B 64 -212 250 729 ; C 92 ; WX 278 ; N backslash ; B -8 -20 284 729 ; C 93 ; WX 278 ; N bracketright ; B 23 -212 209 729 ; C 94 ; WX 469 ; N asciicircum ; B 44 329 425 709 ; C 95 ; WX 556 ; N underscore ; B -22 -176 578 -126 ; C 96 ; WX 222 ; N quoteleft ; B 65 477 158 709 ; C 97 ; WX 556 ; N a ; B 42 -23 535 539 ; C 98 ; WX 556 ; N b ; B 54 -23 523 729 ; C 99 ; WX 500 ; N c ; B 31 -23 477 539 ; C 100 ; WX 556 ; N d ; B 26 -23 495 729 ; C 101 ; WX 556 ; N e ; B 40 -23 513 539 ; C 102 ; WX 278 ; N f ; B 18 0 258 732 ; C 103 ; WX 556 ; N g ; B 29 -218 489 539 ; C 104 ; WX 556 ; N h ; B 70 0 486 729 ; C 105 ; WX 222 ; N i ; B 66 0 150 729 ; C 106 ; WX 222 ; N j ; B -18 -218 153 729 ; C 107 ; WX 500 ; N k ; B 58 0 502 729 ; C 108 ; WX 222 ; N l ; B 68 0 152 729 ; C 109 ; WX 833 ; N m ; B 70 0 762 539 ; C 110 ; WX 556 ; N n ; B 70 0 487 539 ; C 111 ; WX 556 ; N o ; B 36 -23 510 539 ; C 112 ; WX 556 ; N p ; B 54 -218 523 539 ; C 113 ; WX 556 ; N q ; B 26 -218 495 539 ; C 114 ; WX 333 ; N r ; B 69 0 321 539 ; C 115 ; WX 500 ; N s ; B 34 -23 459 539 ; C 116 ; WX 278 ; N t ; B 14 -23 254 668 ; C 117 ; WX 556 ; N u ; B 65 -23 482 524 ; C 118 ; WX 500 ; N v ; B 10 0 486 524 ; C 119 ; WX 722 ; N w ; B 6 0 708 524 ; C 120 ; WX 500 ; N x ; B 17 0 473 524 ; C 121 ; WX 500 ; N y ; B 20 -218 478 524 ; C 122 ; WX 500 ; N z ; B 31 0 457 524 ; C 123 ; WX 334 ; N braceleft ; B 43 -212 276 729 ; C 124 ; WX 260 ; N bar ; B 100 -212 160 729 ; C 125 ; WX 334 ; N braceright ; B 29 -212 262 729 ; C 126 ; WX 584 ; N asciitilde ; B 75 268 508 438 ; C 161 ; WX 333 ; N exclamdown ; B 121 -205 205 524 ; C 162 ; WX 556 ; N cent ; B 52 -120 510 628 ; C 163 ; WX 556 ; N sterling ; B 26 -23 535 729 ; C 164 ; WX 167 ; N fraction ; B -174 -20 336 709 ; C 165 ; WX 556 ; N yen ; B 11 0 545 709 ; C 166 ; WX 556 ; N florin ; B 11 -212 542 738 ; C 167 ; WX 556 ; N section ; B 43 -213 506 729 ; C 168 ; WX 556 ; N currency ; B 67 133 489 551 ; C 169 ; WX 191 ; N quotesingle ; B 48 464 142 709 ; C 170 ; WX 333 ; N quotedblleft ; B 48 477 299 709 ; C 171 ; WX 556 ; N guillemotleft ; B 98 106 455 438 ; C 172 ; WX 333 ; N guilsinglleft ; B 91 106 243 438 ; C 173 ; WX 333 ; N guilsinglright ; B 85 106 239 438 ; C 174 ; WX 500 ; N fi ; B 12 0 436 732 ; C 175 ; WX 500 ; N fl ; B 17 0 430 732 ; C 177 ; WX 556 ; N endash ; B -5 240 561 312 ; C 178 ; WX 556 ; N dagger ; B 38 -177 513 709 ; C 179 ; WX 556 ; N daggerdbl ; B 38 -177 513 709 ; C 180 ; WX 278 ; N periodcentered ; B 87 302 211 427 ; C 182 ; WX 537 ; N paragraph ; B 48 -177 522 729 ; C 183 ; WX 350 ; N bullet ; B 50 220 300 470 ; C 184 ; WX 222 ; N quotesinglbase ; B 64 -128 158 104 ; C 185 ; WX 333 ; N quotedblbase ; B 47 -128 300 104 ; C 186 ; WX 333 ; N quotedblright ; B 49 477 302 709 ; C 187 ; WX 556 ; N guillemotright ; B 98 106 451 438 ; C 188 ; WX 1000 ; N ellipsis ; B 115 0 885 104 ; C 189 ; WX 1000 ; N perthousand ; B 9 -22 993 738 ; C 191 ; WX 611 ; N questiondown ; B 95 -217 528 524 ; C 193 ; WX 333 ; N grave ; B 22 592 231 740 ; C 194 ; WX 333 ; N acute ; B 92 592 301 740 ; C 195 ; WX 333 ; N circumflex ; B 20 591 307 741 ; C 196 ; WX 333 ; N tilde ; B 5 613 319 717 ; C 197 ; WX 333 ; N macron ; B 28 631 302 701 ; C 198 ; WX 333 ; N breve ; B 15 597 316 732 ; C 199 ; WX 333 ; N dotaccent ; B 115 612 219 716 ; C 200 ; WX 333 ; N dieresis ; B 30 612 296 715 ; C 202 ; WX 333 ; N ring ; B 79 579 255 754 ; C 203 ; WX 333 ; N cedilla ; B 39 -214 287 0 ; C 205 ; WX 333 ; N hungarumlaut ; B -35 590 348 740 ; C 206 ; WX 333 ; N ogonek ; B 57 -205 265 0 ; C 207 ; WX 333 ; N caron ; B 19 591 306 741 ; C 208 ; WX 1000 ; N emdash ; B -9 240 1001 312 ; C 225 ; WX 1000 ; N AE ; B 11 0 950 729 ; C 227 ; WX 370 ; N ordfeminine ; B 37 303 333 742 ; C 232 ; WX 556 ; N Lslash ; B 0 0 552 729 ; C 233 ; WX 778 ; N Oslash ; B 30 -23 744 755 ; C 234 ; WX 1000 ; N OE ; B 43 -20 959 741 ; C 235 ; WX 365 ; N ordmasculine ; B 40 303 324 742 ; C 241 ; WX 889 ; N ae ; B 34 -23 845 539 ; C 245 ; WX 278 ; N dotlessi ; B 94 0 178 524 ; C 248 ; WX 222 ; N lslash ; B 0 0 212 729 ; C 249 ; WX 611 ; N oslash ; B 18 -30 529 539 ; C 250 ; WX 944 ; N oe ; B 40 -23 899 539 ; C 251 ; WX 611 ; N germandbls ; B 126 -20 566 729 ; C -1 ; WX 722 ; N Udieresis ; B 85 -23 645 914 ; C -1 ; WX 722 ; N Uacute ; B 85 -23 645 939 ; C -1 ; WX 667 ; N Scedilla ; B 45 -214 621 741 ; C -1 ; WX 611 ; N Tcaron ; B 21 0 593 940 ; C -1 ; WX 667 ; N Scaron ; B 48 -23 621 940 ; C -1 ; WX 722 ; N Rcaron ; B 93 0 679 940 ; C -1 ; WX 722 ; N Racute ; B 93 0 679 939 ; C -1 ; WX 667 ; N Sacute ; B 48 -23 621 939 ; C -1 ; WX 778 ; N Otilde ; B 38 -23 742 916 ; C -1 ; WX 556 ; N ucircumflex ; B 65 -23 482 741 ; C -1 ; WX 778 ; N Ohungarumlaut ; B 38 -23 742 939 ; C -1 ; WX 722 ; N Uhungarumlaut ; B 85 -23 645 939 ; C -1 ; WX 666 ; N Yacute ; B 13 0 661 939 ; C -1 ; WX 722 ; N Eth ; B 20 0 667 729 ; C -1 ; WX 722 ; N Dcroat ; B 20 0 667 729 ; C -1 ; WX 611 ; N Zacute ; B 28 0 583 939 ; C -1 ; WX 722 ; N Uring ; B 85 -23 645 953 ; C -1 ; WX 556 ; N gbreve ; B 29 -218 489 732 ; C -1 ; WX 556 ; N eogonek ; B 40 -204 514 539 ; C -1 ; WX 556 ; N edotaccent ; B 40 -23 513 716 ; C -1 ; WX 556 ; N ecaron ; B 40 -23 513 741 ; C -1 ; WX 722 ; N Ugrave ; B 85 -23 645 939 ; C -1 ; WX 666 ; N Thorn ; B 91 0 616 729 ; C -1 ; WX 556 ; N eacute ; B 40 -23 513 740 ; C -1 ; WX 556 ; N edieresis ; B 40 -23 513 715 ; C -1 ; WX 635 ; N dcaron ; B 26 -23 648 729 ; C -1 ; WX 500 ; N ccedilla ; B 31 -214 477 539 ; C -1 ; WX 500 ; N ccaron ; B 31 -23 477 741 ; C -1 ; WX 500 ; N cacute ; B 31 -23 477 740 ; C -1 ; WX 556 ; N aogonek ; B 43 -205 596 539 ; C -1 ; WX 556 ; N aring ; B 42 -23 535 754 ; C -1 ; WX 556 ; N atilde ; B 42 -23 535 717 ; C -1 ; WX 556 ; N abreve ; B 42 -23 535 732 ; C -1 ; WX 556 ; N egrave ; B 40 -23 513 740 ; C -1 ; WX 556 ; N agrave ; B 42 -23 535 740 ; C -1 ; WX 556 ; N aacute ; B 42 -23 535 740 ; C -1 ; WX 556 ; N adieresis ; B 42 -23 535 715 ; C -1 ; WX 722 ; N Uogonek ; B 85 -205 645 729 ; C -1 ; WX 556 ; N ugrave ; B 65 -23 482 740 ; C -1 ; WX 556 ; N uacute ; B 65 -23 482 740 ; C -1 ; WX 556 ; N udieresis ; B 65 -23 482 715 ; C -1 ; WX 308 ; N tcaron ; B 14 -23 321 800 ; C -1 ; WX 500 ; N scommaaccent ; B 34 -285 459 539 ; C -1 ; WX 611 ; N Zcaron ; B 28 0 583 940 ; C -1 ; WX 556 ; N ecircumflex ; B 40 -23 513 741 ; C -1 ; WX 722 ; N Ucircumflex ; B 85 -23 645 940 ; C -1 ; WX 556 ; N acircumflex ; B 42 -23 535 741 ; C -1 ; WX 611 ; N Zdotaccent ; B 28 0 583 915 ; C -1 ; WX 500 ; N scaron ; B 34 -23 459 741 ; C -1 ; WX 667 ; N Amacron ; B 17 0 653 900 ; C -1 ; WX 500 ; N sacute ; B 34 -23 459 740 ; C -1 ; WX 611 ; N Tcommaaccent ; B 21 -285 593 729 ; C -1 ; WX 667 ; N Ydieresis ; B 13 0 661 914 ; C -1 ; WX 555 ; N thorn ; B 54 -218 522 714 ; C -1 ; WX 667 ; N Emacron ; B 90 0 613 900 ; C -1 ; WX 778 ; N Ograve ; B 38 -23 742 939 ; C -1 ; WX 778 ; N Oacute ; B 38 -23 742 939 ; C -1 ; WX 778 ; N Odieresis ; B 38 -23 742 914 ; C -1 ; WX 722 ; N Ntilde ; B 76 0 646 916 ; C -1 ; WX 722 ; N Ncaron ; B 76 0 646 940 ; C -1 ; WX 722 ; N Nacute ; B 76 0 646 939 ; C -1 ; WX 556 ; N Lcaron ; B 80 0 533 729 ; C -1 ; WX 556 ; N Lacute ; B 70 0 533 939 ; C -1 ; WX 278 ; N Idotaccent ; B 92 0 196 915 ; C -1 ; WX 333 ; N racute ; B 69 0 331 740 ; C -1 ; WX 278 ; N Icircumflex ; B -1 0 286 940 ; C -1 ; WX 556 ; N ohungarumlaut ; B 36 -23 526 740 ; C -1 ; WX 556 ; N otilde ; B 36 -23 510 717 ; C -1 ; WX 556 ; N Euro ; B 2 -23 543 709 ; C -1 ; WX 556 ; N ocircumflex ; B 36 -23 510 741 ; C -1 ; WX 351 ; N onesuperior ; B 61 284 222 709 ; C -1 ; WX 351 ; N twosuperior ; B 19 284 326 709 ; C -1 ; WX 351 ; N threesuperior ; B 16 270 322 709 ; C -1 ; WX 278 ; N Igrave ; B 1 0 210 939 ; C -1 ; WX 278 ; N Iacute ; B 71 0 280 939 ; C -1 ; WX 278 ; N Imacron ; B 20 0 274 900 ; C -1 ; WX 278 ; N Iogonek ; B 66 -204 234 729 ; C -1 ; WX 278 ; N Idieresis ; B 9 0 275 907 ; C -1 ; WX 778 ; N Gbreve ; B 44 -23 709 931 ; C -1 ; WX 722 ; N Umacron ; B 85 -23 645 900 ; C -1 ; WX 667 ; N Kcommaaccent ; B 79 -285 658 729 ; C -1 ; WX 556 ; N ograve ; B 36 -23 510 740 ; C -1 ; WX 667 ; N Scommaaccent ; B 48 -285 621 741 ; C -1 ; WX 667 ; N Eogonek ; B 90 -205 652 729 ; C -1 ; WX 556 ; N oacute ; B 36 -23 510 740 ; C -1 ; WX 667 ; N Edotaccent ; B 90 0 613 915 ; C -1 ; WX 222 ; N iogonek ; B 25 -204 190 729 ; C -1 ; WX 556 ; N gcommaaccent ; B 29 -218 489 817 ; C -1 ; WX 556 ; N odieresis ; B 36 -23 510 715 ; C -1 ; WX 556 ; N ntilde ; B 70 0 487 717 ; C -1 ; WX 556 ; N ncaron ; B 70 0 487 741 ; C -1 ; WX 667 ; N Ecaron ; B 90 0 613 940 ; C -1 ; WX 667 ; N Ecircumflex ; B 90 0 613 940 ; C -1 ; WX 500 ; N scedilla ; B 34 -214 459 539 ; C -1 ; WX 333 ; N rcaron ; B 48 0 335 741 ; C -1 ; WX 667 ; N Egrave ; B 90 0 613 939 ; C -1 ; WX 667 ; N Eacute ; B 90 0 613 939 ; C -1 ; WX 778 ; N Gcommaaccent ; B 44 -285 709 741 ; C -1 ; WX 722 ; N Rcommaaccent ; B 93 -285 679 729 ; C -1 ; WX 667 ; N Edieresis ; B 90 0 613 914 ; C -1 ; WX 556 ; N nacute ; B 70 0 487 740 ; C -1 ; WX 556 ; N uogonek ; B 65 -204 521 524 ; C -1 ; WX 556 ; N umacron ; B 65 -23 482 701 ; C -1 ; WX 722 ; N Dcaron ; B 89 0 667 940 ; C -1 ; WX 292 ; N lcaron ; B 68 0 305 729 ; C -1 ; WX 722 ; N Ccaron ; B 48 -23 677 940 ; C -1 ; WX 722 ; N Cacute ; B 48 -23 677 939 ; C -1 ; WX 722 ; N Ccedilla ; B 48 -214 677 741 ; C -1 ; WX 606 ; N degree ; B 151 383 454 686 ; C -1 ; WX 667 ; N Aogonek ; B 17 -205 692 729 ; C -1 ; WX 584 ; N minus ; B 40 197 544 267 ; C -1 ; WX 584 ; N multiply ; B 95 34 488 427 ; C -1 ; WX 584 ; N divide ; B 50 0 534 472 ; C -1 ; WX 667 ; N Aring ; B 17 0 653 953 ; C -1 ; WX 1000 ; N trademark ; B 63 292 938 729 ; C -1 ; WX 333 ; N rcommaaccent ; B 65 -285 321 539 ; C -1 ; WX 222 ; N lacute ; B 63 0 272 939 ; C -1 ; WX 556 ; N omacron ; B 36 -23 510 701 ; C -1 ; WX 667 ; N Atilde ; B 17 0 653 916 ; C -1 ; WX 278 ; N icircumflex ; B -7 0 280 741 ; C -1 ; WX 278 ; N igrave ; B -5 0 204 740 ; C -1 ; WX 556 ; N ncommaaccent ; B 70 -285 487 539 ; C -1 ; WX 222 ; N lcommaaccent ; B 63 -285 163 729 ; C -1 ; WX 584 ; N plusminus ; B 50 -11 534 623 ; C -1 ; WX 869 ; N onehalf ; B 61 -20 844 709 ; C -1 ; WX 869 ; N onequarter ; B 61 -20 849 709 ; C -1 ; WX 869 ; N threequarters ; B 16 -20 849 709 ; C -1 ; WX 278 ; N iacute ; B 65 0 274 740 ; C -1 ; WX 667 ; N Abreve ; B 17 0 653 931 ; C -1 ; WX 500 ; N kcommaaccent ; B 58 -285 502 729 ; C -1 ; WX 778 ; N Omacron ; B 38 -23 742 900 ; C -1 ; WX 222 ; N imacron ; B -16 0 231 701 ; C -1 ; WX 556 ; N emacron ; B 40 -23 513 701 ; C -1 ; WX 556 ; N amacron ; B 42 -23 535 701 ; C -1 ; WX 278 ; N tcommaaccent ; B 14 -285 254 668 ; C -1 ; WX 500 ; N ydieresis ; B 20 -218 478 715 ; C -1 ; WX 500 ; N zdotaccent ; B 31 0 457 716 ; C -1 ; WX 500 ; N zcaron ; B 31 0 457 741 ; C -1 ; WX 500 ; N zacute ; B 31 0 457 740 ; C -1 ; WX 500 ; N yacute ; B 20 -218 478 740 ; C -1 ; WX 556 ; N uhungarumlaut ; B 65 -23 530 740 ; C -1 ; WX 556 ; N eth ; B 36 -23 510 743 ; C -1 ; WX 556 ; N uring ; B 65 -23 482 754 ; C -1 ; WX 778 ; N Ocircumflex ; B 38 -23 742 940 ; C -1 ; WX 333 ; N commaaccent ; B 116 -285 216 -60 ; C -1 ; WX 737 ; N copyright ; B -13 -22 751 742 ; C -1 ; WX 737 ; N registered ; B -13 -22 751 742 ; C -1 ; WX 667 ; N Acircumflex ; B 17 0 653 940 ; C -1 ; WX 278 ; N idieresis ; B 3 0 269 708 ; C -1 ; WX 489 ; N lozenge ; B 16 0 462 744 ; C -1 ; WX 711 ; N Delta ; B 10 0 701 729 ; C -1 ; WX 548 ; N notequal ; B 32 -25 516 486 ; C -1 ; WX 542 ; N radical ; B 7 -36 512 913 ; C -1 ; WX 667 ; N Agrave ; B 17 0 653 939 ; C -1 ; WX 667 ; N Aacute ; B 17 0 653 939 ; C -1 ; WX 584 ; N lessequal ; B 45 -11 534 639 ; C -1 ; WX 584 ; N greaterequal ; B 45 -11 534 639 ; C -1 ; WX 584 ; N logicalnot ; B 40 86 544 375 ; C -1 ; WX 711 ; N summation ; B 17 -97 694 760 ; C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ; C -1 ; WX 722 ; N Ncommaaccent ; B 76 -285 646 729 ; C -1 ; WX 556 ; N dcroat ; B 26 -23 557 729 ; C -1 ; WX 260 ; N brokenbar ; B 100 -212 160 729 ; C -1 ; WX 556 ; N Lcommaaccent ; B 80 -285 533 729 ; C -1 ; WX 667 ; N Adieresis ; B 17 0 653 914 ; C -1 ; WX 556 ; N mu ; B 65 -220 544 524 ; C -1 ; WX 278 ; N .notdef ; B 191 0 191 0 ; EndCharMetrics StartKernData StartKernPairs 998 KPX A C -36 KPX A Ccedilla -36 KPX A G -35 KPX A O -33 KPX A Odieresis -33 KPX A Q -32 KPX A T -93 KPX A U -37 KPX A Uacute -37 KPX A Ucircumflex -37 KPX A Udieresis -37 KPX A Ugrave -37 KPX A V -75 KPX A W -51 KPX A Y -99 KPX A a -4 KPX A b 4 KPX A c -11 KPX A ccedilla -10 KPX A comma 5 KPX A d -8 KPX A e -16 KPX A g -10 KPX A guillemotleft -44 KPX A guilsinglleft -40 KPX A hyphen -3 KPX A o -13 KPX A period 5 KPX A q -8 KPX A quotedblright -56 KPX A quoteright -65 KPX A t -16 KPX A u -12 KPX A v -31 KPX A w -21 KPX A y -34 KPX Aacute C -36 KPX Aacute G -35 KPX Aacute O -33 KPX Aacute Q -32 KPX Aacute T -93 KPX Aacute U -37 KPX Aacute V -75 KPX Aacute W -51 KPX Aacute Y -99 KPX Aacute a -4 KPX Aacute b 4 KPX Aacute c -11 KPX Aacute comma 5 KPX Aacute d -8 KPX Aacute e -16 KPX Aacute g -10 KPX Aacute guillemotleft -44 KPX Aacute guilsinglleft -40 KPX Aacute hyphen -3 KPX Aacute o -13 KPX Aacute period 5 KPX Aacute q -8 KPX Aacute quoteright -65 KPX Aacute t -16 KPX Aacute u -12 KPX Aacute v -31 KPX Aacute w -21 KPX Aacute y -34 KPX Acircumflex C -36 KPX Acircumflex G -35 KPX Acircumflex O -33 KPX Acircumflex Q -32 KPX Acircumflex T -93 KPX Acircumflex U -37 KPX Acircumflex V -75 KPX Acircumflex W -51 KPX Acircumflex Y -99 KPX Acircumflex comma 5 KPX Acircumflex period 5 KPX Adieresis C -36 KPX Adieresis G -35 KPX Adieresis O -33 KPX Adieresis Q -32 KPX Adieresis T -93 KPX Adieresis U -37 KPX Adieresis V -75 KPX Adieresis W -51 KPX Adieresis Y -99 KPX Adieresis a -4 KPX Adieresis b 4 KPX Adieresis c -11 KPX Adieresis comma 5 KPX Adieresis d -8 KPX Adieresis g -10 KPX Adieresis guillemotleft -44 KPX Adieresis guilsinglleft -40 KPX Adieresis hyphen -3 KPX Adieresis o -13 KPX Adieresis period 5 KPX Adieresis q -8 KPX Adieresis quotedblright -56 KPX Adieresis quoteright -65 KPX Adieresis t -16 KPX Adieresis u -12 KPX Adieresis v -31 KPX Adieresis w -21 KPX Adieresis y -34 KPX Agrave C -36 KPX Agrave G -35 KPX Agrave O -33 KPX Agrave Q -32 KPX Agrave T -93 KPX Agrave U -37 KPX Agrave V -75 KPX Agrave W -51 KPX Agrave Y -99 KPX Agrave comma 5 KPX Agrave period 5 KPX Aring C -36 KPX Aring G -35 KPX Aring O -33 KPX Aring Q -32 KPX Aring T -93 KPX Aring U -37 KPX Aring V -75 KPX Aring W -51 KPX Aring Y -99 KPX Aring a -4 KPX Aring b 4 KPX Aring c -11 KPX Aring comma 5 KPX Aring d -8 KPX Aring e -16 KPX Aring g -10 KPX Aring guillemotleft -44 KPX Aring guilsinglleft -40 KPX Aring hyphen -3 KPX Aring o -13 KPX Aring period 5 KPX Aring q -8 KPX Aring quotedblright -56 KPX Aring quoteright -65 KPX Aring t -16 KPX Aring u -12 KPX Aring v -31 KPX Aring w -21 KPX Aring y -34 KPX Atilde C -36 KPX Atilde G -35 KPX Atilde O -33 KPX Atilde Q -32 KPX Atilde T -93 KPX Atilde U -37 KPX Atilde V -75 KPX Atilde W -51 KPX Atilde Y -99 KPX Atilde comma 5 KPX Atilde period 5 KPX B A -21 KPX B AE -21 KPX B Aacute -21 KPX B Acircumflex -21 KPX B Adieresis -21 KPX B Aring -21 KPX B Atilde -21 KPX B O -7 KPX B OE -5 KPX B Oacute -7 KPX B Ocircumflex -7 KPX B Odieresis -7 KPX B Ograve -7 KPX B Oslash -1 KPX B V -41 KPX B W -25 KPX B Y -44 KPX C A -32 KPX C AE -33 KPX C Aacute -32 KPX C Adieresis -32 KPX C Aring -32 KPX C H -12 KPX C K -10 KPX C O -8 KPX C Oacute -8 KPX C Odieresis -8 KPX Ccedilla A -31 KPX D A -42 KPX D Aacute -42 KPX D Acircumflex -42 KPX D Adieresis -42 KPX D Agrave -42 KPX D Aring -42 KPX D Atilde -42 KPX D J -5 KPX D T -45 KPX D V -51 KPX D W -29 KPX D X -53 KPX D Y -63 KPX F A -69 KPX F Aacute -69 KPX F Acircumflex -69 KPX F Adieresis -69 KPX F Agrave -69 KPX F Aring -69 KPX F Atilde -69 KPX F J -51 KPX F O -22 KPX F Odieresis -22 KPX F a -33 KPX F aacute -33 KPX F adieresis -33 KPX F ae -29 KPX F aring -33 KPX F comma -108 KPX F e -24 KPX F eacute -24 KPX F hyphen -14 KPX F i -10 KPX F j -12 KPX F o -21 KPX F oacute -21 KPX F odieresis -21 KPX F oe -23 KPX F oslash -21 KPX F period -108 KPX F r -35 KPX F u -33 KPX G A -6 KPX G AE -3 KPX G Aacute -6 KPX G Acircumflex -6 KPX G Adieresis -6 KPX G Agrave -6 KPX G Aring -6 KPX G Atilde -6 KPX G T -44 KPX G V -50 KPX G W -28 KPX G Y -62 KPX J A -32 KPX J AE -31 KPX J Adieresis -32 KPX J Aring -32 KPX K C -51 KPX K G -51 KPX K O -48 KPX K OE -45 KPX K Oacute -48 KPX K Odieresis -48 KPX K S -38 KPX K T 20 KPX K a -11 KPX K adieresis -11 KPX K ae -7 KPX K aring -11 KPX K e -32 KPX K hyphen -47 KPX K o -29 KPX K oacute -29 KPX K odieresis -29 KPX K u -19 KPX K udieresis -19 KPX K y -62 KPX L A 17 KPX L AE 20 KPX L Aacute 17 KPX L Adieresis 17 KPX L Aring 17 KPX L C -41 KPX L Ccedilla -37 KPX L G -42 KPX L O -41 KPX L Oacute -41 KPX L Ocircumflex -41 KPX L Odieresis -41 KPX L Ograve -41 KPX L Otilde -41 KPX L S -19 KPX L T -105 KPX L U -35 KPX L Udieresis -35 KPX L V -105 KPX L W -68 KPX L Y -121 KPX L hyphen -125 KPX L quotedblright -141 KPX L quoteright -149 KPX L u -7 KPX L udieresis -7 KPX L y -56 KPX N A -9 KPX N AE -6 KPX N Aacute -9 KPX N Adieresis -9 KPX N Aring -9 KPX N C -3 KPX N Ccedilla -3 KPX N G -2 KPX N O 0 KPX N Oacute 0 KPX N Odieresis 0 KPX N a -5 KPX N aacute -5 KPX N adieresis -5 KPX N ae -2 KPX N aring -5 KPX N comma -7 KPX N e 0 KPX N eacute 0 KPX N o 2 KPX N oacute 2 KPX N odieresis 2 KPX N oslash 4 KPX N period -7 KPX N u 0 KPX N udieresis 0 KPX O A -35 KPX O AE -39 KPX O Aacute -35 KPX O Adieresis -35 KPX O Aring -35 KPX O T -42 KPX O V -45 KPX O W -23 KPX O X -46 KPX O Y -59 KPX Oacute A -35 KPX Oacute T -42 KPX Oacute V -45 KPX Oacute W -23 KPX Oacute Y -59 KPX Ocircumflex T -42 KPX Ocircumflex V -45 KPX Ocircumflex Y -59 KPX Odieresis A -35 KPX Odieresis T -42 KPX Odieresis V -45 KPX Odieresis W -23 KPX Odieresis X -46 KPX Odieresis Y -59 KPX Ograve T -42 KPX Ograve V -45 KPX Ograve Y -59 KPX Oslash A -33 KPX Otilde T -42 KPX Otilde V -45 KPX Otilde Y -59 KPX P A -78 KPX P AE -86 KPX P Aacute -78 KPX P Adieresis -78 KPX P Aring -78 KPX P J -78 KPX P a -28 KPX P aacute -28 KPX P adieresis -28 KPX P ae -24 KPX P aring -28 KPX P comma -135 KPX P e -31 KPX P eacute -31 KPX P hyphen -40 KPX P o -27 KPX P oacute -27 KPX P odieresis -27 KPX P oe -28 KPX P oslash -27 KPX P period -135 KPX R C -16 KPX R Ccedilla -16 KPX R G -15 KPX R O -13 KPX R OE -11 KPX R Oacute -13 KPX R Odieresis -13 KPX R T -23 KPX R U -17 KPX R Udieresis -17 KPX R V -39 KPX R W -27 KPX R Y -43 KPX R a -15 KPX R aacute -15 KPX R adieresis -15 KPX R ae -12 KPX R aring -15 KPX R e -12 KPX R eacute -12 KPX R hyphen -2 KPX R o -9 KPX R oacute -9 KPX R odieresis -9 KPX R oe -11 KPX R u -9 KPX R uacute -9 KPX R udieresis -9 KPX R y -8 KPX S A -22 KPX S AE -22 KPX S Aacute -22 KPX S Adieresis -22 KPX S Aring -22 KPX S T -28 KPX S V -42 KPX S W -28 KPX S Y -48 KPX S t -3 KPX T A -95 KPX T AE -97 KPX T Aacute -95 KPX T Acircumflex -95 KPX T Adieresis -95 KPX T Agrave -95 KPX T Aring -95 KPX T Atilde -95 KPX T C -44 KPX T G -45 KPX T J -100 KPX T O -42 KPX T OE -35 KPX T Oacute -42 KPX T Ocircumflex -42 KPX T Odieresis -42 KPX T Ograve -42 KPX T Oslash -41 KPX T Otilde -42 KPX T S -24 KPX T V 12 KPX T W 16 KPX T Y 20 KPX T a -100 KPX T ae -97 KPX T c -90 KPX T colon -133 KPX T comma -100 KPX T e -95 KPX T g -89 KPX T guillemotleft -121 KPX T guilsinglleft -117 KPX T hyphen -77 KPX T i -3 KPX T j -5 KPX T o -92 KPX T oslash -87 KPX T period -100 KPX T r -92 KPX T s -92 KPX T semicolon -129 KPX T u -91 KPX T v -95 KPX T w -93 KPX T y -100 KPX U A -36 KPX U AE -39 KPX U Aacute -36 KPX U Acircumflex -36 KPX U Adieresis -36 KPX U Aring -36 KPX U Atilde -36 KPX U comma -27 KPX U m -4 KPX U n -4 KPX U p 3 KPX U period -25 KPX U r -4 KPX Uacute A -36 KPX Uacute comma -27 KPX Uacute m -4 KPX Uacute n -4 KPX Uacute p 3 KPX Uacute period -25 KPX Uacute r -4 KPX Ucircumflex A -36 KPX Udieresis A -36 KPX Udieresis b 3 KPX Udieresis comma -27 KPX Udieresis m -4 KPX Udieresis n -4 KPX Udieresis p 3 KPX Udieresis period -25 KPX Udieresis r -4 KPX Ugrave A -36 KPX V A -71 KPX V AE -78 KPX V Aacute -71 KPX V Acircumflex -71 KPX V Adieresis -71 KPX V Agrave -71 KPX V Aring -71 KPX V Atilde -71 KPX V C -43 KPX V G -42 KPX V O -40 KPX V Oacute -40 KPX V Ocircumflex -40 KPX V Odieresis -40 KPX V Ograve -40 KPX V Oslash -33 KPX V Otilde -40 KPX V S -35 KPX V T 15 KPX V a -59 KPX V ae -55 KPX V colon -66 KPX V comma -89 KPX V e -57 KPX V g -50 KPX V guillemotleft -83 KPX V guilsinglleft -80 KPX V hyphen -38 KPX V i -5 KPX V o -54 KPX V oslash -50 KPX V period -89 KPX V r -42 KPX V semicolon -66 KPX V u -41 KPX V y -20 KPX W A -50 KPX W AE -56 KPX W Aacute -50 KPX W Acircumflex -50 KPX W Adieresis -50 KPX W Agrave -50 KPX W Aring -50 KPX W Atilde -50 KPX W C -23 KPX W G -22 KPX W O -20 KPX W Oacute -20 KPX W Ocircumflex -20 KPX W Odieresis -20 KPX W Ograve -20 KPX W Oslash -13 KPX W Otilde -20 KPX W S -24 KPX W T 19 KPX W a -38 KPX W ae -34 KPX W colon -52 KPX W comma -56 KPX W e -32 KPX W g -25 KPX W guillemotleft -58 KPX W guilsinglleft -54 KPX W hyphen -13 KPX W i -1 KPX W o -29 KPX W oslash -25 KPX W period -56 KPX W r -28 KPX W semicolon -53 KPX W u -28 KPX W y -6 KPX X C -48 KPX X O -45 KPX X Odieresis -45 KPX X Q -44 KPX X a -15 KPX X e -36 KPX X hyphen -51 KPX X o -33 KPX X u -24 KPX X y -61 KPX Y A -96 KPX Y AE -103 KPX Y Aacute -96 KPX Y Acircumflex -96 KPX Y Adieresis -96 KPX Y Agrave -96 KPX Y Aring -96 KPX Y Atilde -96 KPX Y C -58 KPX Y G -58 KPX Y O -56 KPX Y Oacute -56 KPX Y Ocircumflex -56 KPX Y Odieresis -56 KPX Y Ograve -56 KPX Y Oslash -54 KPX Y Otilde -56 KPX Y S -41 KPX Y T 23 KPX Y a -88 KPX Y ae -84 KPX Y colon -87 KPX Y comma -111 KPX Y e -89 KPX Y g -83 KPX Y guillemotleft -123 KPX Y guilsinglleft -119 KPX Y hyphen -84 KPX Y i 3 KPX Y o -86 KPX Y oslash -82 KPX Y p -54 KPX Y period -111 KPX Y semicolon -88 KPX Y u -63 KPX Y v -36 KPX Z v -33 KPX Z y -38 KPX a j -4 KPX a quoteright -23 KPX a v -21 KPX a w -13 KPX a y -26 KPX aacute v -21 KPX aacute w -13 KPX aacute y -26 KPX adieresis v -21 KPX adieresis w -13 KPX adieresis y -26 KPX ae v -16 KPX ae w -10 KPX ae y -20 KPX agrave v -21 KPX agrave w -13 KPX agrave y -26 KPX aring v -21 KPX aring w -13 KPX aring y -26 KPX b v -11 KPX b w -3 KPX b y -15 KPX c h 1 KPX c k 7 KPX comma one -100 KPX comma quotedblright -41 KPX comma quoteright -50 KPX e quoteright -18 KPX e t -10 KPX e v -15 KPX e w -9 KPX e x -27 KPX e y -19 KPX eacute v -15 KPX eacute w -9 KPX eacute y -19 KPX ecircumflex v -15 KPX ecircumflex w -9 KPX ecircumflex y -19 KPX eight four 1 KPX eight one -48 KPX eight seven -33 KPX f a -9 KPX f aacute -9 KPX f adieresis -9 KPX f ae -5 KPX f aring -9 KPX f e -15 KPX f eacute -15 KPX f f 22 KPX f i -2 KPX f j -4 KPX f l -3 KPX f o -10 KPX f oacute -10 KPX f odieresis -10 KPX f oe -12 KPX f oslash -9 KPX f quoteright 0 KPX f s 0 KPX f t 24 KPX five four 1 KPX five one -76 KPX five seven -26 KPX four four 5 KPX four one -84 KPX four seven -56 KPX g a -5 KPX g adieresis -5 KPX g ae -1 KPX g aring -5 KPX g e 0 KPX g eacute 0 KPX g l 0 KPX g oacute 3 KPX g odieresis 3 KPX g r 0 KPX guillemotright A -50 KPX guillemotright AE -54 KPX guillemotright Aacute -50 KPX guillemotright Adieresis -50 KPX guillemotright Aring -50 KPX guillemotright T -126 KPX guillemotright V -93 KPX guillemotright W -66 KPX guillemotright Y -133 KPX guilsinglright A -44 KPX guilsinglright AE -48 KPX guilsinglright Aacute -44 KPX guilsinglright Adieresis -44 KPX guilsinglright Aring -44 KPX guilsinglright T -121 KPX guilsinglright V -88 KPX guilsinglright W -60 KPX guilsinglright Y -128 KPX h quoteright -15 KPX h y -18 KPX hyphen A -7 KPX hyphen AE -11 KPX hyphen Aacute -7 KPX hyphen Adieresis -7 KPX hyphen Aring -7 KPX hyphen T -80 KPX hyphen V -46 KPX hyphen W -19 KPX hyphen Y -92 KPX i T -7 KPX i j -3 KPX k a -2 KPX k aacute -2 KPX k adieresis -2 KPX k ae 2 KPX k aring -2 KPX k comma 0 KPX k e -21 KPX k eacute -21 KPX k g -16 KPX k hyphen -41 KPX k o -19 KPX k oacute -19 KPX k odieresis -19 KPX k period 0 KPX k s -3 KPX k u -11 KPX k udieresis -6 KPX l v 0 KPX l y -5 KPX m p 5 KPX m v -13 KPX m w -7 KPX m y -18 KPX n T -96 KPX n p 5 KPX n quoteright -14 KPX n v -13 KPX n w -7 KPX n y -18 KPX nine four -3 KPX nine one -43 KPX nine seven -37 KPX o T -99 KPX o quoteright -21 KPX o t -10 KPX o v -18 KPX o w -10 KPX o x -27 KPX o y -22 KPX oacute v -18 KPX oacute w -10 KPX oacute y -22 KPX ocircumflex t -10 KPX odieresis t -10 KPX odieresis v -18 KPX odieresis w -10 KPX odieresis x -27 KPX odieresis y -22 KPX ograve v -18 KPX ograve w -10 KPX ograve y -22 KPX one comma -74 KPX one eight -65 KPX one five -67 KPX one four -81 KPX one nine -65 KPX one one -118 KPX one period -74 KPX one seven -90 KPX one six -62 KPX one three -67 KPX one two -69 KPX one zero -62 KPX p t -4 KPX p y -16 KPX period one -101 KPX period quotedblright -41 KPX period quoteright -51 KPX q c 8 KPX q u 4 KPX quotedblbase A 30 KPX quotedblbase AE 30 KPX quotedblbase T -75 KPX quotedblbase V -69 KPX quotedblbase W -34 KPX quotedblbase Y -91 KPX quotedblleft A -52 KPX quotedblleft AE -64 KPX quotedblleft Aacute -52 KPX quotedblleft Adieresis -52 KPX quotedblleft Aring -52 KPX quotedblleft T 9 KPX quotedblleft V 15 KPX quotedblleft W 27 KPX quotedblleft Y 5 KPX quotedblright A -53 KPX quotedblright AE -66 KPX quotedblright Aacute -53 KPX quotedblright Adieresis -53 KPX quotedblright Aring -53 KPX quotedblright T 11 KPX quotedblright V 15 KPX quotedblright W 26 KPX quotedblright Y 7 KPX quoteleft A -67 KPX quoteleft AE -79 KPX quoteleft Aacute -67 KPX quoteleft Adieresis -67 KPX quoteleft Aring -67 KPX quoteleft T -5 KPX quoteleft V 0 KPX quoteleft W 12 KPX quoteleft Y -9 KPX quoteright A -72 KPX quoteright AE -85 KPX quoteright Aacute -72 KPX quoteright Adieresis -72 KPX quoteright Aring -72 KPX quoteright comma -60 KPX quoteright d -20 KPX quoteright o -26 KPX quoteright period -60 KPX quoteright r -18 KPX quoteright s -18 KPX quoteright t -7 KPX quoteright v -2 KPX quoteright w 2 KPX quoteright y -6 KPX r a -5 KPX r aacute -5 KPX r acircumflex -5 KPX r adieresis -5 KPX r ae -1 KPX r agrave -5 KPX r aring -5 KPX r c -6 KPX r ccedilla -9 KPX r colon -22 KPX r comma -69 KPX r d -1 KPX r e -11 KPX r eacute -11 KPX r ecircumflex -11 KPX r egrave -11 KPX r f 26 KPX r g -4 KPX r h 0 KPX r hyphen -47 KPX r i 1 KPX r j 0 KPX r k 6 KPX r l 1 KPX r m 0 KPX r n 0 KPX r o -6 KPX r oacute -6 KPX r ocircumflex -6 KPX r odieresis -6 KPX r oe -8 KPX r ograve -6 KPX r oslash -6 KPX r p 8 KPX r period -69 KPX r q -3 KPX r quoteright 1 KPX r r 0 KPX r s 4 KPX r semicolon -22 KPX r t 28 KPX r u 2 KPX r v 29 KPX r w 31 KPX r x 20 KPX r y 24 KPX r z 9 KPX s quoteright -22 KPX s t -3 KPX seven colon -77 KPX seven comma -119 KPX seven eight -28 KPX seven five -30 KPX seven four -93 KPX seven one -53 KPX seven period -119 KPX seven seven -4 KPX seven six -40 KPX seven three -23 KPX seven two -28 KPX six four 1 KPX six one -43 KPX six seven -30 KPX t S -8 KPX t a -1 KPX t aacute -1 KPX t adieresis -1 KPX t ae 2 KPX t aring -1 KPX t colon -28 KPX t e -14 KPX t eacute -14 KPX t h -3 KPX t o -12 KPX t oacute -12 KPX t odieresis -12 KPX t quoteright -1 KPX t semicolon -28 KPX three four -2 KPX three one -49 KPX three seven -33 KPX two four -37 KPX two one -36 KPX two seven -25 KPX u quoteright -8 KPX v a -18 KPX v aacute -18 KPX v acircumflex -18 KPX v adieresis -18 KPX v ae -14 KPX v agrave -18 KPX v aring -18 KPX v atilde -18 KPX v c -16 KPX v colon -23 KPX v comma -69 KPX v e -21 KPX v eacute -21 KPX v ecircumflex -21 KPX v egrave -21 KPX v g -14 KPX v hyphen -12 KPX v l 0 KPX v o -17 KPX v oacute -17 KPX v odieresis -17 KPX v ograve -17 KPX v oslash -17 KPX v period -69 KPX v s -9 KPX v semicolon -23 KPX w a -15 KPX w aacute -15 KPX w acircumflex -15 KPX w adieresis -15 KPX w ae -11 KPX w agrave -15 KPX w aring -15 KPX w atilde -15 KPX w c -7 KPX w colon -23 KPX w comma -50 KPX w e -12 KPX w eacute -12 KPX w ecircumflex -12 KPX w egrave -12 KPX w g -6 KPX w hyphen -1 KPX w l 0 KPX w o -9 KPX w oacute -9 KPX w odieresis -9 KPX w ograve -9 KPX w oslash -6 KPX w period -50 KPX w s -5 KPX w semicolon -23 KPX x a -17 KPX x c -23 KPX x e -28 KPX x eacute -28 KPX x o -25 KPX x q -20 KPX y a -22 KPX y aacute -22 KPX y acircumflex -22 KPX y adieresis -22 KPX y ae -18 KPX y agrave -22 KPX y aring -22 KPX y atilde -22 KPX y c -19 KPX y colon -27 KPX y comma -70 KPX y e -24 KPX y eacute -24 KPX y ecircumflex -24 KPX y egrave -24 KPX y g -17 KPX y hyphen -14 KPX y l -4 KPX y o -20 KPX y oacute -20 KPX y odieresis -20 KPX y ograve -20 KPX y oslash -19 KPX y period -70 KPX y s -12 KPX y semicolon -27 KPX zero four -2 KPX zero one -46 KPX zero seven -39 EndKernPairs EndKernData EndFontMetrics gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019003l.pfb000066400000000000000000001062721404163720200220730ustar00rootroot00000000000000]%!PS-AdobeFont-1.0: NimbusSanL-Regu 1.05 %%CreationDate: Wed Dec 22 1999 % Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development % (URW)++,Copyright 1999 by (URW)++ Design & Development % See the file COPYING (GNU General Public License) for license conditions. % As a special exception, permission is granted to include this font % program in a Postscript or PDF file that consists of a document that % contains text to be displayed or printed using this font, regardless % of the conditions or license applying to the document itself. 12 dict begin /FontInfo 10 dict dup begin /version (1.05) readonly def /Notice ((URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General Public License) for license conditions. As a special exception, permission is granted to include this font program in a Postscript or PDF file that consists of a document that contains text to be displayed or printed using this font, regardless of the conditions or license applying to the document itself.) readonly def /Copyright (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development) readonly def /FullName (Nimbus Sans L Regular) readonly def /FamilyName (Nimbus Sans L) readonly def /Weight (Regular) readonly def /ItalicAngle 0.0 def /isFixedPitch false def /UnderlinePosition -151 def /UnderlineThickness 50 def end readonly def /FontName /NimbusSanL-Regu def /PaintType 0 def /WMode 0 def /FontBBox {-174 -285 1001 953} readonly def /FontType 1 def /FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def /Encoding StandardEncoding def /UniqueID 5020902 def currentdict end currentfile eexec 5 `,i"[[5j5mTʻ^+݄fKitrޟm%9۩*++`[&NfA-O!J"|UY+; <Ԟ2?.P2QhnDtw=y0)n*[ Y]~ ΁RzYi[AXm>nc5+\3v,I5L:vL$l۬:s" aS㘧Ĝ;@QcIzL6kGy姽򱠧 裳ZfcY 0@\d"CK# ْ:ˣntsgAhx/R e'R>{q¹ñ'XJ<2u_l1H5GoqAjL.=1@눒u:lN:ݶoWoO)zX&wf\RsR7Np¢_[ d+m)f4dIm4b})yVE[ C1 +Ny<:Pa 4cfϤl4cÄchhUnߔDJ,kMjȍr6qtLAc$3TQ2ˑ2xgt7QlFx 3A4IF;@4i]=UW2}_SE img@H K,|zlmr+EiP~W439 >P*UzlW?gf^bU:8bnsBγ;Ldb;x+[D*@d?깙i~ӽZ䖆c&Cٛp3ڀDOɮhra.j3%*QΩ=ͽpx P)x;\: CevT ??GHBo*18) 80.#`lY!d;0uTeAr9Xh:m@O '̂ytnn h ۘ@mbF- LRPͨ26af!.;B*; GP'K(wʞ?Y h ^f(9Ė^}OçzǏ€_F25f rƮvm,Gy%M͐䠉q>f]7^pCQz4c#P񦸶WMNaύte·j;h쌞]XQ_@쒓۷D[m9). )C:<:(*ao x3p1rPa|0͉RT^󀕍I ( n+!c@YSsU#;dw |m7&tafV/ڻaŗWEUqZ^Y+u ].#i}, }Q$H`Dկ\,. i+*N;SDDŽ;HvFκ֒F*-o|AƊ&z]m!M tGok.5[Nɗcw5`{|}Iͩ*⤟Τ: sŘ2}` :&{Z;uUb Kw+V7S >\͈E ^OߚiG-x @faF%SUFX,.q2Szb co#OK3S{d}q@o9/ukp#"肥g) 5jh9򕜧5"Sv'\_F7E y[;N`=!1QK_9&Gww 87eSxZQ̒D"sq4'ٯiAoQ Q*{|J;v!hTҘ? Wc$D8 E_}cj٣ u >ΗskXq0m\'\9 @#[_@P(cq UBu3)vV޶ _TSZs56Y=] |c B( >s2:|AӴpdŏ/'"K7$͈֑QDAg`R'mc`aM1UmI0eg ,'Cʉ,g`O8}n0Hy%򞫴ax5"P ~ '8̭^ifjlپ@ v4!w ;[D %i>Ju[(Q*İg i4>ǔBv/QZb e`5pᱵ qX'qXnU4G Mx;{؆M9cB=GLQ_9&퐯 0^8jK|}s~ :hk8WX'KlL4a{6-p;Ok5i)̃"Ql1 >ٿsCG^^.v$;! c9`Ⓦ,9p@jht\0 goFGɠ68urR+ޣ 1Ah2l?mSM14y7@zs5NFKՋbИ46h[ ,=j[Ϳ-gQ^>wyu._!#~& UI ḫ=?A8I7-pƕzAܹQ@†ZB[v.&\ݘbU1t;:>߫=ʯ % ҇^lā}sPF>d_v߃DҾAS@\E ܠ`莟5NyƷ IHweZ Н:F,\>)b^+ 0s/B'n] dk{^^H/c |sw!a,L n?=9-zDȋي0b͘p= NWx1($o޲yS(`Q9X}R+LxpdnP'-}p-s> _zY@/y%ҭ"]Q%I9>S9ۊ< @ qY s X 'Wé &|B1i|/7g+⿎&}QU%PqNu)ED;iN/nd!0x4>U;_-^A|p-`iy.Tޏ|q2+wY)$bdSO4 ꢇ{X>l)БzD'(&"lvDX]o͓V2] txű.n /%Sz:(:oo%M*tg"6a D&;$U?Voe H !> U49UN% Hd!$)c ,7_GR+:Ǭ~Au+I .|4նPޣx06ǫi| l,iM.l[NzӼ^f$2UCҀ$FfV"ɶ[HPUk;"=(qV&ׯ`/枺ҋ=TJrn7XU{KFډ;dL2/"ĻL f\={:Wɮd8Ma˷Hz}(9@v _[DlF;ZAgʜs?Ўr;|iЖce ~E ;t)Ϯ}Ɛ[*CRH4Ot]`kt-5*gi b\}_mぇ.(?T 5p# jh`}KpSE;SN&qY*df<@)oh-~0~(҃u柔'.1ڍ5;"\ǻFe>X$KA9A:?ؤ'ͷf ݬUNZn%']`^b.V1j\pJIBm(Y4]6V|oݻ,ݩ3HI'9jDFԧYH( L;7C}˱H!b`ihڗj]Բ7<cC@Em"fUK"<ƨf ջKj.[`9ft_bYij^Cu@F@ٓ|pnBY.;3&-@2 peSCx-9è+NU ?f/xFG9)R|bz?,/Ѽ 1^$qk sSsՙfsQG_W*C86`S48wqmol~T&۷ W"-JAsa m`5;F(@7:|Owa6FBܮa6]}~kn>J`1O1Ձ#M?)_f0ƽj4lÀ :eZ50p;LPE1xYpԳ,$h/7Oq6۠3y1*O/ӗwr$/-GGJ`s+zNj%+WJtլn30EJ<\ˉI%2]-Q٤ƴn 6V򒊲u|3gB_)oH?Cվ]bnw)À[u31xSIʃ7Gh;w?%BW5pEm C^YTP\u`p&ҳv .F[܅F5馉$'SPo x!D,Dž-z߽QK~IfEHRcT؈B{eQ&!۫l. 8xZ{ Z:?×)Y1+7liSZs:ؘ0LnC1oErU͆ ?Ƭ6p٤ȶu 5%swKW&ʦ[YZKf `ґ>N2O^[bUQA^) j-Pm'bGeؙqU4 dGM]xq!9';]d3u2SO|P*7OCڡr9: G$/6T ϹVOf蹓ap 9pd&!ne@բ`,lck(<&.; Mz>XL΍dc3fEs+L2zIAc~ PP4ˈGn2* SvZZU"њ-^B!UZ.m ܫ{XZaRQs1&pky)xކ.I;zևKN=,;!aoy=1}f`㱊ErWJ;!w?>߮ ԶmQt0 a隲YykJ RpH]uAzDXdI7Z`p^nf]RF>6'gѩO  ^ hQK"h?C L"b挧*$5xtI}QvT%uvU2kc^59u]Qk!x ʾEf6lJ?.,e/X V*Dƥ9e07O+n2Fy_OV9 lYW5=`i++n:IAT?c{Dv~]1x3WFO-*M{튡d>M/7>I054%-0EYXП6%7Uܕ!>!2m*EQWQ~ Աgxg^XN`V;hc0%kFsC0ﲻfYu=41P{LDY`دi[H8N )KW6v;4oLpz\w{soGUVq]0QrɤU*ypA[4cm*FxÙhRG5]%5)XZ<* PQL|Ƞ`M}%}d}"c_ ؎ B1$59nm#QNroAz_%N)ϔaq\ûa vLA1WLUƼUspn1 T6$#Nwʬd"Y8yGzQVu]7˴/8W% ?w.j HRr Wdr׫fI#3p[wERz^3i 5IYFE]1~nCRY.Z;lKIDf(ٞ$#MdE7 ? sq0@%y@?Z^ZAלlʈS m6hDP.Od, 4%oxԔrHg5.R%&T4C~Z"B^#dUIB*O7.]}# lG3/LZ@,y k|_Xݶ5+F 9}EM;,֐s!T`T~AmU!7n0?Yy<ۓ)^Nvb1M{`ů)KbNzR8#iW)9U8ۨ>f,$}YQb~gcX,ˌ5닪 O-qd@AƙۭzեK3>GQ1#h^D>Fi2*_H@NjIlJc:Sp7$\ >[ξ3x `^]l4߹c:Iv&!J.m&5VZK5&yq)걄 "ʿi@pbPv?o?-1ps6]n# &3o;,3_@0kO{gK@tVʍ֟Q>+A+fGo|$hҭ+X@(Mj8dl$qJR#~: 8PDhf9EPLo C|{Fr+wE@z55Bz,1)ʠn[pjuruHڸ}ZOmz&UϨd(ovn'yAWK K4 0+#3_JDζvWFw[+ 8~AU:F[  HGq#‹吗U$@]+ Gǻ2`m_Ot7ō-ڼ|GS+Kk3)5 BFCJ`G~ʡ.!ꆨ.aUpOe"U.(Čvcn0 eUzO< 8KXн,ll@;gL/9:yֵ;m$$aJ+/l: <ς!.*E<6s;P>e HN&na(9U1]už=XV<_wI6g+ܛ56R39AE| -È63mpfZ6SY6 kOn?yK$S =JWma'%NI Ź&Sg!):+ٓ9A' nnj% bHvܧ&QyT/w?$@ "kӦ0plBwadO%z#XȽ9ƲvH'"$Yh9 Tg&ZOYT*HX)+}/'-:9%(^O4wI%IQ>0L$̬%n,pb#Rionp;*xPOy0ϼ[j$vL 1hSDk! y)/z2jo( C$ʆVVsb)OQ>TOdGDqG5里}~+fT `ŽX^H}RPu М.’L դj#SĚe5K='z>\.QoK,-@,àiCBd΂QW*g=&4N, aD¯ &R+K_كd5|~̠Ğ qO۵VpHC0ܷkF>aצT:-x[FH e%WvR?(imK~0誁1ܜTZ%cuF3lwZ‹랼~]>n|$a1pj2 ߟR-&Bձx ^Ga0$tr{HU%fIZO5Sz#C} A_`u!.>08/l5nk@o_酭JGX{K~l0oQNvg(E*ZٱSdLbU7?h{4iĔ(4Y8M,A4#gdm_ÌNzNW.BӻyBiA2\#J"ָڴ,t.`d(~тE)TxV)`!|2\3DHX֘ k!u~4f{JCVY) -~ʓjV9]ZyGAA8\ +mOyz]ڰv@{F W ?ʢTY7] 7#k?՚y{,V"'u:Hq)?a4j:`cYdY4IVuKwӃko7 g|EhxL]h Og -W^\Oa$|%$vVFCk]^:JϡłF##cSMp 7|9 gg}DfE!-MoH֣K߬aO1>yvIA|[V&KlY{PZ q,2_{(&T (S 4UsED%q&Ž­ uąΧN鎕wޒ  @#^ht_sVT䇰q4P%)fWowp;S^vz59?i+zho֬"2O..2(~.2q qST(~(,"l#v(%%!nx+/ȍܧ5@r\W.nT^33ϚRBIT_=@TfZB9:XԻ.w60e\am5߅z*'+V~N 9.`q`z=7 \AmY ۪3 jwN$DR32Mm MrSUsz?Tst%a-)hy!w`:/k`_x۹TeU2 3=1l vaaتL]`T~~%p5IX^$]~尨MC8%w 16hLț+017͋5Sm-0~Nx@AbR?SJ?&·j!`t F.1eVwnnDȜS˳r0at+'oQn03mhʥ1YȚHb\IKdi}Ԗ@&'iyzUTH.‡x7oϐl'ɴUBׇ 1]з* k(EՉyiXJ?lG:[ I=buմr E/^)>Vzo] zڃ(b砾mzpbk2>UC24ȟZwAP!al '闋7׈ 4ػ@gv M'lUdE!XN) sc!{XxBeCw=T;I+p I  YX5p`v/L@0Wm"zB.;Wxu)TT{G}c~ 8%)ɓ,KY]k̴q86}i ǁSS)%\?wIFnuzcX.S׮#9>I1p$wWe6[_e̼.$23M}L$SӮ"6b >ɦYw7H᥎|QdNS.r`Jw\Eix !۲ZfA).L3DaPc:)Q km+.ʮ阉&gZb.~3=^Di Zʄ"0tro++S}wc cWlvܻϤV/e‰ A=Kn7+@!!RB'Fm:!CB=lZZƒt0:f @c,90-];~<*& H? UI'OSv Aff`2U*jߨ]Fx(F#'F8 A; 0S3ȱ@'7?s|&TN\RfU mȯ+,,UT []a,Dv棺<ƈ3M(UfC߸Jl IkѨX]Rap|Պ-۠3y;rC\:@W͔lpWNM#M#[_K#+F%i{/&كEUAB>T^yv4eyBO~&Mr:EI[Q-3Y,ؾo /pN nh ?늺T?oj9}!j,Q29k^'vsQ^[Ӌ.dJzoUı>Z l:΀eT=~ny.xL\6 (.y??='A욾. â43S]Cxۙ.{{)ow*}eSG=vkd/Ʈ{ӔD}zԿ(šW{[\q*?Ň4a6+B>SLJizpQ< T9)vr-# $MZH%;zaa%yj?+]4(.&<岯 (~Dq>Hduij|%T+QGvLew[mQ:uy][]@aŰ n i(% .3( -1ZGm.+XP3mKg?zR-z"V|_f\v*Bf69 ;{k覊1v+p',m4ߺ`M f)o0^0A' zU-岙{IӮb(ԅ\mR9Tz({\eޯ>W3XsV~g*[EʈzP}ũNH>*x4̚\2tuRX:\-b5 %׼"Оze}q6g3nEDqIM {yPB=lF2Ƒ_~GICVn8Y[;"zDdoaAq˭$g~`=fZ"HH;4k4cL t8LfYc@G/t;w&ib).gUXJ1!~2Q`^y EZd=뭵cQmj(,W 3w}QpTmLY۟2e-05t,bm+{S(RA9t^1&Ng.`Gcη7Mӽ,j"g46}?ɸx~_CPtNK݌H뱄K]mXn7{2NniУHUc%ry0(?=XR5nN9 _$LxqS횒A-I84K6N[r^X!9Q|赚ʃR3@ ȇT2Va'(+?Lu.r7/(CPԏ=o_[]dOS3>o mA KR#9TPf7]-^TMߙ_*v;u.Z03E MƧ4}ڧ)~>v<ؗF3]AZ*m\6L1]]⮾tT7a"x4劌73b.d7ΏU/͵tؘl 8W'OVDgdнV9@B^C!yt):Vc-®&~d˺IzP\v14(D8`=u2Yi0ѫ2jX#=̄q Aq%yE9@\6餋犅̠Tȫ{_dЌPm bft2-Ma!SKH76 Ĭ-4,TK& 2Z_΋ CDL??M!7;o\o0Ldd Ny f )M8_2[Ȼ짐 34L1o! Pg{GD4L2>Ol1Oр?dTiGk2%SLX7P-hchB=F:bƓCeh8|cPwQD7 WC^޻x@`TQt}ЄKY!;jrKod0R.`4|JK5Oeikm{,;BU, Yl j|i h:xln8O3_Q Uʋv "^>O :7]=]S\5繍נp`,;vy[TZbU'Ӑ,+#1&6;- VTv^4HaQB1jzF˩rD { bM+TO|?AݗpZLJE* G&6t4UnbfjtYOuQ6ٹp';\2ikm(C?7d`T&  Nf9e{>X4xpxt-VHH`Il8  QJf'vc9YdpUE@YGa/,m:W% (5O|rkxb6E1OdЬa(Lǣ4Rʛ<͞s1c;Z$3i[Aޢ 7*΁Mς?k'0:_m"0@ڧM]N(̣Jџ[\7T|:C|n+uFgC"6swW0.ϹrR  q wBd;b­*~+D7*Z/C,'^' +[xaQn;|*S(3 dWVZB+ T2M=g"uت1NXVkƩN/ź\1HYҦB0mAcTzM D|n KH!E_<_"!RTe3xbtݸ V=x.)A6Ow(Û?/<&$ d/Ȯ[Y;oqy`K 1&=`NS {MC~1KF*^!\P^AkA ၴ,7{vRN*WݾVVUœ+ }npj1ts>3|v_6Ft-9V\{R#z7Rs5?@sTUI;7&WPs*E$7syvs0o}<gHmI3G%ʼB t5|;#)*!{ﮛSnSXz < K\~_h*2xdd`2.ل*WGw :" :ϏJBb`?{šuvZqS&\`ӻkfXbK,Xrׁ-RY~Z}-hGd*S4^;7ap|Cۓf.d;dkjkE}`a:ၮ I3PCmeU*Ovj_ ~;u0)cnKr9wxWOx(<~}a րRE贆.{T b1s%OR#J7~0{5m?">O# U|0R#8krw+z qfPR!i6-B!n|)׻zyG)km3 {뼞qra^8h⹿@nKWopUEU'Pj2:vB {U{XfYqs&Uĩf{v(/cMݒt w*MQۻbܶYC4ϔ6@L윰)DئPÔUYcͅmg~ȧxsygBȔ. Q̵<n0j{Y0a?:ƕ'J9 .KTxuOq[tؐYգ'G2aHKl"${yzF_۸]~DdsWOJn+g EA7{yU#, >+'&Յp¹}oUlMhwU}C*svR8>MY6ζpo8g6qx 6feһLmz'\_z1$XB,<`N?⸣1:VO:M;ʼnǼ~=ɗ[<6əoF%Sc>€V砄g/0"lwx> {BwCkԣ>S$Vh0)[r 6)Io;'wz6%` P}V`mֹZuMj򚺺/U%ôFWF=>?e}P3In9ZG s.]1)M\я%>+TEw/gF%cDTL Dj>_SqW!%-thsN`|FĿr{ Tg|U!`5=mQΚko;^D3V'^70<W^GfFVGڑp5Gs$R:1*t%ʐVu.qC|%+E|qLU :d,O[Kof̣=CP,!#FXqxz\<3B/͉3vqRٶ-D@w0TR miBRW0x6/#YX! %yrR/-ִh`T-DB",G6V~{­0ݺŵ^%(,}W;~W*GjY [4Q&MSHB d)m4_>Vgs` ):q|x詮D[L~ ê}A==|kelХߎ/fؼ;hm'D?R.hP/ZJ-+ C1.jad/S͡V)pQ\V&@@c2$ᚠVc\7^غMjd]ڱV(,Ukug# X1f?w}F3N)7J2Q0$ VV7͝C1V'P@KzEE˅8rUBʁ %w _QHw/Y!<_ܡڑ//.)ZxX]}ئ7c 9?'hD/] lV[R\EQ3 ǁ>υ<¾ݤ.a%,nf K1䮏Bu=u*:>$w8.,gؓ2.D^a?ˎx^8&GÝ[~871hHv@"\6A=r|UIp/^k)y8S- Ȝo{$C>]l }i3NYJށ|01b:Ɲ=?{捴8_W>$.leGqlE-]_(+#ĐFC mpa[Y~I2F;8)tKތ9c 4:_ ZfY9:?g\" ^8<7YJf*l|ZyGaS/dZU_4^G3? GҦI-֐:E~<,]ZUnM}I*e2E0fg[MuosS40b (Ѝ,iÈ0-C&ԝ(@ q` FU\jtNMĦrcQ]2 z0S:/߆0UXiB<7(Z=vĎYmP R( V=` GQDv.Kfq=A0?ׅVVO1Τ5E9u5.2tu\3LpM1c+˩:'o4l=.@d5`]ZZc7dmԷ7nbJi,+{ٵLq+~ϫkZYߴ6KN-ʞW~ɆC~ j2Ɉi)E! wԍ CiVȺ?sr_uw$n3L;@VE `r~jIn|w: ` iK{%Jø0E}1:5^{bTUv:C}VRYJlÿ́sJQ OEjz{Zx"lj58PE93vZhi:l=B2ceO2P0%M^nRc!&np]h\Evg uw/F##C[eE$dPVRJ4UD &KTt3˲IRj!u踯 = d?i@bDB'8?*UͰNPvYX8jMb.P܆&wJL), LKϙ݅Py5yQEr׆ijر) CT)nױzY۵754f?lDB7z4)龻BpF<쵻[r Fr j# C75&U |=z4 )NKCM/c<~Q8eZS`[8 BWj`hfK^ďz¡a DLou JPA-UJ`+aEȵKln@3ָ,kH` [Ԡf"AoeytExxFz_G{xQr?/b1lloJwf ihkYiCOG̾˭pn#6Q! Z/~j,ĶB`WwzM>k̰@EdpV崙Xk*Zw6DH0Cw A^ zd$/_9SL]9!ifP(/Ɖ\(ƺbf@qO6TzVXX:ÊPNPm }(ʢQ,aIX^P9 ٢63n$Pwz>#B$nd3*]|rB64ъ(A=i>`DzvWc<,A̩cɰײwOigKp70P}6% ,k_c`ڽwֈxc4mmiH(VPL ^8gmy]J5tr qi$}2ućzZ csϭZ^XԦ;Tat|Ddx/5cA#zw5 #ɮstytsvmLf5}|xűfǹ.\$ 7א: )"uugxpfb(:kN/IXhL5Gf1-z9Y Vs mpCUOlzg{Q9SN8;u|Y/*@όgJ!3v-#c Eʖi:e%X9dm?%#(18xtWm&)ڿSq{Ue{ZF冰Lz`߉mw½"[T>{! /MZ[.$roS5I\dH>'î/c{NUt?%8&!ݼޓrMcܼY(h@:|ߐ's韉ZT-xCޟ)eqozBi.cynu:c1Wn_  ; hûmD,T[:S$;VK2J01Aewt6|MASHHn[eLh~;6LpDO60%'@ <`G/eIg^%NdmF=.Hw,yQ8+q/;4P)ABt„]ڪhhADh][`b-Vϳ^ݏLdԹHP )P k^r{_FQ"nyStĞ_` FhnWAD31S XGQwn#]R5hqTmB(ڑv|Q@9͋D9\:yV[-,K .2ӁaȱUPOU$8|aæ񮔉*/P:!nI0CxY3J!^m(7Q׀ N&= #LX"%qUi MctiR{'NuQ&ŽyV)§xge/nnwMI``r+"l 7nKiJS#Q:Ej,.}ѧ*5HL 2{jMgsirHvaq[y!nnkslLtV6494ZZىFKR+rĥf.e:R|>K^h^>ѫ=9pv#5ԟq=Kg}%HWbb)'*!r W1+Ja]Sa"ȼ!C ~ 7+a p;xݴ#/#]^Ax݇We*J!OG;B @scħs6><| uig%/d܊{1kݡ ( a#K^ҜF%jx(lG+CH#ɑ%7.νw&~w+ )w"Ww:'5cc c'_G&5$E # $q;5=ψ?g;r{eLɹv_r vD,g Kxyq[+T`~EF?8=jq.ofh@wKx 7UI-12-} !CiSъW3Q"_"Z:D#~zܔ:FfO(ՏHI>ǽ0ĭmd42T)` Uv,hSZF``]8MQҟ V,reopl`}ėYs,5L*c6! huW\ ?'N'?LVXRW tQ4n8enϡaf8AcP AY5<0ON6c >]Y8 4Ԡ8B Um,0fP1 aYi;:A_2 ٮFӕXmZ6iR؅p?AO_2ŜLflڀëbI>AE,S̏0)юs'ZDaz肹ygͽ!dr*Z<ݥ !Ջ`qWnZ B5\|l5$9)2\ 6d9J?$i^(:UnPđ;l-L92  =&=aOeDa\6R} N"but4VPI\w'"DV6ԽOaWY*sb"jVP}$dQ3$Qa-EÆf#J9<}T4|e ?gxkN. rqʩKa2K?JЯv*1hS.:^wAܑ"[T¦Xː#dUyȏn9^sA#lk,Q\iRb7^/h36ƴX}6Cci{(0"^ɄfɊ`f"4/!F԰D1#fO;-^yF5k)ūfW;s a%+P#@$yݤ=Qs:jU `B8vݭ U;(U0%1ɀA2D74Rx ZA"#'HA kByeYV 41-TIG -s<q'狼ygWjA9+xZ fW2kHJ砙{\Bb\qHOδS%aݗ[!fD-"93=s(Zy % "Nn$DI}FOi'opGf;~MUDte5&(p_+aY]%v$Z0yވ%>BR2TpeS0j'g2 o\4-sX^MR[D̬yÓs\8gFҔo_u=S}c FfI6wZiXLMz)>Y9K&{NO"sݹۮ уJ0+`p/P<"@u֝7Ǜb[ dۦ-F1חMh/85HWbPc#c&MuM)6 LũC\iH)Hq+֧YcUT1M5>; vh/5i1 b{KE<\c{>zWcQ<}  dp&9Pig=ܭ-EN=ìJS:|!X:pǨ^suڏ^bu}Ѹ1̫6Bv-!2I:Fz?){@)ƋDZ[C7Ues`̣b[z `s6nfr/y9R,&%3=phdyA%uufOG<"[\?5/U ?$ =]?zĉQHh:#+Un!+VcMO| L)[*&i){C CCy$oYqGQ0L2\j$#"m1ј9A bw"`pe!h=par;95O3E<ʟOrQSo  sH}f6Og'JDL>%}DkG}fM?SfD. /"K=bP,%.V;+.8Zoz!']=KDԣR(' }\|^~Z9ut*p\'=<,*{x{ I(#!QfZ -=qxs͡ѡG,? gkĆŷKRGAXok.5|QlV.1ݿAd lΩ#;Ja E&:@شu G0䧖ek]챲;f&t#6B TIAiu)`Ŗ\]*hVYOB\W8<· EĄ8&:^b0u8ָJƀO80MtyuMg}& 8#Ǿ+X+ XIѽHBȀkx x!YJu Ѝލ˚!sFmp>L88%nW Dғ,@XULQbͪ4->)OY1gm?4Ԏd]\[A{ +bd0(m_~EgibK%9Ag@i[RS1hTJYHnx4O]ߚ,mpI_Dc=M˟8Q/&#N5H߿QsT6UWYV<;Sb]UEOL,g(ȋ8 ~)(Hmնp&)e5 jH޹dV%$sciDm@R2Vl˾>ܠ˙"GaƞeZBmIiPc7aΥ7b?Vi ARb$cQr6њi䥑q Θ;0u%x&`[01> p r[YyK?Xj178ߑ泦BߖzLwAL5jf5"mC:!)> 6!FJ'q@M¦Ϙo$Y$) v4#%eq"u08[H\OgeɐRe_}Oxf5M~Llu./)]Ek\h)Vo uOLOɔBTVvJ$'HOÕ:3Qm "m=7+.Q=S08ȓ{w˒幨q}.؞,o;F̾4eN&TՖ!ifv; _pN6@"dre 7->_+hnZz22WJB0_=l5)6j&3]+ m soEHb-R9}2lLt~ssR~RYy"h^io^QXLkȂv|nuNv|s%t"ijU=`3:< Jhn<1Z=8Adt!gbA#_Jpݰ8Eb[ADW ؀Y7MϪY:.1dRnm|YF ILK|׎V_JenJحIԏ/YPg &+&G܏ ><W0>śl?2Dkl1: }bbS\5BH5kH[VC}7`A@o%ї,0 ?Pe3?\bvT\TPt0 |K7m/DImIVNc-o"@[`~AsD,y$#9qIZn,gUgnZfh |ju!K3D!*פ+)ʯd$IXNtS,hsyrQFceڻQXks-1 $dv?}ZKLS'1s]]{DN 0栞@Z1e6 A8HBd:X@̀jwSx g97:T84a0ǫ4mL9`:j3'|G',@-çPm[ILa h`ܓLJ7b;KD,O@|^nQU~:΅: k 9:RK3A/_!\qAWxf[ {f5%yI׏11zjRT޴0zZ<[ACB*k5 hs|Sq_q|ؖXbG|ݎFǿ0Ixo@b3GԿ#Z1Syj5a끓'gP,_L(oIjw\Gd3BWBvvwB %'oC[ےkA扜4z~TƗ_LKTJ0#d\r{1Ax^W*{{j<mvgSKpn'ScUٲUNdKHr ֥z()]?krID-6Y_~>i 3U k$0PczQm.ߥԭ%&z*#R 3n"+[Ѧ}`((n-C|3;=Q7 |G+G|ٴB-#Q_Bc-??Ugx+_=G50"}>՘Ï(l=CH*i<a\PYU9eֻp44urTYk`0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019003l.pfm000066400000000000000000000111071404163720200220760ustar00rootroot00000000000000GCopyright 1999 URW Software. See file COPYING for license.op ,,  u, ~2~222PostScriptNimbusSanLNimbusSanL-Reguc,,yMMHM,,,,,,,,,,HHH,c ,A  cc,M,,,,,,A,,,,M,NNH^^^,M,,MM^^^^MM^,MM^^^M,,,,,Mr,H^^^H__M,^M_m,eeec     H c,,,,,,y,,,,,,,,,,,Hc,,,,+1,7,A,F,N,P,yT,U,V,W,Y,k,r,v,w,y,,,,,,,,,,A-F-K-L-P-R-T-V-W-X-Y-k-r-v-w-y----1.7.A.F.N.P.yT.U.V.W.Y.k.r.v.w.y..........10,1.101112131415161718191127213730414243444546474849415751676071727374757677787971878197:T:{V:W:Y:r:t:v:w:y:T;V;W;Y;r;t;v;w;y;-ABACADAFAGAJALANAOAPASATAUAVAWAYAAAAAAAAAAAAAAAAACKCLCNCRCTCVCWCXCYCCCCCCCAGKGLGNGRGTGVGWGYGGGGGGGCHDJFJPJTJCKAOBOCOFOKOLONOROTOVOWOXOYOOOOOOOAQXQQQQQQQKSLSTSVSWSYStS-TATDTGTKTLTOTRTSTVTWTYTiTnToTTTT T TTTTTTTTTTTTTAULURUUUUUUU-VAVBVDVGVLVOVRVSVTV VVVVVVVVVVVVVVVVV-WAWBWDWGWLWOWRWSWTWWW WWWWWWWWWWWWDXOXX-YAYBYDYGYLYOYRYSYTYYYYYYY{YYYYYYYYYYYAaFaKaNaPaRaTaVaWaXaYafagakaratavawaxayaaaaAbbbbbAcTcqcrcvcwcxcyccccAdrdddddAeFeKeNePeReTeVeWeXeYefegekeretevewexeyeeeffrfAgTgVgWgYgkgrgvgwgyggggchrhthFiTiViWiYifiriFjTjajfjijrjckrkflglrlvlwlylUmrmmmUnrnnnAoFoKoNoPoRoToVoWoXoYofokorotovowoxoyoooooUpYpmpnprpppAqrqxqqqqFrTrUrVrWrgrrrrrrTsfsksrsvswsyssAtStetftotptrtstttttttAuFuKuLuNuRuTuVuWuXuYukuquruuuuAvTvYvZvavbvevlvmvnvovrvvvvvvvvvvvvvvvAwTwawbwewmwnwowrwwwwwwwwwwwwwwwexoxrxxAyKyLyRyTyVyWyXyZyaybyeyhylymynyoypyryyyyyyyyyyyyyyyrz ATVWYċŋBKRT,.ALkaefhnorstuĒŒ,.ALsĔŔFPRfrATVWYīūDFGTVWY-BCDFGLNOPSTUVWYBDF»GT¡UV¹WY BDFûGTáUVùWYà-BCDFĻGJLNOPIJSTġUVĹWYĠĽĸ-BCDFŻGJLNOPŲSTšUVŹWYŠŽŸ-BCGJLNOPƪSTƟUVƲWYƙƱƫƾALNRBLTVWYBCKLNRTVWYBLTVWYLTVWYABCFKLNRTVWXYBTVWYAAAALRrvwyFNPRfkrtvwyrvwyvwyFKNPRfgkrtvwyFKNPRfgkrtvwyFKNPRTVWYfgkrtvwyArrvwyFNPRfgkrtvwxyrvwyrvwyFKNPRfgkrtvwyrFKNPRfgkrtvwyFNPTVWYfrvwyRKLNRkgnustep-back-0.29.0/Fonts/Helvetica.nfont/n019004l.afm000066400000000000000000000755531404163720200220770ustar00rootroot00000000000000StartFontMetrics 3.0 Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development Comment Creation Date: 12/22/1999 Comment See the file COPYING (GNU General Public License) for license conditions. FontName NimbusSanL-Bold FullName Nimbus Sans L Bold FamilyName Nimbus Sans L Weight Bold ItalicAngle 0.0 IsFixedPitch false UnderlinePosition -155 UnderlineThickness 69 Version 1.05 Notice (URW)++,Copyright 1999 by (URW)++ Design & Development EncodingScheme AdobeStandardEncoding FontBBox -173 -307 1003 949 CapHeight 729 XHeight 540 Descender -217 Ascender 729 StartCharMetrics 316 C 32 ; WX 278 ; N space ; B 214 0 214 0 ; C 33 ; WX 333 ; N exclam ; B 112 0 262 726 ; C 34 ; WX 474 ; N quotedbl ; B 50 470 424 729 ; C 35 ; WX 556 ; N numbersign ; B 3 -32 553 697 ; C 36 ; WX 556 ; N dollar ; B 22 -126 527 763 ; C 37 ; WX 889 ; N percent ; B 22 -20 863 709 ; C 38 ; WX 722 ; N ampersand ; B 55 -23 694 723 ; C 39 ; WX 278 ; N quoteright ; B 66 469 201 729 ; C 40 ; WX 333 ; N parenleft ; B 40 -200 303 729 ; C 41 ; WX 333 ; N parenright ; B 22 -200 285 729 ; C 42 ; WX 389 ; N asterisk ; B 23 407 357 729 ; C 43 ; WX 584 ; N plus ; B 50 -10 533 473 ; C 44 ; WX 278 ; N comma ; B 64 -174 214 146 ; C 45 ; WX 333 ; N hyphen ; B 26 207 298 342 ; C 46 ; WX 278 ; N period ; B 64 0 214 146 ; C 47 ; WX 278 ; N slash ; B 2 -14 275 714 ; C 48 ; WX 556 ; N zero ; B 29 -23 517 724 ; C 49 ; WX 556 ; N one ; B 68 0 378 709 ; C 50 ; WX 556 ; N two ; B 30 0 515 724 ; C 51 ; WX 556 ; N three ; B 29 -23 516 724 ; C 52 ; WX 556 ; N four ; B 24 0 522 709 ; C 53 ; WX 556 ; N five ; B 27 -23 517 709 ; C 54 ; WX 556 ; N six ; B 32 -23 519 724 ; C 55 ; WX 556 ; N seven ; B 29 0 528 709 ; C 56 ; WX 556 ; N eight ; B 22 -23 525 724 ; C 57 ; WX 556 ; N nine ; B 28 -24 516 724 ; C 58 ; WX 333 ; N colon ; B 113 0 263 520 ; C 59 ; WX 333 ; N semicolon ; B 113 -174 263 520 ; C 60 ; WX 584 ; N less ; B 40 -10 529 474 ; C 61 ; WX 584 ; N equal ; B 50 52 534 411 ; C 62 ; WX 584 ; N greater ; B 40 -10 529 474 ; C 63 ; WX 611 ; N question ; B 64 0 556 744 ; C 64 ; WX 975 ; N at ; B 27 -138 947 745 ; C 65 ; WX 722 ; N A ; B 26 0 703 729 ; C 66 ; WX 722 ; N B ; B 82 0 666 729 ; C 67 ; WX 722 ; N C ; B 44 -23 685 741 ; C 68 ; WX 722 ; N D ; B 77 0 681 729 ; C 69 ; WX 667 ; N E ; B 79 0 624 729 ; C 70 ; WX 611 ; N F ; B 74 0 586 729 ; C 71 ; WX 778 ; N G ; B 42 -23 711 741 ; C 72 ; WX 722 ; N H ; B 68 0 657 729 ; C 73 ; WX 278 ; N I ; B 63 0 213 729 ; C 74 ; WX 556 ; N J ; B 24 -23 486 729 ; C 75 ; WX 722 ; N K ; B 74 0 717 729 ; C 76 ; WX 611 ; N L ; B 80 0 579 729 ; C 77 ; WX 833 ; N M ; B 66 0 776 729 ; C 78 ; WX 722 ; N N ; B 68 0 661 729 ; C 79 ; WX 778 ; N O ; B 40 -23 742 741 ; C 80 ; WX 667 ; N P ; B 76 0 633 729 ; C 81 ; WX 778 ; N Q ; B 43 -54 745 741 ; C 82 ; WX 722 ; N R ; B 80 0 677 729 ; C 83 ; WX 667 ; N S ; B 32 -23 633 741 ; C 84 ; WX 611 ; N T ; B 14 0 598 729 ; C 85 ; WX 722 ; N U ; B 76 -23 654 729 ; C 86 ; WX 667 ; N V ; B 24 0 647 729 ; C 87 ; WX 944 ; N W ; B 13 0 932 729 ; C 88 ; WX 667 ; N X ; B 22 0 653 729 ; C 89 ; WX 667 ; N Y ; B 27 0 650 729 ; C 90 ; WX 611 ; N Z ; B 30 0 578 729 ; C 91 ; WX 333 ; N bracketleft ; B 66 -200 308 729 ; C 92 ; WX 278 ; N backslash ; B -12 -14 289 714 ; C 93 ; WX 333 ; N bracketright ; B 18 -200 260 729 ; C 94 ; WX 584 ; N asciicircum ; B 61 270 522 695 ; C 95 ; WX 556 ; N underscore ; B -22 -189 578 -120 ; C 96 ; WX 278 ; N quoteleft ; B 67 469 202 729 ; C 97 ; WX 556 ; N a ; B 28 -23 524 549 ; C 98 ; WX 611 ; N b ; B 59 -23 575 729 ; C 99 ; WX 556 ; N c ; B 34 -23 522 549 ; C 100 ; WX 611 ; N d ; B 29 -23 545 729 ; C 101 ; WX 556 ; N e ; B 22 -23 525 549 ; C 102 ; WX 333 ; N f ; B 14 0 313 729 ; C 103 ; WX 611 ; N g ; B 34 -218 541 549 ; C 104 ; WX 611 ; N h ; B 67 0 541 729 ; C 105 ; WX 278 ; N i ; B 67 0 207 729 ; C 106 ; WX 278 ; N j ; B 4 -218 210 729 ; C 107 ; WX 556 ; N k ; B 59 0 548 729 ; C 108 ; WX 278 ; N l ; B 67 0 207 729 ; C 109 ; WX 889 ; N m ; B 60 0 824 549 ; C 110 ; WX 611 ; N n ; B 63 0 546 549 ; C 111 ; WX 611 ; N o ; B 35 -23 569 549 ; C 112 ; WX 611 ; N p ; B 58 -218 574 549 ; C 113 ; WX 611 ; N q ; B 28 -218 544 549 ; C 114 ; WX 389 ; N r ; B 63 0 370 549 ; C 115 ; WX 556 ; N s ; B 29 -23 520 549 ; C 116 ; WX 333 ; N t ; B 14 -23 301 674 ; C 117 ; WX 611 ; N u ; B 58 -23 541 540 ; C 118 ; WX 556 ; N v ; B 14 0 536 540 ; C 119 ; WX 778 ; N w ; B 5 0 766 540 ; C 120 ; WX 556 ; N x ; B 16 0 535 540 ; C 121 ; WX 556 ; N y ; B 9 -219 538 540 ; C 122 ; WX 500 ; N z ; B 21 0 468 540 ; C 123 ; WX 389 ; N braceleft ; B 37 -200 317 729 ; C 124 ; WX 280 ; N bar ; B 100 -200 180 729 ; C 125 ; WX 389 ; N braceright ; B 72 -200 352 729 ; C 126 ; WX 584 ; N asciitilde ; B 60 142 519 314 ; C 161 ; WX 333 ; N exclamdown ; B 66 -186 216 540 ; C 162 ; WX 556 ; N cent ; B 36 -124 522 634 ; C 163 ; WX 556 ; N sterling ; B 31 -23 537 715 ; C 164 ; WX 167 ; N fraction ; B -173 -20 337 715 ; C 165 ; WX 556 ; N yen ; B 5 0 552 704 ; C 166 ; WX 556 ; N florin ; B 21 -220 535 744 ; C 167 ; WX 556 ; N section ; B 33 -201 518 723 ; C 168 ; WX 556 ; N currency ; B 26 100 530 604 ; C 169 ; WX 238 ; N quotesingle ; B 50 470 188 729 ; C 170 ; WX 500 ; N quotedblleft ; B 71 469 433 729 ; C 171 ; WX 556 ; N guillemotleft ; B 88 72 468 481 ; C 172 ; WX 333 ; N guilsinglleft ; B 83 72 250 481 ; C 173 ; WX 333 ; N guilsinglright ; B 80 72 247 481 ; C 174 ; WX 611 ; N fi ; B 9 0 548 729 ; C 175 ; WX 611 ; N fl ; B 12 0 546 729 ; C 177 ; WX 556 ; N endash ; B -9 207 557 311 ; C 178 ; WX 556 ; N dagger ; B 31 -194 523 709 ; C 179 ; WX 556 ; N daggerdbl ; B 28 -194 520 709 ; C 180 ; WX 278 ; N periodcentered ; B 64 169 188 292 ; C 182 ; WX 556 ; N paragraph ; B 19 -191 529 729 ; C 183 ; WX 350 ; N bullet ; B 50 175 300 425 ; C 184 ; WX 278 ; N quotesinglbase ; B 66 -135 201 125 ; C 185 ; WX 500 ; N quotedblbase ; B 72 -135 432 125 ; C 186 ; WX 500 ; N quotedblright ; B 73 469 440 729 ; C 187 ; WX 556 ; N guillemotright ; B 88 72 462 481 ; C 188 ; WX 1000 ; N ellipsis ; B 92 0 908 146 ; C 189 ; WX 1000 ; N perthousand ; B 11 -22 990 739 ; C 191 ; WX 611 ; N questiondown ; B 51 -204 544 540 ; C 193 ; WX 333 ; N grave ; B 17 607 213 757 ; C 194 ; WX 333 ; N acute ; B 121 607 317 757 ; C 195 ; WX 333 ; N circumflex ; B 8 607 326 757 ; C 196 ; WX 333 ; N tilde ; B -9 621 345 749 ; C 197 ; WX 333 ; N macron ; B 16 640 315 719 ; C 198 ; WX 333 ; N breve ; B 35 605 299 748 ; C 199 ; WX 333 ; N dotaccent ; B 112 621 222 743 ; C 200 ; WX 333 ; N dieresis ; B 18 621 314 743 ; C 202 ; WX 333 ; N ring ; B 77 590 257 770 ; C 203 ; WX 333 ; N cedilla ; B 27 -220 294 0 ; C 205 ; WX 333 ; N hungarumlaut ; B -44 610 340 757 ; C 206 ; WX 333 ; N ogonek ; B 45 -234 268 0 ; C 207 ; WX 333 ; N caron ; B 9 607 327 757 ; C 208 ; WX 1000 ; N emdash ; B -7 207 1003 311 ; C 225 ; WX 1000 ; N AE ; B 1 0 966 729 ; C 227 ; WX 370 ; N ordfeminine ; B 31 262 329 729 ; C 232 ; WX 611 ; N Lslash ; B 0 0 597 729 ; C 233 ; WX 778 ; N Oslash ; B 31 -39 755 749 ; C 234 ; WX 1000 ; N OE ; B 28 -23 970 741 ; C 235 ; WX 365 ; N ordmasculine ; B 23 262 343 729 ; C 241 ; WX 889 ; N ae ; B 27 -24 857 549 ; C 245 ; WX 278 ; N dotlessi ; B 67 0 207 540 ; C 248 ; WX 278 ; N lslash ; B 0 0 252 729 ; C 249 ; WX 611 ; N oslash ; B 11 -38 598 557 ; C 250 ; WX 944 ; N oe ; B 23 -23 920 549 ; C 251 ; WX 611 ; N germandbls ; B 67 -17 575 729 ; C -1 ; WX 722 ; N Udieresis ; B 76 -23 654 922 ; C -1 ; WX 722 ; N Uacute ; B 76 -23 654 936 ; C -1 ; WX 667 ; N Scedilla ; B 32 -220 633 741 ; C -1 ; WX 611 ; N Tcaron ; B 14 0 598 936 ; C -1 ; WX 667 ; N Scaron ; B 32 -23 633 936 ; C -1 ; WX 722 ; N Rcaron ; B 80 0 677 936 ; C -1 ; WX 722 ; N Racute ; B 80 0 677 936 ; C -1 ; WX 667 ; N Sacute ; B 32 -23 633 936 ; C -1 ; WX 778 ; N Otilde ; B 40 -23 742 928 ; C -1 ; WX 611 ; N ucircumflex ; B 58 -23 541 757 ; C -1 ; WX 778 ; N Ohungarumlaut ; B 40 -23 742 936 ; C -1 ; WX 722 ; N Uhungarumlaut ; B 76 -23 654 936 ; C -1 ; WX 667 ; N Yacute ; B 27 0 650 936 ; C -1 ; WX 722 ; N Eth ; B 0 0 681 729 ; C -1 ; WX 722 ; N Dcroat ; B 0 0 681 729 ; C -1 ; WX 611 ; N Zacute ; B 30 0 578 936 ; C -1 ; WX 722 ; N Uring ; B 76 -23 654 949 ; C -1 ; WX 611 ; N gbreve ; B 34 -218 541 748 ; C -1 ; WX 556 ; N eogonek ; B 21 -234 525 549 ; C -1 ; WX 556 ; N edotaccent ; B 22 -23 525 743 ; C -1 ; WX 556 ; N ecaron ; B 22 -23 525 757 ; C -1 ; WX 722 ; N Ugrave ; B 76 -23 654 936 ; C -1 ; WX 667 ; N Thorn ; B 76 0 633 729 ; C -1 ; WX 556 ; N eacute ; B 22 -23 525 757 ; C -1 ; WX 556 ; N edieresis ; B 22 -23 525 743 ; C -1 ; WX 707 ; N dcaron ; B 29 -23 720 729 ; C -1 ; WX 556 ; N ccedilla ; B 34 -220 522 549 ; C -1 ; WX 556 ; N ccaron ; B 34 -23 522 757 ; C -1 ; WX 556 ; N cacute ; B 34 -23 522 757 ; C -1 ; WX 556 ; N aogonek ; B 28 -233 548 549 ; C -1 ; WX 556 ; N aring ; B 28 -23 524 770 ; C -1 ; WX 556 ; N atilde ; B 28 -23 524 749 ; C -1 ; WX 556 ; N abreve ; B 28 -23 524 748 ; C -1 ; WX 556 ; N egrave ; B 22 -23 525 757 ; C -1 ; WX 556 ; N agrave ; B 28 -23 524 757 ; C -1 ; WX 556 ; N aacute ; B 28 -23 524 757 ; C -1 ; WX 556 ; N adieresis ; B 28 -23 524 743 ; C -1 ; WX 722 ; N Uogonek ; B 76 -234 654 729 ; C -1 ; WX 611 ; N ugrave ; B 58 -23 541 757 ; C -1 ; WX 611 ; N uacute ; B 58 -23 541 757 ; C -1 ; WX 611 ; N udieresis ; B 58 -23 541 743 ; C -1 ; WX 385 ; N tcaron ; B 14 -23 398 829 ; C -1 ; WX 556 ; N scommaaccent ; B 29 -307 520 549 ; C -1 ; WX 611 ; N Zcaron ; B 30 0 578 936 ; C -1 ; WX 556 ; N ecircumflex ; B 22 -23 525 757 ; C -1 ; WX 722 ; N Ucircumflex ; B 76 -23 654 936 ; C -1 ; WX 556 ; N acircumflex ; B 28 -23 524 757 ; C -1 ; WX 611 ; N Zdotaccent ; B 30 0 578 922 ; C -1 ; WX 556 ; N scaron ; B 29 -23 520 757 ; C -1 ; WX 722 ; N Amacron ; B 26 0 703 898 ; C -1 ; WX 556 ; N sacute ; B 29 -23 520 757 ; C -1 ; WX 611 ; N Tcommaaccent ; B 14 -307 598 729 ; C -1 ; WX 667 ; N Ydieresis ; B 27 0 650 922 ; C -1 ; WX 611 ; N thorn ; B 58 -218 574 729 ; C -1 ; WX 667 ; N Emacron ; B 79 0 624 898 ; C -1 ; WX 778 ; N Ograve ; B 40 -23 742 936 ; C -1 ; WX 778 ; N Oacute ; B 40 -23 742 936 ; C -1 ; WX 778 ; N Odieresis ; B 40 -23 742 922 ; C -1 ; WX 722 ; N Ntilde ; B 68 0 661 928 ; C -1 ; WX 722 ; N Ncaron ; B 68 0 661 936 ; C -1 ; WX 722 ; N Nacute ; B 68 0 661 936 ; C -1 ; WX 611 ; N Lcaron ; B 80 0 579 729 ; C -1 ; WX 611 ; N Lacute ; B 80 0 579 936 ; C -1 ; WX 278 ; N Idotaccent ; B 63 0 213 922 ; C -1 ; WX 389 ; N racute ; B 63 0 370 757 ; C -1 ; WX 278 ; N Icircumflex ; B -19 0 299 936 ; C -1 ; WX 611 ; N ohungarumlaut ; B 35 -23 569 757 ; C -1 ; WX 611 ; N otilde ; B 35 -23 569 749 ; C -1 ; WX 556 ; N Euro ; B 6 -23 546 724 ; C -1 ; WX 611 ; N ocircumflex ; B 35 -23 569 757 ; C -1 ; WX 351 ; N onesuperior ; B 40 284 242 709 ; C -1 ; WX 351 ; N twosuperior ; B 16 284 328 718 ; C -1 ; WX 351 ; N threesuperior ; B 15 271 329 718 ; C -1 ; WX 278 ; N Igrave ; B -10 0 213 936 ; C -1 ; WX 278 ; N Iacute ; B 63 0 290 936 ; C -1 ; WX 278 ; N Imacron ; B 2 0 274 898 ; C -1 ; WX 278 ; N Iogonek ; B 34 -233 237 729 ; C -1 ; WX 278 ; N Idieresis ; B -9 0 287 922 ; C -1 ; WX 778 ; N Gbreve ; B 42 -23 711 927 ; C -1 ; WX 722 ; N Umacron ; B 76 -23 654 898 ; C -1 ; WX 722 ; N Kcommaaccent ; B 74 -307 717 729 ; C -1 ; WX 611 ; N ograve ; B 35 -23 569 757 ; C -1 ; WX 667 ; N Scommaaccent ; B 32 -307 633 741 ; C -1 ; WX 667 ; N Eogonek ; B 79 -233 648 729 ; C -1 ; WX 611 ; N oacute ; B 35 -23 569 757 ; C -1 ; WX 667 ; N Edotaccent ; B 79 0 624 922 ; C -1 ; WX 278 ; N iogonek ; B 34 -233 231 729 ; C -1 ; WX 611 ; N gcommaaccent ; B 34 -218 541 853 ; C -1 ; WX 611 ; N odieresis ; B 35 -23 569 743 ; C -1 ; WX 611 ; N ntilde ; B 63 0 546 749 ; C -1 ; WX 611 ; N ncaron ; B 63 0 546 757 ; C -1 ; WX 667 ; N Ecaron ; B 79 0 624 936 ; C -1 ; WX 667 ; N Ecircumflex ; B 79 0 624 936 ; C -1 ; WX 556 ; N scedilla ; B 29 -220 520 549 ; C -1 ; WX 389 ; N rcaron ; B 54 0 372 757 ; C -1 ; WX 667 ; N Egrave ; B 79 0 624 936 ; C -1 ; WX 667 ; N Eacute ; B 79 0 624 936 ; C -1 ; WX 778 ; N Gcommaaccent ; B 42 -307 711 741 ; C -1 ; WX 722 ; N Rcommaaccent ; B 80 -307 677 729 ; C -1 ; WX 667 ; N Edieresis ; B 79 0 624 922 ; C -1 ; WX 611 ; N nacute ; B 63 0 546 757 ; C -1 ; WX 611 ; N uogonek ; B 58 -233 564 540 ; C -1 ; WX 611 ; N umacron ; B 58 -23 541 719 ; C -1 ; WX 722 ; N Dcaron ; B 77 0 681 936 ; C -1 ; WX 369 ; N lcaron ; B 67 0 382 729 ; C -1 ; WX 722 ; N Ccaron ; B 44 -23 685 936 ; C -1 ; WX 722 ; N Cacute ; B 44 -23 685 936 ; C -1 ; WX 722 ; N Ccedilla ; B 44 -220 685 741 ; C -1 ; WX 606 ; N degree ; B 151 383 454 686 ; C -1 ; WX 722 ; N Aogonek ; B 26 -233 723 729 ; C -1 ; WX 584 ; N minus ; B 40 172 544 291 ; C -1 ; WX 584 ; N multiply ; B 79 18 505 444 ; C -1 ; WX 584 ; N divide ; B 50 -11 534 474 ; C -1 ; WX 722 ; N Aring ; B 26 0 703 949 ; C -1 ; WX 1000 ; N trademark ; B 71 273 929 729 ; C -1 ; WX 389 ; N rcommaaccent ; B 63 -307 370 549 ; C -1 ; WX 278 ; N lacute ; B 67 0 278 936 ; C -1 ; WX 611 ; N omacron ; B 35 -23 569 719 ; C -1 ; WX 722 ; N Atilde ; B 26 0 703 928 ; C -1 ; WX 278 ; N icircumflex ; B -19 0 299 757 ; C -1 ; WX 278 ; N igrave ; B -10 0 207 757 ; C -1 ; WX 611 ; N ncommaaccent ; B 63 -307 546 549 ; C -1 ; WX 278 ; N lcommaaccent ; B 67 -307 207 729 ; C -1 ; WX 584 ; N plusminus ; B 56 -16 527 608 ; C -1 ; WX 869 ; N onehalf ; B 40 -20 846 715 ; C -1 ; WX 869 ; N onequarter ; B 40 -20 850 715 ; C -1 ; WX 869 ; N threequarters ; B 15 -20 850 718 ; C -1 ; WX 278 ; N iacute ; B 67 0 290 757 ; C -1 ; WX 722 ; N Abreve ; B 26 0 703 927 ; C -1 ; WX 556 ; N kcommaaccent ; B 59 -307 548 729 ; C -1 ; WX 778 ; N Omacron ; B 40 -23 742 898 ; C -1 ; WX 278 ; N imacron ; B 7 0 266 719 ; C -1 ; WX 556 ; N emacron ; B 22 -23 525 719 ; C -1 ; WX 556 ; N amacron ; B 28 -23 524 719 ; C -1 ; WX 333 ; N tcommaaccent ; B 14 -307 301 674 ; C -1 ; WX 556 ; N ydieresis ; B 9 -219 538 743 ; C -1 ; WX 500 ; N zdotaccent ; B 21 0 468 743 ; C -1 ; WX 500 ; N zcaron ; B 21 0 468 757 ; C -1 ; WX 500 ; N zacute ; B 21 0 468 757 ; C -1 ; WX 556 ; N yacute ; B 9 -219 538 757 ; C -1 ; WX 611 ; N uhungarumlaut ; B 58 -23 559 757 ; C -1 ; WX 611 ; N eth ; B 35 -23 569 744 ; C -1 ; WX 611 ; N uring ; B 58 -23 541 770 ; C -1 ; WX 778 ; N Ocircumflex ; B 40 -23 742 936 ; C -1 ; WX 333 ; N commaaccent ; B 112 -307 234 -60 ; C -1 ; WX 737 ; N copyright ; B -14 -22 751 743 ; C -1 ; WX 737 ; N registered ; B -14 -22 751 743 ; C -1 ; WX 722 ; N Acircumflex ; B 26 0 703 936 ; C -1 ; WX 278 ; N idieresis ; B -9 0 287 743 ; C -1 ; WX 489 ; N lozenge ; B 16 0 462 744 ; C -1 ; WX 729 ; N Delta ; B 8 0 721 729 ; C -1 ; WX 548 ; N notequal ; B 50 -69 534 528 ; C -1 ; WX 542 ; N radical ; B 7 -36 512 913 ; C -1 ; WX 722 ; N Agrave ; B 26 0 703 936 ; C -1 ; WX 722 ; N Aacute ; B 26 0 703 936 ; C -1 ; WX 584 ; N lessequal ; B 45 -10 534 639 ; C -1 ; WX 584 ; N greaterequal ; B 45 -10 534 639 ; C -1 ; WX 584 ; N logicalnot ; B 40 86 544 375 ; C -1 ; WX 711 ; N summation ; B 17 -96 694 760 ; C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ; C -1 ; WX 722 ; N Ncommaaccent ; B 68 -307 661 729 ; C -1 ; WX 611 ; N dcroat ; B 29 -23 605 729 ; C -1 ; WX 280 ; N brokenbar ; B 100 -200 180 729 ; C -1 ; WX 611 ; N Lcommaaccent ; B 80 -307 579 729 ; C -1 ; WX 722 ; N Adieresis ; B 26 0 703 922 ; C -1 ; WX 611 ; N mu ; B 58 -220 573 540 ; C -1 ; WX 278 ; N .notdef ; B 214 0 214 0 ; EndCharMetrics StartKernData StartKernPairs 998 KPX A C -33 KPX A Ccedilla -33 KPX A G -35 KPX A O -34 KPX A Odieresis -34 KPX A Q -35 KPX A T -81 KPX A U -32 KPX A Uacute -32 KPX A Ucircumflex -32 KPX A Udieresis -32 KPX A Ugrave -32 KPX A V -66 KPX A W -51 KPX A Y -90 KPX A a -1 KPX A b -1 KPX A c -14 KPX A ccedilla -14 KPX A comma 19 KPX A d -13 KPX A e -9 KPX A g -14 KPX A guillemotleft -43 KPX A guilsinglleft -40 KPX A hyphen 7 KPX A o -16 KPX A period 19 KPX A q -12 KPX A quotedblright -65 KPX A quoteright -61 KPX A t -18 KPX A u -12 KPX A v -37 KPX A w -23 KPX A y -35 KPX Aacute C -33 KPX Aacute G -35 KPX Aacute O -34 KPX Aacute Q -35 KPX Aacute T -81 KPX Aacute U -32 KPX Aacute V -66 KPX Aacute W -51 KPX Aacute Y -90 KPX Aacute a -1 KPX Aacute b -1 KPX Aacute c -14 KPX Aacute comma 19 KPX Aacute d -13 KPX Aacute e -9 KPX Aacute g -14 KPX Aacute guillemotleft -43 KPX Aacute guilsinglleft -40 KPX Aacute hyphen 7 KPX Aacute o -16 KPX Aacute period 19 KPX Aacute q -12 KPX Aacute quoteright -61 KPX Aacute t -18 KPX Aacute u -12 KPX Aacute v -37 KPX Aacute w -23 KPX Aacute y -35 KPX Acircumflex C -33 KPX Acircumflex G -35 KPX Acircumflex O -34 KPX Acircumflex Q -35 KPX Acircumflex T -81 KPX Acircumflex U -32 KPX Acircumflex V -66 KPX Acircumflex W -51 KPX Acircumflex Y -90 KPX Acircumflex comma 19 KPX Acircumflex period 19 KPX Adieresis C -33 KPX Adieresis G -35 KPX Adieresis O -34 KPX Adieresis Q -35 KPX Adieresis T -81 KPX Adieresis U -32 KPX Adieresis V -66 KPX Adieresis W -51 KPX Adieresis Y -90 KPX Adieresis a -1 KPX Adieresis b -1 KPX Adieresis c -14 KPX Adieresis comma 19 KPX Adieresis d -13 KPX Adieresis g -14 KPX Adieresis guillemotleft -43 KPX Adieresis guilsinglleft -40 KPX Adieresis hyphen 7 KPX Adieresis o -16 KPX Adieresis period 19 KPX Adieresis q -12 KPX Adieresis quotedblright -65 KPX Adieresis quoteright -61 KPX Adieresis t -18 KPX Adieresis u -12 KPX Adieresis v -37 KPX Adieresis w -23 KPX Adieresis y -35 KPX Agrave C -33 KPX Agrave G -35 KPX Agrave O -34 KPX Agrave Q -35 KPX Agrave T -81 KPX Agrave U -32 KPX Agrave V -66 KPX Agrave W -51 KPX Agrave Y -90 KPX Agrave comma 19 KPX Agrave period 19 KPX Aring C -33 KPX Aring G -35 KPX Aring O -34 KPX Aring Q -35 KPX Aring T -81 KPX Aring U -32 KPX Aring V -66 KPX Aring W -51 KPX Aring Y -90 KPX Aring a -1 KPX Aring b -1 KPX Aring c -14 KPX Aring comma 19 KPX Aring d -13 KPX Aring e -9 KPX Aring g -14 KPX Aring guillemotleft -43 KPX Aring guilsinglleft -40 KPX Aring hyphen 7 KPX Aring o -16 KPX Aring period 19 KPX Aring q -12 KPX Aring quotedblright -65 KPX Aring quoteright -61 KPX Aring t -18 KPX Aring u -12 KPX Aring v -37 KPX Aring w -23 KPX Aring y -35 KPX Atilde C -33 KPX Atilde G -35 KPX Atilde O -34 KPX Atilde Q -35 KPX Atilde T -81 KPX Atilde U -32 KPX Atilde V -66 KPX Atilde W -51 KPX Atilde Y -90 KPX Atilde comma 19 KPX Atilde period 19 KPX B A -32 KPX B AE -20 KPX B Aacute -32 KPX B Acircumflex -32 KPX B Adieresis -32 KPX B Aring -32 KPX B Atilde -32 KPX B O -11 KPX B OE -2 KPX B Oacute -11 KPX B Ocircumflex -11 KPX B Odieresis -11 KPX B Ograve -11 KPX B Oslash -5 KPX B V -39 KPX B W -27 KPX B Y -51 KPX C A -29 KPX C AE -17 KPX C Aacute -29 KPX C Adieresis -29 KPX C Aring -29 KPX C H 5 KPX C K 2 KPX C O -6 KPX C Oacute -6 KPX C Odieresis -6 KPX Ccedilla A -28 KPX D A -37 KPX D Aacute -37 KPX D Acircumflex -37 KPX D Adieresis -37 KPX D Agrave -37 KPX D Aring -37 KPX D Atilde -37 KPX D J 2 KPX D T -17 KPX D V -35 KPX D W -20 KPX D X -35 KPX D Y -56 KPX F A -63 KPX F Aacute -63 KPX F Acircumflex -63 KPX F Adieresis -63 KPX F Agrave -63 KPX F Aring -63 KPX F Atilde -63 KPX F J -25 KPX F O -16 KPX F Odieresis -16 KPX F a -15 KPX F aacute -15 KPX F adieresis -15 KPX F ae -17 KPX F aring -15 KPX F comma -76 KPX F e -7 KPX F eacute -7 KPX F hyphen 11 KPX F i -7 KPX F j -9 KPX F o -14 KPX F oacute -14 KPX F odieresis -14 KPX F oe -8 KPX F oslash -15 KPX F period -75 KPX F r -27 KPX F u -24 KPX G A -8 KPX G AE 4 KPX G Aacute -8 KPX G Acircumflex -8 KPX G Adieresis -8 KPX G Agrave -8 KPX G Aring -8 KPX G Atilde -8 KPX G T -17 KPX G V -36 KPX G W -20 KPX G Y -56 KPX J A -32 KPX J AE -20 KPX J Adieresis -32 KPX J Aring -32 KPX K C -53 KPX K G -55 KPX K O -54 KPX K OE -44 KPX K Oacute -54 KPX K Odieresis -54 KPX K S -30 KPX K T 13 KPX K a -3 KPX K adieresis -3 KPX K ae 0 KPX K aring -3 KPX K e -25 KPX K hyphen -44 KPX K o -33 KPX K oacute -33 KPX K odieresis -33 KPX K u -23 KPX K udieresis -23 KPX K y -65 KPX L A 9 KPX L AE 21 KPX L Aacute 9 KPX L Adieresis 9 KPX L Aring 9 KPX L C -26 KPX L Ccedilla -26 KPX L G -30 KPX L O -29 KPX L Oacute -29 KPX L Ocircumflex -29 KPX L Odieresis -29 KPX L Ograve -29 KPX L Otilde -29 KPX L S -2 KPX L T -95 KPX L U -24 KPX L Udieresis -24 KPX L V -90 KPX L W -68 KPX L Y -112 KPX L hyphen -12 KPX L quotedblright -141 KPX L quoteright -138 KPX L u -7 KPX L udieresis -7 KPX L y -55 KPX N A -5 KPX N AE 7 KPX N Aacute -5 KPX N Adieresis -5 KPX N Aring -5 KPX N C 9 KPX N Ccedilla 9 KPX N G 8 KPX N O 8 KPX N Oacute 8 KPX N Odieresis 8 KPX N a 13 KPX N aacute 13 KPX N adieresis 13 KPX N ae 13 KPX N aring 13 KPX N comma 15 KPX N e 18 KPX N eacute 18 KPX N o 11 KPX N oacute 11 KPX N odieresis 11 KPX N oslash 11 KPX N period 16 KPX N u 12 KPX N udieresis 12 KPX O A -37 KPX O AE -26 KPX O Aacute -37 KPX O Adieresis -37 KPX O Aring -37 KPX O T -20 KPX O V -36 KPX O W -21 KPX O X -36 KPX O Y -59 KPX Oacute A -37 KPX Oacute T -20 KPX Oacute V -36 KPX Oacute W -21 KPX Oacute Y -59 KPX Ocircumflex T -20 KPX Ocircumflex V -36 KPX Ocircumflex Y -59 KPX Odieresis A -37 KPX Odieresis T -20 KPX Odieresis V -36 KPX Odieresis W -21 KPX Odieresis X -36 KPX Odieresis Y -59 KPX Ograve T -20 KPX Ograve V -36 KPX Ograve Y -59 KPX Oslash A -32 KPX Otilde T -20 KPX Otilde V -36 KPX Otilde Y -59 KPX P A -65 KPX P AE -54 KPX P Aacute -65 KPX P Adieresis -65 KPX P Aring -65 KPX P J -44 KPX P a -7 KPX P aacute -7 KPX P adieresis -7 KPX P ae -8 KPX P aring -7 KPX P comma -94 KPX P e -8 KPX P eacute -8 KPX P hyphen 0 KPX P o -14 KPX P oacute -14 KPX P odieresis -14 KPX P oe -8 KPX P oslash -17 KPX P period -94 KPX R C -5 KPX R Ccedilla -5 KPX R G -6 KPX R O -6 KPX R OE 3 KPX R Oacute -6 KPX R Odieresis -6 KPX R T 0 KPX R U -4 KPX R Udieresis -4 KPX R V -26 KPX R W -17 KPX R Y -37 KPX R a 0 KPX R aacute 0 KPX R adieresis 0 KPX R ae 0 KPX R aring 0 KPX R e 2 KPX R eacute 2 KPX R hyphen 15 KPX R o -4 KPX R oacute -4 KPX R odieresis -4 KPX R oe 1 KPX R u 0 KPX R uacute 0 KPX R udieresis 0 KPX R y 5 KPX S A -20 KPX S AE -8 KPX S Aacute -20 KPX S Adieresis -20 KPX S Aring -20 KPX S T -5 KPX S V -31 KPX S W -17 KPX S Y -43 KPX S t 1 KPX T A -87 KPX T AE -75 KPX T Aacute -87 KPX T Acircumflex -87 KPX T Adieresis -87 KPX T Agrave -87 KPX T Aring -87 KPX T Atilde -87 KPX T C -20 KPX T G -22 KPX T J -87 KPX T O -22 KPX T OE -11 KPX T Oacute -22 KPX T Ocircumflex -22 KPX T Odieresis -22 KPX T Ograve -22 KPX T Oslash -23 KPX T Otilde -22 KPX T S 3 KPX T V 18 KPX T W 24 KPX T Y 16 KPX T a -73 KPX T ae -73 KPX T c -74 KPX T colon -97 KPX T comma -67 KPX T e -69 KPX T g -75 KPX T guillemotleft -101 KPX T guilsinglleft -98 KPX T hyphen -48 KPX T i -1 KPX T j -3 KPX T o -76 KPX T oslash -73 KPX T period -67 KPX T r -71 KPX T s -74 KPX T semicolon -98 KPX T u -72 KPX T v -82 KPX T w -77 KPX T y -80 KPX U A -34 KPX U AE -22 KPX U Aacute -34 KPX U Acircumflex -34 KPX U Adieresis -34 KPX U Aring -34 KPX U Atilde -34 KPX U comma -7 KPX U m 6 KPX U n 5 KPX U p 7 KPX U period -4 KPX U r 5 KPX Uacute A -34 KPX Uacute comma -7 KPX Uacute m 6 KPX Uacute n 5 KPX Uacute p 7 KPX Uacute period -4 KPX Uacute r 5 KPX Ucircumflex A -34 KPX Udieresis A -34 KPX Udieresis b 6 KPX Udieresis comma -7 KPX Udieresis m 6 KPX Udieresis n 5 KPX Udieresis p 7 KPX Udieresis period -4 KPX Udieresis r 5 KPX Ugrave A -34 KPX V A -71 KPX V AE -59 KPX V Aacute -71 KPX V Acircumflex -71 KPX V Adieresis -71 KPX V Agrave -71 KPX V Aring -71 KPX V Atilde -71 KPX V C -36 KPX V G -38 KPX V O -37 KPX V Oacute -37 KPX V Ocircumflex -37 KPX V Odieresis -37 KPX V Ograve -37 KPX V Oslash -31 KPX V Otilde -37 KPX V S -21 KPX V T 21 KPX V a -47 KPX V ae -48 KPX V colon -65 KPX V comma -69 KPX V e -43 KPX V g -49 KPX V guillemotleft -74 KPX V guilsinglleft -72 KPX V hyphen -21 KPX V i -5 KPX V o -50 KPX V oslash -48 KPX V period -69 KPX V r -34 KPX V semicolon -67 KPX V u -34 KPX V y -10 KPX W A -54 KPX W AE -43 KPX W Aacute -54 KPX W Acircumflex -54 KPX W Adieresis -54 KPX W Agrave -54 KPX W Aring -54 KPX W Atilde -54 KPX W C -20 KPX W G -22 KPX W O -21 KPX W Oacute -21 KPX W Ocircumflex -21 KPX W Odieresis -21 KPX W Ograve -21 KPX W Oslash -15 KPX W Otilde -21 KPX W S -12 KPX W T 25 KPX W a -29 KPX W ae -29 KPX W colon -53 KPX W comma -45 KPX W e -24 KPX W g -30 KPX W guillemotleft -55 KPX W guilsinglleft -53 KPX W hyphen -3 KPX W i -1 KPX W o -31 KPX W oslash -29 KPX W period -45 KPX W r -24 KPX W semicolon -54 KPX W u -23 KPX W y 0 KPX X C -34 KPX X O -35 KPX X Odieresis -35 KPX X Q -37 KPX X a -5 KPX X e -25 KPX X hyphen -27 KPX X o -32 KPX X u -25 KPX X y -40 KPX Y A -86 KPX Y AE -74 KPX Y Aacute -86 KPX Y Acircumflex -86 KPX Y Adieresis -86 KPX Y Agrave -86 KPX Y Aring -86 KPX Y Atilde -86 KPX Y C -52 KPX Y G -54 KPX Y O -54 KPX Y Oacute -54 KPX Y Ocircumflex -54 KPX Y Odieresis -54 KPX Y Ograve -54 KPX Y Oslash -47 KPX Y Otilde -54 KPX Y S -29 KPX Y T 22 KPX Y a -66 KPX Y ae -67 KPX Y colon -81 KPX Y comma -78 KPX Y e -63 KPX Y g -68 KPX Y guillemotleft -98 KPX Y guilsinglleft -96 KPX Y hyphen -50 KPX Y i -3 KPX Y o -70 KPX Y oslash -67 KPX Y p -45 KPX Y period -78 KPX Y semicolon -83 KPX Y u -48 KPX Y v -27 KPX Z v -11 KPX Z y -9 KPX a j -1 KPX a quoteright -11 KPX a v -19 KPX a w -5 KPX a y -17 KPX aacute v -19 KPX aacute w -5 KPX aacute y -17 KPX adieresis v -19 KPX adieresis w -5 KPX adieresis y -17 KPX ae v -21 KPX ae w -7 KPX ae y -19 KPX agrave v -19 KPX agrave w -5 KPX agrave y -17 KPX aring v -19 KPX aring w -5 KPX aring y -17 KPX b v -20 KPX b w -7 KPX b y -20 KPX c h 0 KPX c k 3 KPX comma one -73 KPX comma quotedblright -33 KPX comma quoteright -30 KPX e quoteright -12 KPX e t -4 KPX e v -19 KPX e w -6 KPX e x -21 KPX e y -17 KPX eacute v -19 KPX eacute w -6 KPX eacute y -17 KPX ecircumflex v -19 KPX ecircumflex w -6 KPX ecircumflex y -17 KPX eight four 10 KPX eight one -23 KPX eight seven -6 KPX f a 1 KPX f aacute 1 KPX f adieresis 1 KPX f ae 0 KPX f aring 1 KPX f e -3 KPX f eacute -3 KPX f f 21 KPX f i -3 KPX f j -6 KPX f l -3 KPX f o -9 KPX f oacute -9 KPX f odieresis -9 KPX f oe -3 KPX f oslash -9 KPX f quoteright 10 KPX f s -1 KPX f t 21 KPX five four 6 KPX five one -29 KPX five seven -10 KPX four four 9 KPX four one -50 KPX four seven -28 KPX g a 3 KPX g adieresis 3 KPX g ae 3 KPX g aring 3 KPX g e 8 KPX g eacute 8 KPX g l 0 KPX g oacute 1 KPX g odieresis 1 KPX g r 1 KPX guillemotright A -51 KPX guillemotright AE -39 KPX guillemotright Aacute -51 KPX guillemotright Adieresis -51 KPX guillemotright Aring -51 KPX guillemotright T -108 KPX guillemotright V -78 KPX guillemotright W -60 KPX guillemotright Y -111 KPX guilsinglright A -46 KPX guilsinglright AE -35 KPX guilsinglright Aacute -46 KPX guilsinglright Adieresis -46 KPX guilsinglright Aring -46 KPX guilsinglright T -104 KPX guilsinglright V -74 KPX guilsinglright W -56 KPX guilsinglright Y -107 KPX h quoteright -14 KPX h y -21 KPX hyphen A -1 KPX hyphen AE 10 KPX hyphen Aacute -1 KPX hyphen Adieresis -1 KPX hyphen Aring -1 KPX hyphen T -57 KPX hyphen V -27 KPX hyphen W -9 KPX hyphen Y -64 KPX i T -4 KPX i j -2 KPX k a -2 KPX k aacute -2 KPX k adieresis -2 KPX k ae 1 KPX k aring -2 KPX k comma 7 KPX k e -15 KPX k eacute -15 KPX k g -21 KPX k hyphen -25 KPX k o -22 KPX k oacute -22 KPX k odieresis -22 KPX k period 6 KPX k s -10 KPX k u -1 KPX k udieresis -1 KPX l v -5 KPX l y -2 KPX m p 6 KPX m v -19 KPX m w -6 KPX m y -18 KPX n T -80 KPX n p 5 KPX n quoteright -12 KPX n v -20 KPX n w -7 KPX n y -19 KPX nine four 4 KPX nine one -21 KPX nine seven -17 KPX o T -84 KPX o quoteright -17 KPX o t -8 KPX o v -23 KPX o w -10 KPX o x -25 KPX o y -22 KPX oacute v -23 KPX oacute w -10 KPX oacute y -22 KPX ocircumflex t -8 KPX odieresis t -8 KPX odieresis v -23 KPX odieresis w -10 KPX odieresis x -25 KPX odieresis y -22 KPX ograve v -23 KPX ograve w -10 KPX ograve y -22 KPX one comma -42 KPX one eight -37 KPX one five -43 KPX one four -56 KPX one nine -39 KPX one one -85 KPX one period -42 KPX one seven -65 KPX one six -37 KPX one three -44 KPX one two -47 KPX one zero -34 KPX p t -5 KPX p y -20 KPX period one -73 KPX period quotedblright -32 KPX period quoteright -29 KPX q c 4 KPX q u 4 KPX quotedblbase A 12 KPX quotedblbase AE 24 KPX quotedblbase T -75 KPX quotedblbase V -73 KPX quotedblbase W -51 KPX quotedblbase Y -92 KPX quotedblleft A -68 KPX quotedblleft AE -57 KPX quotedblleft Aacute -68 KPX quotedblleft Adieresis -68 KPX quotedblleft Aring -68 KPX quotedblleft T -2 KPX quotedblleft V 6 KPX quotedblleft W 16 KPX quotedblleft Y -9 KPX quotedblright A -69 KPX quotedblright AE -57 KPX quotedblright Aacute -69 KPX quotedblright Adieresis -69 KPX quotedblright Aring -69 KPX quotedblright T 1 KPX quotedblright V 7 KPX quotedblright W 17 KPX quotedblright Y -7 KPX quoteleft A -73 KPX quoteleft AE -62 KPX quoteleft Aacute -73 KPX quoteleft Adieresis -73 KPX quoteleft Aring -73 KPX quoteleft T -7 KPX quoteleft V 2 KPX quoteleft W 11 KPX quoteleft Y -13 KPX quoteright A -77 KPX quoteright AE -66 KPX quoteright Aacute -77 KPX quoteright Adieresis -77 KPX quoteright Aring -77 KPX quoteright comma -46 KPX quoteright d -27 KPX quoteright o -30 KPX quoteright period -45 KPX quoteright r -15 KPX quoteright s -22 KPX quoteright t -4 KPX quoteright v -5 KPX quoteright w 1 KPX quoteright y -3 KPX r a 6 KPX r aacute 6 KPX r acircumflex 6 KPX r adieresis 6 KPX r ae 4 KPX r agrave 6 KPX r aring 6 KPX r c 0 KPX r ccedilla 0 KPX r colon -27 KPX r comma -57 KPX r d 0 KPX r e 4 KPX r eacute 4 KPX r ecircumflex 4 KPX r egrave 4 KPX r f 22 KPX r g -2 KPX r h -4 KPX r hyphen -35 KPX r i -4 KPX r j -6 KPX r k 0 KPX r l -4 KPX r m -1 KPX r n -2 KPX r o -1 KPX r oacute -1 KPX r ocircumflex -1 KPX r odieresis -1 KPX r oe 5 KPX r ograve -1 KPX r oslash -4 KPX r p 0 KPX r period -57 KPX r q 1 KPX r quoteright 14 KPX r r -2 KPX r s 3 KPX r semicolon -27 KPX r t 22 KPX r u 0 KPX r v 21 KPX r w 26 KPX r x 17 KPX r y 23 KPX r z 9 KPX s quoteright -12 KPX s t -1 KPX seven colon -63 KPX seven comma -88 KPX seven eight -3 KPX seven five -21 KPX seven four -62 KPX seven one -14 KPX seven period -87 KPX seven seven 9 KPX seven six -13 KPX seven three 0 KPX seven two -4 KPX six four 7 KPX six one -21 KPX six seven -3 KPX t S 0 KPX t a 6 KPX t aacute 6 KPX t adieresis 6 KPX t ae 7 KPX t aring 6 KPX t colon -25 KPX t e -3 KPX t eacute -3 KPX t h 2 KPX t o -10 KPX t oacute -10 KPX t odieresis -10 KPX t quoteright 4 KPX t semicolon -25 KPX three four 6 KPX three one -27 KPX three seven -10 KPX two four -9 KPX two one -16 KPX two seven -3 KPX u quoteright -2 KPX v a -15 KPX v aacute -15 KPX v acircumflex -15 KPX v adieresis -15 KPX v ae -16 KPX v agrave -15 KPX v aring -15 KPX v atilde -15 KPX v c -20 KPX v colon -32 KPX v comma -51 KPX v e -15 KPX v eacute -15 KPX v ecircumflex -15 KPX v egrave -15 KPX v g -21 KPX v hyphen 0 KPX v l -5 KPX v o -22 KPX v oacute -22 KPX v odieresis -22 KPX v ograve -22 KPX v oslash -20 KPX v period -50 KPX v s -17 KPX v semicolon -34 KPX w a -7 KPX w aacute -7 KPX w acircumflex -7 KPX w adieresis -7 KPX w ae -8 KPX w agrave -7 KPX w aring -7 KPX w atilde -7 KPX w c -8 KPX w colon -27 KPX w comma -33 KPX w e -3 KPX w eacute -3 KPX w ecircumflex -3 KPX w egrave -3 KPX w g -9 KPX w hyphen 11 KPX w l -1 KPX w o -10 KPX w oacute -10 KPX w odieresis -10 KPX w ograve -10 KPX w oslash -8 KPX w period -32 KPX w s -9 KPX w semicolon -29 KPX x a -9 KPX x c -22 KPX x e -17 KPX x eacute -17 KPX x o -24 KPX x q -20 KPX y a -14 KPX y aacute -14 KPX y acircumflex -14 KPX y adieresis -14 KPX y ae -15 KPX y agrave -14 KPX y aring -14 KPX y atilde -14 KPX y c -21 KPX y colon -31 KPX y comma -51 KPX y e -16 KPX y eacute -16 KPX y ecircumflex -16 KPX y egrave -16 KPX y g -21 KPX y hyphen 0 KPX y l -4 KPX y o -22 KPX y oacute -22 KPX y odieresis -22 KPX y ograve -22 KPX y oslash -20 KPX y period -50 KPX y s -16 KPX y semicolon -33 KPX zero four 5 KPX zero one -19 KPX zero seven -10 EndKernPairs EndKernData EndFontMetrics gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019004l.pfb000066400000000000000000001061451404163720200220730ustar00rootroot00000000000000W%!PS-AdobeFont-1.0: NimbusSanL-Bold 1.05 %%CreationDate: Wed Dec 22 1999 % Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development % (URW)++,Copyright 1999 by (URW)++ Design & Development % See the file COPYING (GNU General Public License) for license conditions. % As a special exception, permission is granted to include this font % program in a Postscript or PDF file that consists of a document that % contains text to be displayed or printed using this font, regardless % of the conditions or license applying to the document itself. 12 dict begin /FontInfo 10 dict dup begin /version (1.05) readonly def /Notice ((URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General Public License) for license conditions. As a special exception, permission is granted to include this font program in a Postscript or PDF file that consists of a document that contains text to be displayed or printed using this font, regardless of the conditions or license applying to the document itself.) readonly def /Copyright (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development) readonly def /FullName (Nimbus Sans L Bold) readonly def /FamilyName (Nimbus Sans L) readonly def /Weight (Bold) readonly def /ItalicAngle 0.0 def /isFixedPitch false def /UnderlinePosition -155 def /UnderlineThickness 69 def end readonly def /FontName /NimbusSanL-Bold def /PaintType 0 def /WMode 0 def /FontBBox {-173 -307 1003 949} readonly def /FontType 1 def /FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def /Encoding StandardEncoding def /UniqueID 5020904 def currentdict end currentfile eexec  `,i"[[5j5mTʻ^+݄fKitrޟm%9۩*++`[&NfA-O!J"|UY+; <Ԟ2?.P2QhnDtw=y0)n*[ Y]~ ΁RzYi[AXm>ne壷hm65tL=7By#mcwW{ͪƴˑG8nq.!^1&:K4!}UqR[Ѿ'n_ϣA{z / QΨ6ykwbQ\e@Lo"ǀ*ƃW0KDTZ~C25<+cvnH%׃^׋ (6Sc|>T +ƄO#^-Q:N0r&fש .4k wȢ2ɚfSLj-@? gO bFP'xxхϖhIL"V$GMڡG|hzg!6dTk- Md^C66(@`{9 E,|ZsoDepr{7['dH0=$>zF}Hf ), ѹy^z x󀋇X,v5Z`zJΤL[^ی Wt|Rkm^,\C;ѕQ u{Oxgjw NS wzTdkSlu&DJRW"̮HGAsO =hd ;;4fHOI$8i漜X ygf nqWWŔ^쾀0z6^?d[':H.k}uUH Ƅ&Y-c}p9wX=HA]-2K =;tUҒfI&V?R=("N X&@@ Pbr?G/ĊItT\waWdL$©Å\_*ۡxO|Q 3%2C @ĺLv<# GZzlgZQND`I$;6 {8xv~yYntTd- -jqNZn8LxU_Z]GDV }cGk{^aF/aVƩxl y\Lk_ k &3$FjP!P\E[8]voPЍ]b1;jBiL9`툻EЏCXf ,Q`Rp9S < "\@P/=?b'D4,-N(6{܀8Bw =jmPa69-9로ݱ xl_PG~ݙmȏ_<@w>}vc0XLEd:ym.u8q '儍} r:"I̲l;Ίc{)cd'z#9P=;7],"*\ۻCTy07rk$C)g5^Ɔ&?Y"s,y߯m0I5A(~mjoGʍqL:em>˷pFoDq 'v;DҴ{NiL # ?ae3\.$BďFJ5-K?ϲ|(vx;*&8|l5k@lıS:^iR٩T;zHt#Ѫ./`FCӛm_Ё+)c۟^L/o_nސXCFۖSVV' ZKJSVZ 2/D`Hwh?(_Faj5az5 ;_1UV7 cNRXXUJF7:MːIObsO}x-mO:5d%9IDHb.k?_R1 Ue[?86Fl=o:*\$30mM6P}AlՉ?42LD?5͖9'1JDn#4࡛tUKo+y<Ż_E!v Tp) '~u&c8n9FG1?mI/};ϴZRy>hqE'3G/B' aёitNj>*rjn'ޕu{]s;?mxSjG17iԏW7u,:ɪ#0g8MVv;D&Jr! π1+ [C9E)tн@'\>DP1lbW87~9YeO#E"1Xu)c5Jk'X&TuI8eTMF`FVqx p\(9A9#SD]Y҆)]*!J;1 \d!bTe&IA;\J& z_KuNB|X5d|Fq~j Zc!q.,IsqdtR LZM۵hEId(Jʓm NܱR~px1a֮0OinUg*ùc4I:u#H. "~2rr{4LM@2}.:\x c,.!^ ʹW7r?nC tתm@TV>F~~ #4SU`#7_Nz&96t[wbuځ4ۘƣshH=MȎ=Ĉ2f _d2uO#w) t|D9!-y3̕@S <޷Sr8wf e^uJHUqvYמ$YmUW4x_)-Hʂ 90b~T9VsH~@ivV~W%2PbfTz֒s9==ӭƽN&F @U2 \ƄrT]!RM7}MG4PO2)"+wٴxXLE:2MHÀ_Ũ)!_:~~X;H[WN7JwRq#s"-} MuH O=5Ԛn3~5PmoBk:,q(BS`&(B >.;/)&4JaۮO/Q!4_y=o+ "-t~QRA>T [=̯>%v/U.!EFLoAIVgV`ÿXQ>g+9Hϛakl+bz9/}{Iԁܑ"V(4\%6~ R} R7@N&J{0e<54Ix^xs}8-wPltJrO_rLBKވe#^d{}&Nl^cyfXtq#heebQ~,y%,?Ұ k7`C#wCR]ب~ANf/#76y{g)ڸ>OB~.'{ W:R1}vݠ>PLKs66s/# J,2kDdƵ6s5{=DTjQq J'g0¢J(싌%ꀭxTz/~t 8ZV{U >΄&Si~(4'%vY;ԛG۰ygJ}xb{P#ּekSa̻ihadN}I\)o'Sѥ<ϞL mόF#zgE##@Bs8 /{e>z=꣔]0ߞ?mڻ|;qYhd;vytNT=ut'߉yrA)*4ʜ۩gLQ|b&&rH-VuѬBC맥H lEcּ[)Y{F,`7b6@eB}i &LͽSم^:.c)s(彲סtgc$ؽoEk@+Vq/ N1aQ QaDD\}ܗneW搸xl^*.f5"d϶97(#|fxM#qv , _~]?;a*FY N5&aM*>ɒwe{0Zgf0y!Eܵ^=18/y{o;m+ɄD-ƶkͮ.NL!;/8hL%*K8QRJUR0ETbR*V1.CS".8ljC#L2DIh&i6O5ؠd$oZM u{`;У",=غw|1e)OLvY  1-Ưe!4$>H-载ɗ}p`5v1_bZhiksxQTdZZ8>JJ*]@fHH$ߢQe"?3{\P|QEfۄE@ @_.48A dO2 vyKHG6M'1H"^@NSWg}E`e"p.u!Tp\,Jf#z5:5n0pEW_:H^ {Ǡ`9b>Ȑ1v J閌O WФ]ƟYE5U% F/@EDeIH`K=y$Jh16e9d^-ǸaFL?WDWC){2r~5畢!ܮLe=.Bswz]a[سQ'bV-j%6P?2b`CL_"G,(.c-',?焖l;=|Rp-eǥBJwQպ'dSBHm|,&9faF%(be\F޹A|oߍd[n7[*K?+5LuJќ9V-oCxfUɣ)]Z -U#o+w ;ws%3^rSe挳S\=/-w/Wl,yfX)7%jXwhnr9+ΠdgsK`6ĨlX;Җ!^Z^MsԴLXGJ ASJ/Ò4[#+ sKץ\*TjcV`+>.{"UFG*ȒF2 9A}/a⟦]B;>\BixX[m7Nv%(OWX c;ZS3E1kE*B23u>} *q=Ć3=7:NJΙg&_h;A~h`[w!{}U$1},Pg? TjLӦx".Ղa()`A>Tl@ih _g1ȊZ`TSMYj]ަCU]@ :&30 햐*#iT; (T1%y4}QU{e޸K%:R';N&Q$ 9Õi#-,ׅrci)n=={2 I6~dQ' Wt:m Ty +6,[yv͡~qBDΚi)Y-7ѧ^D)+Ȕ/}/Z"~0ռEvVb()1O{Z-~6MDDIv!l x<t^)^TTI3TdoXڀ*^!#ƉT:7\a5JL躹p+%b$Z , {T]mF&=j塄d}now^J?]8 *P-u춿pyΚ0[Q] fJaj6P}JYTS$-o5{O0lN^+wgv ݩ[3hz? ѱ@ !<]h/4T!26xpt>FXOEsPsSd׹fmT YIfa&67*ϻ1C).#18\fR(=X7n~+W5ZK51{ZG|]!b$W-?l'ʂs , >[Zs*Ƌ_3hA߳Nje5"g|XÔڋAE$Y{oޜEJ Cf2}{Du +QPϨʃPjZ/BoȊ ڧ=dzqzlI ~cpˆeZ0ÐꡖsڌeVM6_ (NqX[}#w"g mv F~ɿGq`A_ml!H:EB|c|pT ]pk]p:$@v@.Tr$. w^Fp U"K̓mc]tIcnjx )<{l__C_K(?12(bPQ5X'F29 ^r_ Rc&04 16$%b] .B?OH8=vXU(MW V/2ۚz6 FxDx/+Ûj9p$NjM;8UbV|7S flikd:~ҘHڲ.2aS[(&ez6v_q0ZQNT/ŐK ,¨}dzԈ|W cu%L^Lk!i (1 \F9( FqM7BP ?w5M-(Ҍ˷* (e_%Ȟeڇ^KZ`6,>`(sgf-?dX=͓HNb&9h%apRkޫ6v/>/>˅'O` GtKe|}]%M;Y\hW Z<Ś0HdS)^]v.A/2"؟[bE54/)0nw;zWHZ9~y%GCq,}XVѷ:g {~{s8Ir\Q>Q$<@# ̿._wCgA0f A | 단BF:3j4 E$tjs8?ԘE#~lQ˺q=3;w 닑yم\_ I.qݭ3okjֳڙ@9AJ_]biZ`[YWM 25Vam^"QC$7Fϟݳ{IH2F292ɧ8\J/C.u89]j:M zFҺ={x %xQ=x,Zid}KBQ_cIv9E*ddB:.h^}APM .S'XF5Be_[SWhezMJ&+"\V p$ute` Ӑ!cY?T1BR?},5q fܙimsQUvyWz"u~G.xsvrхF\ b-$v4BZcfm.}iEݗ)p88I~/8,n蝯Oo줳 [u6< .yWJT-{#lhB(VښvK+;Cq0@"Q-"!w[v]D4)$h<w6Enn֧pgzZV?An4Ic.3ZeݶM~Gl/Z^n oA%rͭtKuG"DPb$d5¼CH|^VE]-^ EEMlj&]8QV %<8W K.`*j $!CEdE.!""&F(,Tt)*w!T♖4!x^r>l5QfȊL?KarJryf=*!P: psl^tȱ,JV|ܬM<ͧA:XÒףۗpnbZHl(񾪇M _sÅv5S{Է k tߜc'9X3MNsU\ڔ^8\&_? *8K` W ocl5*Ehe; k 6`q f?{HG, Ho tcJb5y3˕E7+Q.h)Yuj""˪,H4Gvfa p&ZBAG`wSX?sI֦h`Va!̈Qr;ؿW^ʻoHii9Ӛ*O`EBWml<+* Ѐͬ({ mr֩iͫM1㿠}_Uśzs\I[ ߑg^O*޷xv{Ƹז, _Ug+gCOdNQQ*=4vZH1k(v/ S~&GwW=qש|yK&i6:ҍθ59$L |q,go օj\BI=kQ Xݦ UlP*]20>VoDKP=m<9.8b 3bv1?:;冑%~(Uګr T0"V̵rDV6cԍ|[ :8wLsT`Dgpt1)Gq Ϯ(OJr`/jqjLoVdۖh 4ShRF0hʐ׎)PNVIm rL̍$OEOi3좜efL1k,($[bfAkWO.)%HY*eq7\5gĽWxAӒl/n%*OrQsƺ5i1rZ#E R58؇ʂwmnɾ;iQRee7m 1*{cCD X88^X]ȩQ[Ghq%͑oX>1ISX d6ZC g ə}8(0G'& KMC 96yNT5BB1yeM L ?6,ShF^>C=dx6GK4]-\];;㉀#{QC5Z$j@ܩ#' A?s |&ެ>%={:yʲO6Y8bJ+=ŝr%2U~Z&W[rBq xU;x{U>}7`o0';՗GZGx "!U5/ΟѪMh{Jsx N|C ѯyx2 v&l@ɬ:§qbJ0 ' >Sm[ƣU5A wfJqyj~ >l,ho-ai:T뺾X{dWq^*I6B08NV;ǭi@d [ڨrDeHxaM7+7: /Wfae8hrwB?,'!*L)_ه a-4\.,)Um7e~#$d 15C6kYg^C=~  0ߺGm7u#NJaPP&/ISVwz.-t:cҦ.|vue(3$)#Cf&ַͯ dXS1оi:P:l@֊`|bZ(܏"̙}]bP'Y--i ݻ>rwrwaմ[jH0e4hE!!4Q$l6ڗnI{J0dI2Fm{[MUf`et#=C@c  !qX%J2G*c @5TCWPK1'MX拉ǍMͶ5uXW9pw3Ye&6'8W +fj]ɮ}xŐ; Sfj'ZeIzu&RQPkj fAKW`$]s=iW C@ V(`*1N8` =W_E9qԁNLuLM^yV){lAPBs7\N28wc!uͦYBB+XS`\*߆Ot5:Ǣ3amٗ.n)yna>GI@C[ןAI:5F,8Ixh8S6`{=Pd"(MV{^n"rbCL>M& /<`L]>]dh_H>i#enJykl97.Z1PP(kM2No:~>uNJN_:|FN^$Ʒ=o(9WJ՛dO`M6]Sֈ)BKXHpf̑u{ܺ8.|3(dv"J%Ho 12p qηM*[Ŧ]`K*$z9Mu/X)dї5,e(rm5.LLQϦc?ҹt W;I/i˷.g?J9ɸM7Oڒ yz,M'g# _ivd g2nnj[wO ?ix}XqC{\fI u}U89|~wچ+. U) T" iY %=ܻ>PL~bLivKWь!2"4k7Va5 GPO%BmoE.<\A r飛iH!IX1WmPsw㘤Wa Vu Ϊ2Nz5Yɗ{Mp.ɴoѾOXٶ@\/[z_-NhpoIs[LQY"Fӊs[ _CܒHZ2gR af3vDOnEv -iEQr3sZu2A,mr43e#Uz39h}# u2 Lpڄs@`^apl)!I* ?g1HL I{@C5@c%k"{FHQJĦ&. !L{X\a>1eE[z:\kCjT.l6SVI M m05YRqp8p#8ߦs}=q.M6cATa+E*bu2ˋcҁ.>|GdCÑK4:" E1:d:'چ!i>Xp zղv+2lzSMFoɋF@AZ"eذrI$|K4-Ћ%&T ¥U鄑W=$0m~ \m$;)akܠ<\' _9f jŎDQ>9>`5JD# |Q=xb$Aqmf qCG}F&[IcڜCAGNW Io7KP=գn|,v}{?YyjIQ\(2%'Z,,\6:݇xOeۦ!aVYƔ'˗øf!uJzİfBtn2tvx^n#kx.4(1#0&B( bBvFT(]"sDҺA$QNC}g]eCL܏tk>lGŎ} j,7_\|{q4LW_A!IKMIXk@-,u^ diBԊ3h0 #*\o7CL4yT';YhEYvJנ}.H])p#HG#A1PkIG9E9m6oʮy͊\?n8=_O̎7~œ Ju!N!֨ e7Jxʹ9V)eڬVIXMqjAna3,FS-CyQ c*YGR@7LE}wARNHb+mS^q{Ej6{,/ؾbźnxm]ZQn%?f=vtİB*zF4luN''}v4hf9Fۯ:ouFN84Ζ `91TM듼 }qvlTm1Qs֮$Q`6.SfBUꎟenC%6v{Ϫu}[(Dՠo4#5bnO-Z'V[2{Nڟ>Lw6Ը)_|")KSZ.|ɿ-!00TB*n8~[ $;,8 "'kN.Nsyd[b]9Ew0o,i^3 #P&:ˆ7CLcQ. %t٭Km'u"IHztq#|.[n5HûHaABp&>Bei/* BCd|>ӘLg'!A/*{ *7.ܚ6絀 X zatc{*A:ο RlꋫZc3]WQ$f˹#fL 5|Oݹbb6 d߉BjM M1o|+TӞ{M JĂN#xIcy|tz'+[~7;.X"(ASU`% hNLXɨf \*!gM QԀT{:!gKЙ'/osNS e>&7c)]^_!t~thjZnBsT?}K}qgŊSx7׃6( HR0E9:tEGST OE Y>.:T<ĒȧnqF>.M<3t6X#̞U?< cN$vd-j@%(Gw׋B" 7[g{|sM_vF` \7H.-_7J+rwn#<#';WMMAMgc=;ڣ8wUlnFhɥUÉ467~|Zd>\6 N$UGuSg+ރ#*sm+Zk}8ⱽMڕ =KiBF/RM˩ߙ;x>7D=,qt1(ѧݝush}57X LDUv`,x:UJIyf-&J}#NP?wU{ra@ZJ.!gJ184I:Y>tb(` TjuA95zyW> tC W$٘RgblY{-CO뤟UƑ7Nz%:Zަ@߂X2{w l3F7蠋wi!oxt^3kVцK1Jm6F)[ ~OagԼ鶚YVr1} ,'>՟`mBajǁeS!ΫBw+3*$7kd*5^aXs"vBDs,[M󶳘4e~@_B:q}Tp|GhМ$mH7oG꜎(OaGX-=}M^\ +hbu{N垃V1(љqzWB&xrneb4QNU6 {ϻ&BspJj\ 7Š^͚)tzVsC?^ q9cV ɞxQ@rV׌ʴ}x##?9 ǁ@9^hJX9@6$Pf)>]M! iYU 8>M 6?+e?%+`:fKF\_pyK{9/h=iyBT\;6^F`BC"ϒWoOGxj,{CXf8ğVAB2B}[B=˗vDF>\-4ϯ n[|Q.-VM3# O9 g- Ѽm^u_%~ 8eR3;ġ2a_<,ߟȿK/e 3{ỡk3jaJoSJ y4/tHӿK?W ]=7\%ꐬ8>D[}pgCc"_4b+TA662<v]t)ޡP rW<eUX,ߋ.t{8CI,wKyO7h1Kk@oAm%;Cٰ/쎠 )^_!O`]wP(U@ ڳN]%Ãk.A)cٍ,@՜޿V`(bﲎVjTK|41kHFcs?m>ǼNN)r08HPcNWQ(YLG` bqM$AͿ7,@ϩ-~|1dv;ٝp3?'OCQS`Sbq=OPlCF9\nNi5W%Q#Պ +M]<&([g݈LPzZ7ouzxI pOV`ճVb 0i &=d&Ƀ7 G9 =M oګ5dvݒL-c-%S&dk\D\ӆWa|*p-Bíϛ¯K 4T{UM`e.)2n1ydV_n/&7d34|:瑮5͉$Y65⍪ZzĄkXxN쉥IMLTd`"d%s!**_g%.巁1mWP\@ŘRR8!2`٦O/5řV{ Lgl>ka1gbej^ExW|ьqq9aɶdf$ wkzss,>ole2](@n:!BG(JTZӏb3R48dB֛)k2XCqLf}1G0hI MǺl-q#W:i30r')h|\D׭LA8gSA)sےIG9_6B'tz4=,| ~."HY| sH-dH]E"DkJ?|QA0&ýToVpJgVh! X\W{':kC K9;m4aQHWo?ⲯs al:)vUILx74mtVGf1PeIAeW[ g +,KϤ+ JߙV#֗% f?!Ph8<ٴl<-Wlݑ<6ap= daVQ_[l?Amv~KƢXs[e#p a11N]RJTedgzkPwևwmA@㌚iY}/qbkd6ݹOn4,Hs$QDc _g]_hiP_К&%@BehE|`_D)gdoY(Ѣw&{c7#K+ kWAuӐ02g?C !.=yJ[Wb48ߓQHizS,ImϪ\i92x"Jo> Pz Cd, ,f8>õ|1m8)zp5{ :K0Tց=D3%i5c) zKKT'V*y37a&'F&W] #}VK2N] e#B?#2]BEd-ƈyHŷdX:֡}i#a-4w-W'kmY"j8ʭTnLꖉ+%#vnu 'K`1;O2Ϥ.R4 |jГ s<s%x^ՖꑀL 9c^؝ACn>x㬣ӹsub$5l鱤Ojuu S*kfE ^DY`+.26@}n:1Hf2d6ANn7\nc,(ZPaCod Pʯ|9L>U0ٶ"Η]{ǒ Gt?JL^oye^C{}Ae]n.SDGy ȭ1Tk Sta[|,g lɻbb9)H}/",߅O&?O"eR3.KS`{ T ̭17*nl',__W.xMCpCḆEjݳ@;>PWNUL<'&>lƣHOJXY@m'LUdxsdu Ft FQI;OoPSHaB{T0To ˵,]}xd{.f]Ď+Z 3c-DM;TdgF߱a|?yaW?Vz1x_*kEL"^H).jJnLos?L%-rɣ'?jWVI/tߚ؅[ Lc-H+#)#fcljۜ &aR=ԠWwH9u|S҇ڵ$نHzbPLg)޲=?{ok0m9vxqߤ/x>(u$u.Vnnecm82:TY]*mXnۋ ~&*i@AN^8+EM hhтg 1%!VD+u&Sײ%NN2շW͊2B>ʢyҩ<{h"dNJ9}՛ɩmK*[m{ő!Ki80Oxd;;UM/Ck<7&gqz[o220R=hv@|e+&xOkU:_h&[>`N_q׉#UԸ%t o$3y,>\q5 ,U:ڌs_~!u5!KPZW k3G`E ƥ8J@`7 Ԡ1 3@)/@xÀ 2pF6aunClT_4пMlT4o+4n@.0黁iݳ!h|bS瑑 B_z]ES ,ފsTM ėFpu&J`hf+ ٿ0`Tb5CuƌY"Gc؊grMݰ[=]χ'C,Et ~Ъ99/'D6wjB3]fHN\Ú&- ܠm^+%T)hI8?wɩiDEBC*h󸏵𛞢>:%&_Z#TyL@!U錷 @Mޠe҄)°&٘ysS(NоQ_>&NVd04󔇺*"-OPbsM!ȰDޮ<=7P!w{m&G^.u͙j, nQ]1&g mpn_1h%jK_Zv+ (E5+ŔlyKʐgܮZ%v9afoΜ+h7|gnrH4:vX)5s͗O$5UJZ]Pmws->()8 fV\Xls'%8z-<2ѧMԖ⫿nlbE:1~qR\lii-.{tƳMk[TA.+цzI5ޞ-_=Hq/ @ =zkf0XuLT"AەXO| fg"O^U?\jvȖ׹ I8)[%=]tǎ)H})I$㬸'?b'XE M'+9LauGX~4lMK;YZGjpѹ2f8Pl7/ufK `]̬vU#OZY=tIV'HK.hfzk.k=D ɼǖln |n +D՚:&]㕰dCg h13vZ{+ٷB@D6.NSPunCQHb58L5DT.YjNK,N$C!,i}c ,)PyC)^+Qm ۜ{eQm#$?9wTo7duT=e meBiLvm9Ni+ڱW |X]>`Oj0Z& /?L>;i3[lまYjVE~_DSj_ϗ~I!m~ψ)Zqxf $RK2M9Hmus`QSw,ɲ<4Lxd,/GfYI17C)a &lk /ފpLB֎?) j73poCɻ) ag䘾m.UYܮ]U~#sSF~t22ET!(F wTZ -,T w~vKtvJ=9S2u;y=lWy*L}CO)Ӛ" h6k@p@!+_?ih+3J$$9aLJ:zt0=7?UlMmP(J9"uT'Cj PLG:aBD} *5 :t.m3vَ]*Em FP]%|):?ħiC Ow-!#f5CYk3Ջ`yOv>WBQ*{|RC Z'I隥+ك6b2i+}*? hF^FCRcݒd3ܬu\77qP%ːņaK8ғXm m ~ Z_5vl\ 65B`xb3{u3 E_Hr/nRjнG! žLCQi3 @rXQ_`F7Rzҋ `:ō,'{b3GUa "Pk:zv%v(*X"iXK%C;lƷ(:܂,qӈGWk0;WsžOC*dzڔ!֔рg);ʼ6Ϛw=ci 4#"9+41P",o^ɱ.w:HlQIdGn<[7ͪkyܒ0?<Y&5[.ẹ*~]C~p&Nrs5eo{mN\<ll⼣w?rwSdm!! K;Y,B<e okK3;_+ioχ1OrTWuLÍ9a@X%H31+V @PDW;wP0&53%Ot-275EL4C~;s.,5b7@f  $Y)k֚RpGji|Z(n}Ă.Tb|Qzeo(G|fs6=S布XJG08%:iwL:čR]}~AiH^SG>UT;^GQ #kq!!b'‘hB3䃏ui%[2Q=waab?7M^ W,Bsxi}+ 7#ȑK">MIRY#tu&'fXAۓj-L+{b+;:9:~֕6G袺v~ӼTB/;ɮVIքycto#n _!LED%UC0MO/00٫VǸar.{co W3(8&]ثstq,܈c5 }g(`|bLHq;ĊY Dn(|œgF!ـz뮁ΩX K;mD?-Wc4ղ@%`D6݌ߣDKvFv^6v&xS]/-#l#N\WN *@Yg|Hȴ eO%,… ^>K81?pN-Wò {le#2Vk (1gxj {s (\C1aem~=җ;>}DO"2T[JO ޑ " >y .=h0ҹ*"5؀Ar_ḀD=eϪ-NADe;q4~!6QcyfeO{;OMw-=r؋+J嵄KE3}R0Р9K6k[y7E2NQN/iy7tًa<).^3X2zX0iΥhukWlNb~*LpRImGs- |ۘ>@jtf]&TۥNЊ-#u`s i(6zBhT B؁ P^YY|һNa*DlY)N9kX74!f V@`8$#"ťGFիv괜jcJ(b㠾)#b+;B-]ϖDƏ#L.zk߮RCR_Yȝ޵*4ǿ钛VXoz=gZZn$#B'ǀ۲\/'ff?7#̣BNB5PB"zM C\ ?yw Lilͧ[CLȮד7=~X$G|fw씏\Y3cV GPA'R= =1}DL8x?b2^$G (ZҤrH*mہ#)4F,+_*VD?ANCuVBES$ n$XAԫ;1J@ia΂|:b_R'V 1*s9[ʥ eZ([vr7?LTF׶v!7Ԍc^432Ȝu?5yD -f`ҤrT?Y1\n^QFXg )pՄER Bο( "8CGӚ:픑4-Zrs9xG |E?LsB3,HH.aп>roXl>b΢nڤ~8X尲+tM%|MPĆ< {e&˚Q(P8O+G(+IγlKwKy ".|. &_zj2дuЬ; fw1 ʢnY7ĂI;ӿ#ԇq>Rjh<-&VQ£$.vc=|X4t>iG܇ ߪ֘b2O5>>ZNE圷bMl<n7Q41ֶ3*'͇u-l_Q|d[!W}7vZ6|$$djQSVj8Kx O2U,|Uҍ f%0Cn 89^.eߦeU m<_ t-s5{XXlہoSMY)y%?edVwJf4)fo̙qWaB}BўcHND PI3Vi?>U6%'7îf}#|&4Lb Jhxԡ]3c>a٣C X'!wE"żonctOK,K>lc f븏~ HpGOd@.g_4%EwP,-*[Wrϩ2a;7'z-slR_BVٴl}(9r<ͤ<jo5y2N9s:lEA,ttؤPWmf?;4_T}&mRvVf/;g/e=Cqm]naA޶{Ne?+.|[iI~ےSm4s*Zǩ?`Y+Ȳ= Ldɝ;T٫++#)>Mu=},uj٥,.Ykԙ=ˇwqm ѦgzX4LuhD;6AvtuJ*G&VȞaD笨 Ql}gk!h@/RV aB ugm•k [s61}A5K -s0(.uIU_7U^:Dr{9Q0 䌊ᮥ$䯗@Tw^RY^;GU1/F䩑x_N+8L@XMy  I[j7i+ڐ(+qJRsSocq2|%T~6Š]RDFA/=TAAFVj-0~f@{:u ڎàuyCIa嚋rCҀsZYIDzs#oB4qv\tmMtʱtduȍI|v8ws-bm!x0K?h (gA|S{,u@]dtkUkZ$BQ3iq~r`PG~^Ɗ=>\;[ݺ1&z[$DRBvRwƿ&lf? PXcOJ%8F8dBx N!!_Q @[`/>$Qﺜm~ExDƜ`IM#V'r4!df]ʥ|vgq|#@!˂q@T̀0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019004l.pfm000066400000000000000000000111071404163720200220770ustar00rootroot00000000000000GCopyright 1999 URW Software. See file COPYING for license.op ,,4 u,xExEE1EPostScriptNimbusSanLNimbusSanL-BoldM,,yMMHM,,,,,,,,,,MMHHHcc ,cA  ccMMH,M,c,c,Mcc,ycccc,Mc, ,,H^^^,,,MM^^^^^,M,M^^^M,,,,,Mr,H^^^H__Mc,^M_m,eeec     H c,,,,,,y,,,,,cccccccHccccc,c,1,7,A,F,N,P,T,U,V,W,Y,k,r,v,w,y,,,,,,,,,,A-F- K-L-P-R-T-V-W-X-Y-k-r-v-w- y----1.7.A.F.N.P.T.U.V.W.Y.k.r.v.w.y..........10,1.101112131415161718191127213730414243444 54647484 94157516760717273747576777 87971878197:T:V:W:Y:r:t:v:w:y:T;V;W;Y;r;t;v;w;y;-ABACADAFAGAJALA NAOAPASATAUAVAWAYAA AAAAAAAAAAAAAAACKCLCNC RCTCVCWCXCYCCCCCCCAGKGLGNGRGTGVGWGYGGGGGGGCHDJFJPJTJCKAOBOCOFOKOLONOROTOVOWOXOYOOOOOOOAQXQQQQQQQKSLSTSVSWSYStS-TATDTGTKT LTOTRTSTVTWTYTiTnToTTTTTTTTTTTTTTTTTTAULURUUUUUUU-VAVBVDVGVLVOVRVSVTVVVVVVVVVVVVVVVVVV-WAWBWDWGWLWOWRWSWTWWW WWWWWWWWWWWWDXOXX-YAYBYDYGYLYOYRYSYTYYYYYYYYYYYYYYYYYYAaFaKaNa PaRaTaVaWaXaYafagakaratavawaxayaaaaAbbbbbAcTcqcrcvcwcxcyccccAdrdddddAeFeKeNePeReTeVeWeXeYefegekeretevewexeyeeeffrfAgTgVgWgYgkgrgvgwgyggggchrhthFiTiViWiYifiriFjTjajfjijrjckrkflglrlvlwlylUmrmmmUnrnnnAoFoKoNo PoRoToVoWoXoYofokorotovowoxoyoooooUpYpmpnprpppAqrqxqqqqFrTrUrVrWrgrrrrrrTsfsksrsvswsyssAtStetftotptrtstttttttAuFuKuLuNu RuTuVuWuXuYukuquruuuuAvTvYvZvavbvevlvmvnvovrvvvvvvvvvvvvvvvAwTwawbwewmwnwowrwwwwwwwwwwwwwwwexoxrxxAyKyLyRyTyVyWyXyZyaybyeyhylymynyoypyryyyyyyyyyyyyyyyrz ATVWYċŋBKRT,.ALvaef hnorstuĒŒ,.ALsĔŔFPRfrATVWYīūDFGTVWY-BCDFGL NOPSTUVWYBDFGT©UV¹WYªBDFGTéUVùWYê-BCDFGJL NOPĿSTĩUVĹWYĪķijļĻ-BCDFGJL NOPſSTũUVŹWYŪŷųżŻ- BCGJLNOPSTƵUVWYƶƾALN RBLTVWYBCKLNRTVWYBLTVWYLTVWYABCFKLNRTVWXYBTVWYAAAALRrvwyFN PRfkrtvwyrvwyvwyFKN PRfgkrtvwyFKN PRfgkrtvwyFKN PRTVWYfgkrtvwyArrvwyFNPRfgkrtvwxyrvwyrvwyFKN PRfgkrtvwyrFKN PRfgkrtvwyFN PTVWYfrvwyRKLN Rkgnustep-back-0.29.0/Fonts/Helvetica.nfont/n019023l.afm000066400000000000000000000765621404163720200221010ustar00rootroot00000000000000StartFontMetrics 3.0 Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development Comment Creation Date: 12/22/1999 Comment See the file COPYING (GNU General Public License) for license conditions. FontName NimbusSanL-ReguItal FullName Nimbus Sans L Regular Italic FamilyName Nimbus Sans L Weight Regular ItalicAngle -12.0 IsFixedPitch false UnderlinePosition -151 UnderlineThickness 50 Version 1.05 Notice (URW)++,Copyright 1999 by (URW)++ Design & Development EncodingScheme AdobeStandardEncoding FontBBox -178 -284 1108 953 CapHeight 729 XHeight 524 Descender -213 Ascender 729 StartCharMetrics 316 C 32 ; WX 278 ; N space ; B 213 0 213 0 ; C 33 ; WX 278 ; N exclam ; B 124 0 363 729 ; C 34 ; WX 355 ; N quotedbl ; B 177 464 455 709 ; C 35 ; WX 556 ; N numbersign ; B 54 -20 649 697 ; C 36 ; WX 556 ; N dollar ; B 69 -126 613 770 ; C 37 ; WX 889 ; N percent ; B 134 -20 895 709 ; C 38 ; WX 667 ; N ampersand ; B 83 -23 644 709 ; C 39 ; WX 222 ; N quoteright ; B 166 477 309 708 ; C 40 ; WX 333 ; N parenleft ; B 113 -213 446 729 ; C 41 ; WX 333 ; N parenright ; B -7 -213 325 729 ; C 42 ; WX 389 ; N asterisk ; B 169 438 471 729 ; C 43 ; WX 584 ; N plus ; B 92 -11 591 473 ; C 44 ; WX 278 ; N comma ; B 55 -150 214 103 ; C 45 ; WX 333 ; N hyphen ; B 97 240 351 312 ; C 46 ; WX 278 ; N period ; B 87 0 213 103 ; C 47 ; WX 278 ; N slash ; B -12 -20 434 729 ; C 48 ; WX 556 ; N zero ; B 98 -23 598 709 ; C 49 ; WX 556 ; N one ; B 208 0 498 709 ; C 50 ; WX 556 ; N two ; B 34 0 620 709 ; C 51 ; WX 556 ; N three ; B 71 -23 599 709 ; C 52 ; WX 556 ; N four ; B 63 0 573 709 ; C 53 ; WX 556 ; N five ; B 70 -23 629 709 ; C 54 ; WX 556 ; N six ; B 93 -23 611 709 ; C 55 ; WX 556 ; N seven ; B 137 0 671 709 ; C 56 ; WX 556 ; N eight ; B 74 -23 604 709 ; C 57 ; WX 556 ; N nine ; B 83 -23 599 709 ; C 58 ; WX 278 ; N colon ; B 110 0 326 524 ; C 59 ; WX 278 ; N semicolon ; B 78 -150 325 524 ; C 60 ; WX 584 ; N less ; B 87 -9 635 474 ; C 61 ; WX 584 ; N equal ; B 74 111 609 355 ; C 62 ; WX 584 ; N greater ; B 48 -9 596 474 ; C 63 ; WX 556 ; N question ; B 184 0 630 741 ; C 64 ; WX 1015 ; N at ; B 80 -142 1036 741 ; C 65 ; WX 667 ; N A ; B 17 0 653 729 ; C 66 ; WX 667 ; N B ; B 79 0 711 729 ; C 67 ; WX 722 ; N C ; B 112 -23 770 741 ; C 68 ; WX 722 ; N D ; B 89 0 759 729 ; C 69 ; WX 667 ; N E ; B 90 0 751 729 ; C 70 ; WX 611 ; N F ; B 90 0 734 729 ; C 71 ; WX 778 ; N G ; B 109 -23 809 741 ; C 72 ; WX 722 ; N H ; B 83 0 799 729 ; C 73 ; WX 278 ; N I ; B 100 0 349 729 ; C 74 ; WX 500 ; N J ; B 47 -23 581 729 ; C 75 ; WX 667 ; N K ; B 79 0 813 729 ; C 76 ; WX 556 ; N L ; B 80 0 551 729 ; C 77 ; WX 833 ; N M ; B 75 0 916 729 ; C 78 ; WX 722 ; N N ; B 76 0 801 729 ; C 79 ; WX 778 ; N O ; B 104 -23 828 741 ; C 80 ; WX 667 ; N P ; B 91 0 733 729 ; C 81 ; WX 778 ; N Q ; B 104 -59 828 741 ; C 82 ; WX 722 ; N R ; B 93 0 770 729 ; C 83 ; WX 667 ; N S ; B 89 -23 714 741 ; C 84 ; WX 611 ; N T ; B 158 0 748 729 ; C 85 ; WX 722 ; N U ; B 124 -23 800 729 ; C 86 ; WX 667 ; N V ; B 185 0 800 729 ; C 87 ; WX 944 ; N W ; B 177 0 1084 729 ; C 88 ; WX 667 ; N X ; B 22 0 794 729 ; C 89 ; WX 667 ; N Y ; B 168 0 816 729 ; C 90 ; WX 611 ; N Z ; B 28 0 737 729 ; C 91 ; WX 278 ; N bracketleft ; B 19 -213 405 729 ; C 92 ; WX 278 ; N backslash ; B 147 -20 280 729 ; C 93 ; WX 278 ; N bracketright ; B -23 -213 364 729 ; C 94 ; WX 469 ; N asciicircum ; B 115 329 496 709 ; C 95 ; WX 556 ; N underscore ; B -59 -176 551 -126 ; C 96 ; WX 222 ; N quoteleft ; B 163 477 308 709 ; C 97 ; WX 556 ; N a ; B 65 -23 568 539 ; C 98 ; WX 556 ; N b ; B 54 -23 588 729 ; C 99 ; WX 500 ; N c ; B 76 -23 554 539 ; C 100 ; WX 556 ; N d ; B 73 -23 650 729 ; C 101 ; WX 556 ; N e ; B 84 -23 580 539 ; C 102 ; WX 278 ; N f ; B 89 0 413 732 ; C 103 ; WX 556 ; N g ; B 32 -218 601 539 ; C 104 ; WX 556 ; N h ; B 70 0 574 729 ; C 105 ; WX 222 ; N i ; B 66 0 305 729 ; C 106 ; WX 222 ; N j ; B -65 -218 308 729 ; C 107 ; WX 500 ; N k ; B 58 0 584 729 ; C 108 ; WX 222 ; N l ; B 68 0 307 729 ; C 109 ; WX 833 ; N m ; B 71 0 852 539 ; C 110 ; WX 556 ; N n ; B 70 0 574 539 ; C 111 ; WX 556 ; N o ; B 80 -23 576 539 ; C 112 ; WX 556 ; N p ; B 7 -213 586 539 ; C 113 ; WX 556 ; N q ; B 71 -213 607 539 ; C 114 ; WX 333 ; N r ; B 69 0 436 539 ; C 115 ; WX 500 ; N s ; B 61 -23 520 539 ; C 116 ; WX 278 ; N t ; B 97 -23 366 668 ; C 117 ; WX 556 ; N u ; B 88 -23 594 524 ; C 118 ; WX 500 ; N v ; B 122 0 598 524 ; C 119 ; WX 722 ; N w ; B 118 0 820 524 ; C 120 ; WX 500 ; N x ; B 17 0 583 524 ; C 121 ; WX 500 ; N y ; B 8 -218 590 524 ; C 122 ; WX 500 ; N z ; B 31 0 557 524 ; C 123 ; WX 334 ; N braceleft ; B 91 -213 431 729 ; C 124 ; WX 260 ; N bar ; B 54 -212 315 729 ; C 125 ; WX 334 ; N braceright ; B -16 -213 324 729 ; C 126 ; WX 584 ; N asciitilde ; B 137 268 594 438 ; C 161 ; WX 333 ; N exclamdown ; B 76 -205 317 524 ; C 162 ; WX 556 ; N cent ; B 96 -120 585 628 ; C 163 ; WX 556 ; N sterling ; B 44 -23 628 729 ; C 164 ; WX 167 ; N fraction ; B -178 -20 486 709 ; C 165 ; WX 556 ; N yen ; B 100 0 696 709 ; C 166 ; WX 556 ; N florin ; B -32 -212 696 738 ; C 167 ; WX 556 ; N section ; B 63 -213 589 729 ; C 168 ; WX 556 ; N currency ; B 110 133 593 556 ; C 169 ; WX 191 ; N quotesingle ; B 173 464 292 709 ; C 170 ; WX 333 ; N quotedblleft ; B 146 477 449 709 ; C 171 ; WX 556 ; N guillemotleft ; B 147 106 548 438 ; C 172 ; WX 333 ; N guilsinglleft ; B 140 106 336 438 ; C 173 ; WX 333 ; N guilsinglright ; B 109 106 307 438 ; C 174 ; WX 500 ; N fi ; B 83 0 591 732 ; C 175 ; WX 500 ; N fl ; B 88 0 585 732 ; C 177 ; WX 556 ; N endash ; B 46 240 628 312 ; C 178 ; WX 556 ; N dagger ; B 127 -177 620 709 ; C 179 ; WX 556 ; N daggerdbl ; B 51 -177 620 709 ; C 180 ; WX 278 ; N periodcentered ; B 166 192 293 295 ; C 182 ; WX 537 ; N paragraph ; B 145 -178 677 729 ; C 183 ; WX 350 ; N bullet ; B 120 220 376 470 ; C 184 ; WX 222 ; N quotesinglbase ; B 37 -128 180 103 ; C 185 ; WX 333 ; N quotedblbase ; B 20 -128 322 103 ; C 186 ; WX 333 ; N quotedblright ; B 150 477 452 708 ; C 187 ; WX 556 ; N guillemotright ; B 121 106 518 438 ; C 188 ; WX 1000 ; N ellipsis ; B 115 0 907 103 ; C 189 ; WX 1000 ; N perthousand ; B 93 -20 1024 738 ; C 191 ; WX 611 ; N questiondown ; B 86 -217 531 524 ; C 193 ; WX 333 ; N grave ; B 179 592 357 740 ; C 194 ; WX 333 ; N acute ; B 218 592 458 740 ; C 195 ; WX 333 ; N circumflex ; B 146 591 433 741 ; C 196 ; WX 333 ; N tilde ; B 130 611 471 719 ; C 197 ; WX 333 ; N macron ; B 160 627 450 696 ; C 198 ; WX 333 ; N breve ; B 165 594 471 729 ; C 199 ; WX 333 ; N dotaccent ; B 244 612 370 715 ; C 200 ; WX 333 ; N dieresis ; B 159 612 446 715 ; C 202 ; WX 333 ; N ring ; B 216 579 396 754 ; C 203 ; WX 333 ; N cedilla ; B 1 -214 264 0 ; C 205 ; WX 333 ; N hungarumlaut ; B 91 590 505 740 ; C 206 ; WX 333 ; N ogonek ; B 35 -205 246 0 ; C 207 ; WX 333 ; N caron ; B 176 592 463 740 ; C 208 ; WX 1000 ; N emdash ; B 42 240 1068 312 ; C 225 ; WX 1000 ; N AE ; B 11 0 1087 729 ; C 227 ; WX 370 ; N ordfeminine ; B 107 303 441 742 ; C 232 ; WX 556 ; N Lslash ; B 75 0 570 729 ; C 233 ; WX 778 ; N Oslash ; B 32 -24 867 741 ; C 234 ; WX 1000 ; N OE ; B 101 -23 1108 741 ; C 235 ; WX 365 ; N ordmasculine ; B 114 303 452 742 ; C 241 ; WX 889 ; N ae ; B 59 -23 915 539 ; C 245 ; WX 278 ; N dotlessi ; B 94 0 290 527 ; C 248 ; WX 222 ; N lslash ; B 62 0 312 729 ; C 249 ; WX 611 ; N oslash ; B 19 -30 639 541 ; C 250 ; WX 944 ; N oe ; B 85 -23 966 539 ; C 251 ; WX 611 ; N germandbls ; B 126 -23 655 729 ; C -1 ; WX 722 ; N Udieresis ; B 124 -23 800 914 ; C -1 ; WX 722 ; N Uacute ; B 124 -23 800 939 ; C -1 ; WX 667 ; N Scedilla ; B 89 -214 714 741 ; C -1 ; WX 611 ; N Tcaron ; B 158 0 748 939 ; C -1 ; WX 667 ; N Scaron ; B 89 -23 714 939 ; C -1 ; WX 722 ; N Rcaron ; B 93 0 770 939 ; C -1 ; WX 722 ; N Racute ; B 93 0 770 939 ; C -1 ; WX 667 ; N Sacute ; B 89 -23 714 939 ; C -1 ; WX 778 ; N Otilde ; B 104 -23 828 918 ; C -1 ; WX 556 ; N ucircumflex ; B 88 -23 594 741 ; C -1 ; WX 778 ; N Ohungarumlaut ; B 104 -23 841 939 ; C -1 ; WX 722 ; N Uhungarumlaut ; B 124 -23 806 939 ; C -1 ; WX 667 ; N Yacute ; B 168 0 816 939 ; C -1 ; WX 722 ; N Eth ; B 89 0 759 729 ; C -1 ; WX 722 ; N Dcroat ; B 89 0 759 729 ; C -1 ; WX 611 ; N Zacute ; B 28 0 737 939 ; C -1 ; WX 722 ; N Uring ; B 124 -23 800 953 ; C -1 ; WX 556 ; N gbreve ; B 32 -218 601 729 ; C -1 ; WX 556 ; N eogonek ; B 84 -205 580 539 ; C -1 ; WX 556 ; N edotaccent ; B 84 -23 580 715 ; C -1 ; WX 556 ; N ecaron ; B 84 -23 580 740 ; C -1 ; WX 722 ; N Ugrave ; B 124 -23 800 939 ; C -1 ; WX 667 ; N Thorn ; B 91 0 708 729 ; C -1 ; WX 556 ; N eacute ; B 84 -23 580 740 ; C -1 ; WX 556 ; N edieresis ; B 84 -23 580 715 ; C -1 ; WX 650 ; N dcaron ; B 73 -23 810 729 ; C -1 ; WX 500 ; N ccedilla ; B 76 -214 554 539 ; C -1 ; WX 500 ; N ccaron ; B 76 -23 563 740 ; C -1 ; WX 500 ; N cacute ; B 76 -23 575 740 ; C -1 ; WX 556 ; N aogonek ; B 65 -205 571 539 ; C -1 ; WX 556 ; N aring ; B 65 -23 568 754 ; C -1 ; WX 556 ; N atilde ; B 65 -23 583 719 ; C -1 ; WX 556 ; N abreve ; B 65 -23 582 729 ; C -1 ; WX 556 ; N egrave ; B 84 -23 580 740 ; C -1 ; WX 556 ; N agrave ; B 65 -23 568 740 ; C -1 ; WX 556 ; N aacute ; B 65 -23 570 740 ; C -1 ; WX 556 ; N adieresis ; B 65 -23 568 715 ; C -1 ; WX 722 ; N Uogonek ; B 124 -205 800 729 ; C -1 ; WX 556 ; N ugrave ; B 88 -23 594 740 ; C -1 ; WX 556 ; N uacute ; B 88 -23 594 740 ; C -1 ; WX 556 ; N udieresis ; B 88 -23 594 715 ; C -1 ; WX 319 ; N tcaron ; B 97 -23 492 801 ; C -1 ; WX 500 ; N scommaaccent ; B 61 -284 520 539 ; C -1 ; WX 611 ; N Zcaron ; B 28 0 737 939 ; C -1 ; WX 556 ; N ecircumflex ; B 84 -23 580 741 ; C -1 ; WX 722 ; N Ucircumflex ; B 124 -23 800 940 ; C -1 ; WX 556 ; N acircumflex ; B 65 -23 568 741 ; C -1 ; WX 611 ; N Zdotaccent ; B 28 0 737 914 ; C -1 ; WX 500 ; N scaron ; B 61 -23 547 740 ; C -1 ; WX 667 ; N Amacron ; B 17 0 663 895 ; C -1 ; WX 500 ; N sacute ; B 61 -23 545 740 ; C -1 ; WX 611 ; N Tcommaaccent ; B 158 -284 748 729 ; C -1 ; WX 667 ; N Ydieresis ; B 168 0 816 914 ; C -1 ; WX 556 ; N thorn ; B 7 -213 586 729 ; C -1 ; WX 667 ; N Emacron ; B 90 0 751 895 ; C -1 ; WX 778 ; N Ograve ; B 104 -23 828 939 ; C -1 ; WX 778 ; N Oacute ; B 104 -23 828 939 ; C -1 ; WX 778 ; N Odieresis ; B 104 -23 828 914 ; C -1 ; WX 722 ; N Ntilde ; B 76 0 801 918 ; C -1 ; WX 722 ; N Ncaron ; B 76 0 801 939 ; C -1 ; WX 722 ; N Nacute ; B 76 0 801 939 ; C -1 ; WX 556 ; N Lcaron ; B 80 0 551 729 ; C -1 ; WX 556 ; N Lacute ; B 80 0 551 939 ; C -1 ; WX 278 ; N Idotaccent ; B 100 0 389 914 ; C -1 ; WX 333 ; N racute ; B 69 0 498 740 ; C -1 ; WX 278 ; N Icircumflex ; B 100 0 454 940 ; C -1 ; WX 556 ; N ohungarumlaut ; B 80 -23 683 740 ; C -1 ; WX 556 ; N otilde ; B 80 -23 583 719 ; C -1 ; WX 556 ; N Euro ; B 12 -22 636 709 ; C -1 ; WX 556 ; N ocircumflex ; B 80 -23 576 741 ; C -1 ; WX 390 ; N onesuperior ; B 205 284 393 709 ; C -1 ; WX 390 ; N twosuperior ; B 100 284 468 709 ; C -1 ; WX 390 ; N threesuperior ; B 123 270 455 709 ; C -1 ; WX 278 ; N Igrave ; B 100 0 378 939 ; C -1 ; WX 278 ; N Iacute ; B 100 0 479 939 ; C -1 ; WX 278 ; N Imacron ; B 100 0 458 895 ; C -1 ; WX 278 ; N Iogonek ; B 28 -205 349 729 ; C -1 ; WX 278 ; N Idieresis ; B 100 0 467 907 ; C -1 ; WX 778 ; N Gbreve ; B 109 -23 809 928 ; C -1 ; WX 722 ; N Umacron ; B 124 -23 800 895 ; C -1 ; WX 667 ; N Kcommaaccent ; B 79 -284 813 729 ; C -1 ; WX 556 ; N ograve ; B 80 -23 576 740 ; C -1 ; WX 667 ; N Scommaaccent ; B 89 -284 714 741 ; C -1 ; WX 667 ; N Eogonek ; B 90 -205 751 729 ; C -1 ; WX 556 ; N oacute ; B 80 -23 576 740 ; C -1 ; WX 667 ; N Edotaccent ; B 90 0 751 914 ; C -1 ; WX 222 ; N iogonek ; B 0 -205 305 729 ; C -1 ; WX 527 ; N gcommaaccent ; B 3 -218 572 813 ; C -1 ; WX 556 ; N odieresis ; B 80 -23 576 715 ; C -1 ; WX 556 ; N ntilde ; B 70 0 589 719 ; C -1 ; WX 556 ; N ncaron ; B 70 0 578 740 ; C -1 ; WX 667 ; N Ecaron ; B 90 0 751 939 ; C -1 ; WX 667 ; N Ecircumflex ; B 90 0 751 940 ; C -1 ; WX 500 ; N scedilla ; B 61 -214 521 539 ; C -1 ; WX 333 ; N rcaron ; B 69 0 486 740 ; C -1 ; WX 667 ; N Egrave ; B 90 0 751 939 ; C -1 ; WX 667 ; N Eacute ; B 90 0 751 939 ; C -1 ; WX 778 ; N Gcommaaccent ; B 109 -284 809 741 ; C -1 ; WX 722 ; N Rcommaaccent ; B 93 -284 770 729 ; C -1 ; WX 667 ; N Edieresis ; B 90 0 751 914 ; C -1 ; WX 556 ; N nacute ; B 70 0 580 740 ; C -1 ; WX 556 ; N uogonek ; B 88 -205 594 524 ; C -1 ; WX 556 ; N umacron ; B 88 -23 594 696 ; C -1 ; WX 722 ; N Dcaron ; B 89 0 759 939 ; C -1 ; WX 307 ; N lcaron ; B 68 0 467 729 ; C -1 ; WX 722 ; N Ccaron ; B 112 -23 770 939 ; C -1 ; WX 722 ; N Cacute ; B 112 -23 770 939 ; C -1 ; WX 722 ; N Ccedilla ; B 112 -214 770 741 ; C -1 ; WX 606 ; N degree ; B 291 383 594 686 ; C -1 ; WX 667 ; N Aogonek ; B 17 -205 663 729 ; C -1 ; WX 584 ; N minus ; B 81 197 601 269 ; C -1 ; WX 584 ; N multiply ; B 113 34 568 427 ; C -1 ; WX 584 ; N divide ; B 92 0 591 462 ; C -1 ; WX 667 ; N Aring ; B 17 0 653 953 ; C -1 ; WX 1000 ; N trademark ; B 208 292 1096 729 ; C -1 ; WX 333 ; N rcommaaccent ; B 5 -284 436 539 ; C -1 ; WX 222 ; N lacute ; B 68 0 463 939 ; C -1 ; WX 556 ; N omacron ; B 80 -23 576 696 ; C -1 ; WX 667 ; N Atilde ; B 17 0 680 918 ; C -1 ; WX 278 ; N icircumflex ; B 94 0 406 741 ; C -1 ; WX 278 ; N igrave ; B 94 0 330 740 ; C -1 ; WX 556 ; N ncommaaccent ; B 70 -284 574 539 ; C -1 ; WX 222 ; N lcommaaccent ; B -1 -284 307 729 ; C -1 ; WX 584 ; N plusminus ; B 50 0 625 633 ; C -1 ; WX 947 ; N onehalf ; B 202 -20 965 709 ; C -1 ; WX 947 ; N onequarter ; B 205 -20 938 709 ; C -1 ; WX 947 ; N threequarters ; B 123 -20 938 709 ; C -1 ; WX 278 ; N iacute ; B 94 0 431 740 ; C -1 ; WX 667 ; N Abreve ; B 17 0 683 928 ; C -1 ; WX 500 ; N kcommaaccent ; B 58 -284 584 729 ; C -1 ; WX 778 ; N Omacron ; B 104 -23 828 895 ; C -1 ; WX 222 ; N imacron ; B 66 0 373 696 ; C -1 ; WX 556 ; N emacron ; B 84 -23 580 696 ; C -1 ; WX 556 ; N amacron ; B 65 -23 568 696 ; C -1 ; WX 278 ; N tcommaaccent ; B 55 -284 366 668 ; C -1 ; WX 500 ; N ydieresis ; B 8 -218 590 715 ; C -1 ; WX 500 ; N zdotaccent ; B 31 0 557 715 ; C -1 ; WX 500 ; N zcaron ; B 31 0 557 740 ; C -1 ; WX 500 ; N zacute ; B 31 0 557 740 ; C -1 ; WX 500 ; N yacute ; B 8 -218 590 740 ; C -1 ; WX 556 ; N uhungarumlaut ; B 88 -23 683 740 ; C -1 ; WX 556 ; N eth ; B 80 -23 576 743 ; C -1 ; WX 556 ; N uring ; B 88 -23 594 754 ; C -1 ; WX 778 ; N Ocircumflex ; B 104 -23 828 940 ; C -1 ; WX 333 ; N commaaccent ; B 57 -284 205 -60 ; C -1 ; WX 737 ; N copyright ; B 55 -22 836 742 ; C -1 ; WX 737 ; N registered ; B 55 -22 836 742 ; C -1 ; WX 667 ; N Acircumflex ; B 17 0 653 940 ; C -1 ; WX 278 ; N idieresis ; B 94 0 419 708 ; C -1 ; WX 489 ; N lozenge ; B 16 0 462 744 ; C -1 ; WX 712 ; N Delta ; B 10 0 701 729 ; C -1 ; WX 584 ; N notequal ; B 74 2 609 480 ; C -1 ; WX 542 ; N radical ; B 102 -36 705 913 ; C -1 ; WX 667 ; N Agrave ; B 17 0 653 939 ; C -1 ; WX 667 ; N Aacute ; B 17 0 667 939 ; C -1 ; WX 584 ; N lessequal ; B 45 0 659 584 ; C -1 ; WX 584 ; N greaterequal ; B 56 0 626 584 ; C -1 ; WX 584 ; N logicalnot ; B 99 86 619 377 ; C -1 ; WX 711 ; N summation ; B -18 -97 760 762 ; C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ; C -1 ; WX 722 ; N Ncommaaccent ; B 76 -284 801 729 ; C -1 ; WX 556 ; N dcroat ; B 73 -23 695 729 ; C -1 ; WX 260 ; N brokenbar ; B 54 -212 315 729 ; C -1 ; WX 556 ; N Lcommaaccent ; B 80 -284 551 729 ; C -1 ; WX 667 ; N Adieresis ; B 17 0 662 914 ; C -1 ; WX 556 ; N mu ; B 18 -220 593 524 ; C -1 ; WX 278 ; N .notdef ; B 213 0 213 0 ; EndCharMetrics StartKernData StartKernPairs 998 KPX A C -41 KPX A Ccedilla -41 KPX A G -41 KPX A O -37 KPX A Odieresis -37 KPX A Q -38 KPX A T -103 KPX A U -42 KPX A Uacute -42 KPX A Ucircumflex -42 KPX A Udieresis -42 KPX A Ugrave -42 KPX A V -81 KPX A W -57 KPX A Y -104 KPX A a -16 KPX A b -5 KPX A c -16 KPX A ccedilla -16 KPX A comma -4 KPX A d -14 KPX A e -22 KPX A g -17 KPX A guillemotleft -51 KPX A guilsinglleft -47 KPX A hyphen -8 KPX A o -19 KPX A period -2 KPX A q -15 KPX A quotedblright -60 KPX A quoteright -68 KPX A t -22 KPX A u -18 KPX A v -40 KPX A w -29 KPX A y -44 KPX Aacute C -42 KPX Aacute G -42 KPX Aacute O -38 KPX Aacute Q -39 KPX Aacute T -103 KPX Aacute U -43 KPX Aacute V -81 KPX Aacute W -57 KPX Aacute Y -104 KPX Aacute a -16 KPX Aacute b -6 KPX Aacute c -17 KPX Aacute comma -4 KPX Aacute d -15 KPX Aacute e -23 KPX Aacute g -17 KPX Aacute guillemotleft -51 KPX Aacute guilsinglleft -48 KPX Aacute hyphen -9 KPX Aacute o -20 KPX Aacute period -3 KPX Aacute q -16 KPX Aacute quoteright -68 KPX Aacute t -23 KPX Aacute u -20 KPX Aacute v -40 KPX Aacute w -29 KPX Aacute y -44 KPX Acircumflex C -41 KPX Acircumflex G -41 KPX Acircumflex O -37 KPX Acircumflex Q -38 KPX Acircumflex T -103 KPX Acircumflex U -42 KPX Acircumflex V -81 KPX Acircumflex W -57 KPX Acircumflex Y -104 KPX Acircumflex comma -4 KPX Acircumflex period -2 KPX Adieresis C -42 KPX Adieresis G -41 KPX Adieresis O -38 KPX Adieresis Q -39 KPX Adieresis T -103 KPX Adieresis U -43 KPX Adieresis V -81 KPX Adieresis W -57 KPX Adieresis Y -104 KPX Adieresis a -16 KPX Adieresis b -5 KPX Adieresis c -17 KPX Adieresis comma -4 KPX Adieresis d -14 KPX Adieresis g -17 KPX Adieresis guillemotleft -51 KPX Adieresis guilsinglleft -48 KPX Adieresis hyphen -8 KPX Adieresis o -19 KPX Adieresis period -3 KPX Adieresis q -15 KPX Adieresis quotedblright -60 KPX Adieresis quoteright -68 KPX Adieresis t -22 KPX Adieresis u -19 KPX Adieresis v -40 KPX Adieresis w -29 KPX Adieresis y -44 KPX Agrave C -41 KPX Agrave G -41 KPX Agrave O -37 KPX Agrave Q -38 KPX Agrave T -103 KPX Agrave U -42 KPX Agrave V -81 KPX Agrave W -57 KPX Agrave Y -104 KPX Agrave comma -4 KPX Agrave period -2 KPX Aring C -41 KPX Aring G -41 KPX Aring O -37 KPX Aring Q -38 KPX Aring T -103 KPX Aring U -42 KPX Aring V -81 KPX Aring W -57 KPX Aring Y -104 KPX Aring a -16 KPX Aring b -5 KPX Aring c -16 KPX Aring comma -4 KPX Aring d -14 KPX Aring e -22 KPX Aring g -17 KPX Aring guillemotleft -51 KPX Aring guilsinglleft -47 KPX Aring hyphen -8 KPX Aring o -19 KPX Aring period -2 KPX Aring q -15 KPX Aring quotedblright -60 KPX Aring quoteright -68 KPX Aring t -22 KPX Aring u -18 KPX Aring v -40 KPX Aring w -29 KPX Aring y -44 KPX Atilde C -43 KPX Atilde G -42 KPX Atilde O -39 KPX Atilde Q -40 KPX Atilde T -103 KPX Atilde U -44 KPX Atilde V -81 KPX Atilde W -57 KPX Atilde Y -104 KPX Atilde comma -4 KPX Atilde period -4 KPX B A -28 KPX B AE -29 KPX B Aacute -28 KPX B Acircumflex -28 KPX B Adieresis -28 KPX B Aring -28 KPX B Atilde -28 KPX B O -14 KPX B OE -11 KPX B Oacute -14 KPX B Ocircumflex -14 KPX B Odieresis -14 KPX B Ograve -14 KPX B Oslash -2 KPX B V -49 KPX B W -27 KPX B Y -56 KPX C A -43 KPX C AE -44 KPX C Aacute -43 KPX C Adieresis -43 KPX C Aring -43 KPX C H -22 KPX C K -20 KPX C O -18 KPX C Oacute -18 KPX C Odieresis -18 KPX Ccedilla A -44 KPX D A -50 KPX D Aacute -50 KPX D Acircumflex -50 KPX D Adieresis -50 KPX D Agrave -50 KPX D Aring -50 KPX D Atilde -50 KPX D J -13 KPX D T -56 KPX D V -54 KPX D W -31 KPX D X -58 KPX D Y -74 KPX F A -78 KPX F Aacute -78 KPX F Acircumflex -78 KPX F Adieresis -78 KPX F Agrave -78 KPX F Aring -78 KPX F Atilde -78 KPX F J -59 KPX F O -30 KPX F Odieresis -30 KPX F a -45 KPX F aacute -45 KPX F adieresis -45 KPX F ae -41 KPX F aring -45 KPX F comma -113 KPX F e -33 KPX F eacute -33 KPX F hyphen -20 KPX F i -19 KPX F j -19 KPX F o -30 KPX F oacute -30 KPX F odieresis -30 KPX F oe -33 KPX F oslash -30 KPX F period -113 KPX F r -44 KPX F u -42 KPX G A -14 KPX G AE -11 KPX G Aacute -14 KPX G Acircumflex -14 KPX G Adieresis -14 KPX G Agrave -14 KPX G Aring -14 KPX G Atilde -14 KPX G T -53 KPX G V -53 KPX G W -31 KPX G Y -72 KPX J A -39 KPX J AE -39 KPX J Adieresis -39 KPX J Aring -39 KPX K C -56 KPX K G -57 KPX K O -53 KPX K OE -49 KPX K Oacute -53 KPX K Odieresis -53 KPX K S -48 KPX K T 14 KPX K a -23 KPX K adieresis -23 KPX K ae -20 KPX K aring -23 KPX K e -46 KPX K hyphen -53 KPX K o -42 KPX K oacute -42 KPX K odieresis -42 KPX K u -32 KPX K udieresis -32 KPX K y -76 KPX L A 8 KPX L AE 11 KPX L Aacute 8 KPX L Adieresis 8 KPX L Aring 8 KPX L C -52 KPX L Ccedilla -51 KPX L G -53 KPX L O -51 KPX L Oacute -51 KPX L Ocircumflex -51 KPX L Odieresis -51 KPX L Ograve -51 KPX L Otilde -51 KPX L S -28 KPX L T -112 KPX L U -46 KPX L Udieresis -46 KPX L V -115 KPX L W -77 KPX L Y -128 KPX L hyphen -140 KPX L quotedblright -145 KPX L quoteright -153 KPX L u -17 KPX L udieresis -17 KPX L y -68 KPX N A -19 KPX N AE -16 KPX N Aacute -19 KPX N Adieresis -19 KPX N Aring -19 KPX N C -15 KPX N Ccedilla -14 KPX N G -14 KPX N O -11 KPX N Oacute -11 KPX N Odieresis -11 KPX N a -17 KPX N aacute -17 KPX N adieresis -17 KPX N ae -13 KPX N aring -17 KPX N comma -15 KPX N e -11 KPX N eacute -11 KPX N o -8 KPX N oacute -8 KPX N odieresis -8 KPX N oslash -4 KPX N period -15 KPX N u -8 KPX N udieresis -9 KPX O A -43 KPX O AE -47 KPX O Aacute -43 KPX O Adieresis -43 KPX O Aring -43 KPX O T -54 KPX O V -48 KPX O W -25 KPX O X -52 KPX O Y -71 KPX Oacute A -43 KPX Oacute T -54 KPX Oacute V -48 KPX Oacute W -25 KPX Oacute Y -71 KPX Ocircumflex T -54 KPX Ocircumflex V -48 KPX Ocircumflex Y -71 KPX Odieresis A -43 KPX Odieresis T -54 KPX Odieresis V -48 KPX Odieresis W -25 KPX Odieresis X -52 KPX Odieresis Y -71 KPX Ograve T -54 KPX Ograve V -48 KPX Ograve Y -71 KPX Oslash A -47 KPX Otilde T -54 KPX Otilde V -48 KPX Otilde Y -71 KPX P A -86 KPX P AE -93 KPX P Aacute -86 KPX P Adieresis -86 KPX P Aring -86 KPX P J -85 KPX P a -39 KPX P aacute -39 KPX P adieresis -39 KPX P ae -35 KPX P aring -39 KPX P comma -138 KPX P e -38 KPX P eacute -38 KPX P hyphen -45 KPX P o -34 KPX P oacute -34 KPX P odieresis -34 KPX P oe -38 KPX P oslash -35 KPX P period -138 KPX R C -21 KPX R Ccedilla -21 KPX R G -21 KPX R O -17 KPX R OE -14 KPX R Oacute -17 KPX R Odieresis -17 KPX R T -33 KPX R U -21 KPX R Udieresis -21 KPX R V -49 KPX R W -27 KPX R Y -54 KPX R a -21 KPX R aacute -21 KPX R adieresis -21 KPX R ae -17 KPX R aring -21 KPX R e -16 KPX R eacute -16 KPX R hyphen -4 KPX R o -13 KPX R oacute -13 KPX R odieresis -13 KPX R oe -16 KPX R u -13 KPX R uacute -14 KPX R udieresis -14 KPX R y -16 KPX S A -31 KPX S AE -31 KPX S Aacute -31 KPX S Adieresis -31 KPX S Aring -31 KPX S T -38 KPX S V -52 KPX S W -31 KPX S Y -58 KPX S t -11 KPX T A -104 KPX T AE -106 KPX T Aacute -104 KPX T Acircumflex -104 KPX T Adieresis -104 KPX T Agrave -104 KPX T Aring -104 KPX T Atilde -104 KPX T C -53 KPX T G -55 KPX T J -108 KPX T O -50 KPX T OE -44 KPX T Oacute -50 KPX T Ocircumflex -50 KPX T Odieresis -50 KPX T Ograve -50 KPX T Oslash -42 KPX T Otilde -50 KPX T S -32 KPX T V 2 KPX T W 7 KPX T Y 10 KPX T a -107 KPX T ae -104 KPX T c -96 KPX T colon -152 KPX T comma -105 KPX T e -102 KPX T g -94 KPX T guillemotleft -126 KPX T guilsinglleft -123 KPX T hyphen -82 KPX T i -12 KPX T j -12 KPX T o -99 KPX T oslash -94 KPX T period -105 KPX T r -98 KPX T s -98 KPX T semicolon -140 KPX T u -98 KPX T v -106 KPX T w -103 KPX T y -110 KPX U A -45 KPX U AE -48 KPX U Aacute -45 KPX U Acircumflex -45 KPX U Adieresis -45 KPX U Aring -45 KPX U Atilde -45 KPX U comma -35 KPX U m -17 KPX U n -16 KPX U p -8 KPX U period -32 KPX U r -16 KPX Uacute A -45 KPX Uacute comma -35 KPX Uacute m -17 KPX Uacute n -16 KPX Uacute p -8 KPX Uacute period -32 KPX Uacute r -16 KPX Ucircumflex A -45 KPX Udieresis A -44 KPX Udieresis b -8 KPX Udieresis comma -35 KPX Udieresis m -17 KPX Udieresis n -16 KPX Udieresis p -8 KPX Udieresis period -32 KPX Udieresis r -16 KPX Ugrave A -45 KPX V A -77 KPX V AE -84 KPX V Aacute -77 KPX V Acircumflex -77 KPX V Adieresis -77 KPX V Agrave -77 KPX V Aring -77 KPX V Atilde -77 KPX V C -50 KPX V G -50 KPX V O -46 KPX V Oacute -46 KPX V Ocircumflex -46 KPX V Odieresis -46 KPX V Ograve -46 KPX V Oslash -34 KPX V Otilde -46 KPX V S -44 KPX V T 7 KPX V a -71 KPX V ae -66 KPX V colon -76 KPX V comma -94 KPX V e -64 KPX V g -57 KPX V guillemotleft -88 KPX V guilsinglleft -84 KPX V hyphen -44 KPX V i -14 KPX V o -61 KPX V oslash -57 KPX V period -94 KPX V r -51 KPX V semicolon -75 KPX V u -52 KPX V y -28 KPX W A -56 KPX W AE -62 KPX W Aacute -56 KPX W Acircumflex -56 KPX W Adieresis -56 KPX W Agrave -56 KPX W Aring -56 KPX W Atilde -56 KPX W C -30 KPX W G -30 KPX W O -26 KPX W Oacute -26 KPX W Ocircumflex -26 KPX W Odieresis -26 KPX W Ograve -26 KPX W Oslash -14 KPX W Otilde -26 KPX W S -31 KPX W T 11 KPX W a -46 KPX W ae -42 KPX W colon -62 KPX W comma -62 KPX W e -39 KPX W g -32 KPX W guillemotleft -63 KPX W guilsinglleft -60 KPX W hyphen -19 KPX W i -10 KPX W o -36 KPX W oslash -32 KPX W period -62 KPX W r -36 KPX W semicolon -62 KPX W u -36 KPX W y -15 KPX X C -53 KPX X O -50 KPX X Odieresis -50 KPX X Q -51 KPX X a -27 KPX X e -51 KPX X hyphen -57 KPX X o -46 KPX X u -36 KPX X y -67 KPX Y A -102 KPX Y AE -108 KPX Y Aacute -102 KPX Y Acircumflex -102 KPX Y Adieresis -102 KPX Y Agrave -102 KPX Y Aring -102 KPX Y Atilde -102 KPX Y C -68 KPX Y G -69 KPX Y O -64 KPX Y Oacute -64 KPX Y Ocircumflex -64 KPX Y Odieresis -64 KPX Y Ograve -64 KPX Y Oslash -55 KPX Y Otilde -64 KPX Y S -49 KPX Y T 15 KPX Y a -100 KPX Y ae -95 KPX Y colon -97 KPX Y comma -117 KPX Y e -97 KPX Y g -89 KPX Y guillemotleft -128 KPX Y guilsinglleft -124 KPX Y hyphen -89 KPX Y i -6 KPX Y o -93 KPX Y oslash -89 KPX Y p -63 KPX Y period -117 KPX Y semicolon -97 KPX Y u -73 KPX Y v -48 KPX Z v -44 KPX Z y -44 KPX a j -10 KPX a quoteright -23 KPX a v -26 KPX a w -16 KPX a y -33 KPX aacute v -26 KPX aacute w -16 KPX aacute y -33 KPX adieresis v -26 KPX adieresis w -16 KPX adieresis y -33 KPX ae v -26 KPX ae w -15 KPX ae y -32 KPX agrave v -26 KPX agrave w -16 KPX agrave y -33 KPX aring v -26 KPX aring w -16 KPX aring y -33 KPX b v -21 KPX b w -10 KPX b y -28 KPX c h -7 KPX c k -1 KPX comma one -105 KPX comma quotedblright -47 KPX comma quoteright -55 KPX e quoteright -20 KPX e t -16 KPX e v -26 KPX e w -16 KPX e x -35 KPX e y -33 KPX eacute v -26 KPX eacute w -16 KPX eacute y -33 KPX ecircumflex v -26 KPX ecircumflex w -16 KPX ecircumflex y -33 KPX eight four -6 KPX eight one -55 KPX eight seven -43 KPX f a -20 KPX f aacute -20 KPX f adieresis -20 KPX f ae -15 KPX f aring -20 KPX f e -21 KPX f eacute -21 KPX f f 12 KPX f i -10 KPX f j -11 KPX f l -12 KPX f o -18 KPX f oacute -18 KPX f odieresis -18 KPX f oe -20 KPX f oslash -16 KPX f quoteright -8 KPX f s -8 KPX f t 16 KPX five four -7 KPX five one -83 KPX five seven -32 KPX four four -3 KPX four one -88 KPX four seven -65 KPX g a -17 KPX g adieresis -17 KPX g ae -13 KPX g aring -17 KPX g e -11 KPX g eacute -11 KPX g l -8 KPX g oacute -8 KPX g odieresis -8 KPX g r -9 KPX guillemotright A -58 KPX guillemotright AE -62 KPX guillemotright Aacute -58 KPX guillemotright Adieresis -58 KPX guillemotright Aring -58 KPX guillemotright T -132 KPX guillemotright V -96 KPX guillemotright W -68 KPX guillemotright Y -137 KPX guilsinglright A -52 KPX guilsinglright AE -56 KPX guilsinglright Aacute -52 KPX guilsinglright Adieresis -52 KPX guilsinglright Aring -52 KPX guilsinglright T -126 KPX guilsinglright V -90 KPX guilsinglright W -62 KPX guilsinglright Y -131 KPX h quoteright -19 KPX h y -31 KPX hyphen A -12 KPX hyphen AE -17 KPX hyphen Aacute -12 KPX hyphen Adieresis -12 KPX hyphen Aring -12 KPX hyphen T -86 KPX hyphen V -51 KPX hyphen W -24 KPX hyphen Y -97 KPX i T -16 KPX i j -10 KPX k a -14 KPX k aacute -14 KPX k adieresis -14 KPX k ae -12 KPX k aring -14 KPX k comma -13 KPX k e -33 KPX k eacute -33 KPX k g -26 KPX k hyphen -49 KPX k o -30 KPX k oacute -30 KPX k odieresis -30 KPX k period -13 KPX k s -14 KPX k u -22 KPX k udieresis -16 KPX l v -11 KPX l y -15 KPX m p -3 KPX m v -24 KPX m w -14 KPX m y -30 KPX n T -103 KPX n p -3 KPX n quoteright -19 KPX n v -24 KPX n w -14 KPX n y -31 KPX nine four -12 KPX nine one -55 KPX nine seven -50 KPX o T -106 KPX o quoteright -23 KPX o t -17 KPX o v -27 KPX o w -16 KPX o x -35 KPX o y -34 KPX oacute v -27 KPX oacute w -16 KPX oacute y -34 KPX ocircumflex t -17 KPX odieresis t -17 KPX odieresis v -27 KPX odieresis w -16 KPX odieresis x -35 KPX odieresis y -34 KPX ograve v -27 KPX ograve w -16 KPX ograve y -34 KPX one comma -82 KPX one eight -73 KPX one five -72 KPX one four -88 KPX one nine -71 KPX one one -125 KPX one period -82 KPX one seven -98 KPX one six -71 KPX one three -75 KPX one two -78 KPX one zero -71 KPX p t -10 KPX p y -28 KPX period one -106 KPX period quotedblright -48 KPX period quoteright -56 KPX q c -2 KPX q u -5 KPX quotedblbase A 21 KPX quotedblbase AE 21 KPX quotedblbase T -80 KPX quotedblbase V -74 KPX quotedblbase W -39 KPX quotedblbase Y -96 KPX quotedblleft A -58 KPX quotedblleft AE -70 KPX quotedblleft Aacute -58 KPX quotedblleft Adieresis -58 KPX quotedblleft Aring -58 KPX quotedblleft T 1 KPX quotedblleft V 10 KPX quotedblleft W 22 KPX quotedblleft Y -1 KPX quotedblright A -60 KPX quotedblright AE -72 KPX quotedblright Aacute -60 KPX quotedblright Adieresis -60 KPX quotedblright Aring -60 KPX quotedblright T 2 KPX quotedblright V 9 KPX quotedblright W 21 KPX quotedblright Y -2 KPX quoteleft A -74 KPX quoteleft AE -86 KPX quoteleft Aacute -74 KPX quoteleft Adieresis -74 KPX quoteleft Aring -74 KPX quoteleft T -14 KPX quoteleft V -5 KPX quoteleft W 6 KPX quoteleft Y -17 KPX quoteright A -76 KPX quoteright AE -88 KPX quoteright Aacute -76 KPX quoteright Adieresis -76 KPX quoteright Aring -76 KPX quoteright comma -68 KPX quoteright d -25 KPX quoteright o -31 KPX quoteright period -68 KPX quoteright r -24 KPX quoteright s -23 KPX quoteright t -14 KPX quoteright v -10 KPX quoteright w -5 KPX quoteright y -14 KPX r a -16 KPX r aacute -16 KPX r acircumflex -16 KPX r adieresis -16 KPX r ae -11 KPX r agrave -16 KPX r aring -16 KPX r c -11 KPX r ccedilla -11 KPX r colon -31 KPX r comma -77 KPX r d -8 KPX r e -17 KPX r eacute -17 KPX r ecircumflex -17 KPX r egrave -17 KPX r f 17 KPX r g -8 KPX r h -8 KPX r hyphen -54 KPX r i -6 KPX r j -6 KPX r k -2 KPX r l -7 KPX r m -9 KPX r n -8 KPX r o -14 KPX r oacute -14 KPX r ocircumflex -14 KPX r odieresis -14 KPX r oe -16 KPX r ograve -14 KPX r oslash -14 KPX r p 0 KPX r period -77 KPX r q -10 KPX r quoteright -6 KPX r r -8 KPX r s -4 KPX r semicolon -30 KPX r t 21 KPX r u -7 KPX r v 18 KPX r w 21 KPX r x 9 KPX r y 15 KPX r z 0 KPX s quoteright -24 KPX s t -15 KPX seven colon -84 KPX seven comma -123 KPX seven eight -34 KPX seven five -37 KPX seven four -95 KPX seven one -58 KPX seven period -123 KPX seven seven -11 KPX seven six -44 KPX seven three -29 KPX seven two -31 KPX six four -7 KPX six one -52 KPX six seven -40 KPX t S -17 KPX t a -10 KPX t aacute -10 KPX t adieresis -10 KPX t ae -7 KPX t aring -10 KPX t colon -37 KPX t e -22 KPX t eacute -22 KPX t h -14 KPX t o -19 KPX t oacute -19 KPX t odieresis -19 KPX t quoteright -7 KPX t semicolon -36 KPX three four -9 KPX three one -57 KPX three seven -45 KPX two four -43 KPX two one -45 KPX two seven -38 KPX u quoteright -14 KPX v a -30 KPX v aacute -30 KPX v acircumflex -30 KPX v adieresis -30 KPX v ae -25 KPX v agrave -30 KPX v aring -30 KPX v atilde -30 KPX v c -22 KPX v colon -32 KPX v comma -76 KPX v e -29 KPX v eacute -29 KPX v ecircumflex -29 KPX v egrave -29 KPX v g -20 KPX v hyphen -19 KPX v l -8 KPX v o -25 KPX v oacute -25 KPX v odieresis -25 KPX v ograve -25 KPX v oslash -25 KPX v period -76 KPX v s -17 KPX v semicolon -31 KPX w a -26 KPX w aacute -26 KPX w acircumflex -26 KPX w adieresis -26 KPX w ae -22 KPX w agrave -26 KPX w aring -26 KPX w atilde -26 KPX w c -14 KPX w colon -32 KPX w comma -57 KPX w e -20 KPX w eacute -20 KPX w ecircumflex -20 KPX w egrave -20 KPX w g -13 KPX w hyphen -8 KPX w l -8 KPX w o -17 KPX w oacute -17 KPX w odieresis -17 KPX w ograve -17 KPX w oslash -14 KPX w period -57 KPX w s -14 KPX w semicolon -31 KPX x a -30 KPX x c -30 KPX x e -36 KPX x eacute -36 KPX x o -33 KPX x q -28 KPX y a -36 KPX y aacute -36 KPX y acircumflex -36 KPX y adieresis -36 KPX y ae -31 KPX y agrave -36 KPX y aring -36 KPX y atilde -36 KPX y c -28 KPX y colon -40 KPX y comma -80 KPX y e -35 KPX y eacute -35 KPX y ecircumflex -35 KPX y egrave -35 KPX y g -26 KPX y hyphen -24 KPX y l -14 KPX y o -31 KPX y oacute -31 KPX y odieresis -31 KPX y ograve -31 KPX y oslash -30 KPX y period -80 KPX y s -23 KPX y semicolon -40 KPX zero four -11 KPX zero one -56 KPX zero seven -50 EndKernPairs EndKernData EndFontMetrics gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019023l.pfb000066400000000000000000001126521404163720200220740ustar00rootroot00000000000000n%!PS-AdobeFont-1.0: NimbusSanL-ReguItal 1.05 %%CreationDate: Wed Dec 22 1999 % Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development % (URW)++,Copyright 1999 by (URW)++ Design & Development % See the file COPYING (GNU General Public License) for license conditions. % As a special exception, permission is granted to include this font % program in a Postscript or PDF file that consists of a document that % contains text to be displayed or printed using this font, regardless % of the conditions or license applying to the document itself. 12 dict begin /FontInfo 10 dict dup begin /version (1.05) readonly def /Notice ((URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General Public License) for license conditions. As a special exception, permission is granted to include this font program in a Postscript or PDF file that consists of a document that contains text to be displayed or printed using this font, regardless of the conditions or license applying to the document itself.) readonly def /Copyright (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development) readonly def /FullName (Nimbus Sans L Regular Italic) readonly def /FamilyName (Nimbus Sans L) readonly def /Weight (Regular) readonly def /ItalicAngle -12.0 def /isFixedPitch false def /UnderlinePosition -151 def /UnderlineThickness 50 def end readonly def /FontName /NimbusSanL-ReguItal def /PaintType 0 def /WMode 0 def /FontBBox {-178 -284 1108 953} readonly def /FontType 1 def /FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def /Encoding StandardEncoding def /UniqueID 5020908 def currentdict end currentfile eexec  `,i"[[5j5mTʻ^+݄fKitrޟm%9۩*++`[&NfA-O!J"|UY+; <Ԟ2?.P2QhnDtw=y0)n*[ Y]~ ΁RzYi[AXm>ni˅ԋZ'pA^ sINόdwuNPttxܜv.M<*\̒zUx?yu6yF .;Z"(Њ; S{* R-A\3-O84s[=YM|GxR)3gwO"}\䁞~8͘dW;cmA׫-׬LtH+8`|c&ٸRoC ]vtfcQJ}XȀH=)@Cμ_vMrI̎ucCt IՐNr0-aJNUn X8|\5cJ[I\@V ڰN&tPup|hز36 B?̓w zRCׅR@|ڙd|7a %.WmC X8y oCZC.Հ`^7U'CpG~h31&R|"UF0ӷ=ȬLv_Z^ke?*ʏI+xv@BnӚ=^Gk(hʻQ+naFפ9xCnncuPȅw~iph|֗qw*UW.Zx_:Ty؀YU?H9deCsX(!ue/7\?)sX1HAʈi`p[wt[󟊒 ?Θ|.z&2$SK.o"r):ѢׯOÓkGh*Z1X_n@6"P~ :^f"O$껲>xwmamA(nי:GkFyab^~$a5CG|ΩˮW66Z1kfӟ~$\5v|1+z#V`8BMxTph't6q6'q!3!}~\:%P lj Vv4H'OW*ڶ'ۀ~)_#V4{f wBC6ۙҜ7*z=*ʒ ٰKo^$l/Nq^;I;.ӑ!DNrW3Vo/e.<TC";d-vqO&>Ί |`*VK{ȃ)jkKmG]\H,T\3ke& %ƞ/|'=a@/aDe0u ؄6-x=isB!:"({Пt #$ƚ NԖvR!٨UeVjꄅf..F2hā 2Rt_Z}|S٦ ՖK8 7 m]?_~jcqy$wRkWJs/d"% V~oj70ihlY[3]0 GZƽj*F6D2GKMt4𷘱nV9f 1p'Eb0TO'A gpg qPIuz*uh4nأ܉EtDte27~%2 @i$LK- )5qr%5UePT:4Do`DY`&'vdIΊA5 wOa[9Sa*3Gww)L#oU!no& ߊ9ſ*Mxx)ͺ0_~ʆBy51\]N9rQ\_3J yfI*FY~26qQL$xV#h{&E呚;6ff41`35XIiczJd" |ЪKhV3NsWOScĥ]^+`lDCQcUA]lBe*HIsМ5y(F b^b`|:@"( ?&$. PQCِNj\Җ@)Yڤ ~4|B9M)]- $}a+⸎L${Bk"~PiHWY098p7@!hx/F4|(ݑ`ZLgdX-AM"# wtCUw ƋwBzlCܫ;+}#>Y9zǚ-J4_ σL֑m duĢ xVɞt2n~-?-FbW9doضw# BĞ=frzJBgt_JeFGx?Pt**Jk[ I>?"WvTt)]"S7%߉LJ׻tѹ#+#_P -XaZ QL ֎T]6!J!Ej5#cuðS%79-_Rlt=`SWJi6slkg+U3exK@"bj2I1qnel3ޖD 4׻tyq(%X'kj!r~ \|=kC0'}m69X֟?l9?9P 'ns3\GtA꾄N\*C4│p!HR|}ʤ ) ]r>]6 -$*phȗ\ظ\GڜOPW$64'yO7;+/< ;fr_$I*M1~%3їՏYGH-1>OTVFAY ,67Ԍ!)' ci-zGv#kW4BT8LK2IϰrfN44a ;33>n#Pp, `(`_|'14@Xj6SfCAϛ~"xc蜮 J{zRwՉQ3xm\G.<*sΪcXH@3xYA7U$ Cv$Π9߰Js3_EqfڽKX29|l(`JrƘ@Fa(+_0vYL"iˠM 5aKP[4Jg{ir'/>>6No4A{lun03JR>84;P1ØB N5[$U(n+u"gZ+ؒТwGݵuNԍîXƠI u>p2D@S{Bf8"g )Ѹz6 J<0k4׃oBx[`?=a|=2sH%P5Ta<OrL%T*"X}OTڎ0H h~y '4 7&76w)~n|=WIy!A(t$kfl_&Mr7wUf뀂v(ERTwz&RaNfX'T\QSpauOfBYML*0,N ]A<6$ǝ5%ppB6hO}l"@nMXHE%o< t7&p#7nzpGÅ/o\)w~JMVhp^_2-ldڲ*;~SBd! <`nɰo*s!::~xT%5VY/ fE*3~@oΒ'ӮX֨J{w3h@צ nyI1~Ox \ckIӉ>lfSzv@#txIl/(SYR%SlBDK`!RxA53jbGssW `eV{C t8@G=i)]jnhMb(f/4 u&,}AP SETM,tuUa okͷEbۃD]E)򵇇3Gϼ=~G. 4*­tG1dzOY [Ufi߯V&MˀH}dhpGϠBL%%G>"AlAiM 8Drfˣ:Z<17R¦yӸܲƴz|?s- v?F;-{[/o91K*0\egwKv[E`>l~35>((܎W;'"ٿuhlQg;v9.@kQy2,gZqib~lhȥ*rhxe ܈xdyW7Z$J.{3I>M Yӑw"cAZffq.|u5BׅXm -ؒx:am%+ps-zs 7~AH+7/gX4 (tNN{-O;/iFѕ=pg8sb aP٢_ؘ_5#:^v@X[9*Tg-7 YZ@Xv{v$#I [5mybtW­O7C 9 g_J=FkSS 9[CJ V؁At=Q]A8y#z K jt_]b*3Z>_f! v橭U!Jf766<89FE;G0H7 f&> :/ "a .{FzQHwlfŧb1K ;C=ҳ~A3WT= 6"GYeGsW?9޸P(|)C.!Jb 4UMU#$*yaOrgNJDZ"$XnB,FU" rʞoov]'se}*ӄ~s#g{͈^ y52pgE=|*|ZPbhY%GOˣ'M]+ rN͉\M nHm98ǖ@<|m bX',y^Gm ]$c4ܧz w>笲Mi !6->^(=MkԓI3D/b؟#ndY%1 !&iR2f?;v^:˫~ N <'^sqС/}dRpлFL6/ߧ_9tOW69m&ﴔd1/gƗ}L {f Zz^ٮiLm5KSZ{Yx}BJG 2yDFmU=f-8oBISDX(s<ţk౬N X֝hz l\Rhq\_ϫۖ!BQQ=^uṥR@Vs7+2^is.Wr;/ +1r\ mq-|2j%dR8hкSaje'L{ 1/r,gn y0/{bpOVЂ={3 D,`]A@WtHŮ= WJz2(8-^OÅ~&\Mdxäz~ΗzI~xkS)=JE?V;3!!r`%VqkJtlot4s ժ# 5#'hX0Xy_aG {QK8*U ^i+fFcMZe M?^%s3R7y(yvFn$]>̜ժvcTbb\sS Xo~C<J5qq|C3Y*芡nu ;rp`$NH*9wƏ5X%(l7,%gkCا_gk1fK bKWh%Iܐ*"񐋽w*+ zNTHB=vO нdYk6EoW\/v\N_AyG#`3>MWP3фdU%b&Ef`) :8eEmqpQ>F2V6(f,mr5L'5l<_9V&<|qR_(ڎKvfT$og]ɭ[F<;d+hm/mkk;' gUQwd{lNhO^uEr^fx >ڪ8XK&4+Z`4 0n P)Dq/e8ZX!rŊ8~;뇒Q'vVT%6;,TpJX|x۶pODj$6NpFaT9ݒpR\䷧ 8bט 7T-c\" (9x "X_*@J?(13KK_G82c ~&uodVK|L;(id:М~) uG$JmFb(Tc Ҭ-ulKܢD񴈝U"jU)G\H FsЏ6D G}=ЅqsRgtcL3:rB\E jpw 4xt?&i>pqcQxͫGR+-Վr4VDq] 3K+!a-9g*VVChڛ3Lc+_:zϊNAeM}]^Ierqӿ %m:匚zjV`a-Ӝv{sY½$tנ iNW}sXEZv(ʰ/M3W;C ΂:,ADQFEFuSh6mM\I huSi0]o k3_!,|a}dT?\x#qva 65lh#nyiUۙ<Yd{k?ŒqJe^ιOa~XYD0XF' ~5n)hD-bcZ+t]}h\vNF7{GRSk9/8vCP؏'RknnA|_W R!X^U{i&%hAZÆLG91reҳq7 /I{Hw)" 8sOhƔ:Ԣأ XYtC_2\geG ~竪ːM`NXai~l=O[kZ?5El޶fzJ^ZQIK /ݲn#C8A(v2 ,>V1_V2:܏^:s ‘yN C4ͶgƷ*@F<m'dtgBL낁L[=Cȃv$ۛY,+[a<=cCK{7k?xv!KUm4LKttzwd3:>2Ƴׅ9ޛƿl>a>Z"%HzTHK[UO;嘃;QNułi)e-v ÆbX/2c.qՋT_/_qk^+[B*_T{.dQW0dnat$IGw_{\e`5zaa}8(yH+R]e4.̋d8c."G$ݕLvѣG: P  AehXR.co$z3K7CsjmJ֛hi8cdRH鏢3aģi^f݇ؓS;6ƅSqq4РeF&֣S|~3#b-G@a5h]x.yiG|(l9Iy\ yw&-HV8\t\MIa bՄg{wh<۷?b#&;V#JX@ЀcWoA] Y-XnıZ2p3>|}Q:fE+#&ƒ ΖǠ{֭N*5~R|WʣF i p{h``#N#oʬBmkKItcH|(ܥ)u 89" Q D\$AV S2crWhM6g[! hQ+:̾MݡQ-~yy,ž9߱w ;~&Ձ<(!*|s(_5I @9;BN~#_n; _[Ujف><%qXJ|)Y/ŷ X4W[0hkt139B KF_ܔj;Jcfi 1?}x"D}9N=UrIJ/Ra_OJEBfA~ԴꞬ5XB|ΨvQq aC)`Qƿ."mь5#t`iP2't'a{wˬdG;(ˍDc;W h|٬$ec R+2[2ͺ-[X/0 BH~\ +åJVmezUXީH"x{Ƅ4hSZ Frp/phȂdg~d27vN_ESC',$''VJh1dⱉ0Y~=mC&T pǸOLb|آ#BOt,b?K8[Ҡ;Ql ̧$-~4_ =qX jZ1%ֱZ"g9Șy*Zv9mnN~drk-dNT.P}[«A>N^ 629!M㷘} BodN'˿iv``.&>.,M;ykƭ&_ԊLܙd戕he"$Ion^- -Ë3l =48U oF IRZ1wzltWMVDД\y( ߈(«iY1[8™!H cn' -RmPtHUb\eb}%97/YL4d" 7ӿk YU`ΒՇe{gmi6cV5itz :Be G80Ht>SvBȕf-g*1 lUwh&KR9wȑXiP`}U嗾a_-WծGvrYT"+Zl@9ɅԴ ^>T9L*%ZH|cmf\QehA@(sR z!vAUiMR"|\˄4۫]OȗRF%z"r1V!s:̓,Eޞv\/<>ք`a;DzJz޾\_J~TCl!Ŷ}yDވֹO4~PcIo 9^FC=ogcى V|i@G$|M:O/vh[_js#aTf"UԎ`dI$ Hl7oXXI9!W)J\/ï̺f9( xi|X8oǏe3q#Sk4]W= a KLsKnOn-?'y̮i4e1hRZhGcZ|+7å&T?'-ر3ʋ`.ȿ1U<{uB+eH?bİLM$[#:6.}uT# P(Nsm]`yVnjb[BlhT:`vG^(6e+^E 4$VلB-BA(ӏ뷝JkZ2|_3ŻsP>c7giCy@0ݞ3C=/)K,QVlyo,>b#[o}8ro*16=| ZA?f |̺lINk TS.Y$b [AsLEmk&X?R { yي\tebpK%C3ׇj!7**ŶJ}GpeCRUbfF u_8˯Ֆ2p>aHމGYuL3` 2~в"v+fѣ&0qD$EkxhsyKϹr vY^ɍq=pDq9mfY@a' ;vJrtuP{ŒiT|+fQ)^ߜ Nqh-{ºayL}=>SmCE蹀s" p2k"Pp?xe/!0jaC2[C:F=G@Bl{}칋WFT6(<`I)ĥB,(f2D6Ե^xY:EpLIpœKChk[ ]; ^exR}&W6>CšZlVhH5ֺ>0f>-[gʒ]zKѝqr,8NV6T5m{wVDDd|іY ؟fLjַN R2Nu w@wa|?U}-L온Pbԍ-V{ ; V8#2&%UBavp@9glu 4JhF#މf aGfg,JJ!m5s0uHWWxBrɒ[7lj]vw3 ݍ8= umԴpNRx몎rLObsOT_WSo򣴈@PQm9k[kKNXg 8.gA4@磵4Yp;/ZyEmu;(7OdPyЧiE6e\\-HvliG3;XJo>R!g:Nf <6&M6l j5HQ^0.. M3@z~%3pq5ycM.4(b<"˅N{fS!!e3J9*[JU,4Ư2f3R~'TpWjQ%7(dY9c"ORF+K溲]Tqkt4r0rLT|$ń҈Ne:`btm䵌G{5CeU&'%-&f^FGʰ%޷03#V\+E~dH!qP-P{KW*4VB S% kj V>w\ʽ>P Zbas~U%\> a&з{nN rO 0k1Ƌ[,Z,rf]mE3gɕ5m1g\ɯ%]o-в{@j ,=ڲY$[ti㥯UzQc6὞Uy'H te=p[4PG5G$;|YIUɄ˚*w̃JsxW0DLTM>@ 4 @9gݚV{#lQ2#x7-)82sݷN-jQf4HTeJf@CppO̅h4B|vaމA m܃aV墢<Ǯg󛰛sݥ?DWɬo;*49WvҬJ6H]o c"L<Գbkqo:x*3[AZ,$%KS['j]q@φ?ibѣ'(hq;) H²h 2m\q_3~6Yd4;Gݗtty>$̼>$ᮅYs5gvRjOzq=P`;g Dнu{23&ض0@f bT{tsOg,jl] @~a842Do U/E+$߰ (I ߱P+~=X ^\WU"~&(P{@0zs\e#dW=?bX?;}bxe?rm?*XH8 *]a!R#)*yƤ~W [*h&,ҖheV;Odbk*)@7{yG* 2e#cX E[Um\YΜV5Z} 3ZU9\Ld-Y*4~qv4UnUޫb-:`:k;?<7&4#@@鰾(VQ0a*(=OΊuR=_0K߾qYIHcn%M_{O:>[@јY&&&JpU W [ƀC^Ƨjy/ecDQ;%deq Ԏh^SI4șel]I%nӣzOhj p`O;, #1 ]U_W+M`4մĚ2<-)ڹWiZ8b gs}b5W|ߜ}f} (7[6x]_RjՇx ENV`1ܯ%ZiD~aFf0xn G C4i($.ل ۮu QSwQnTt2|QgŌ`P(7%O(Z< l -ymȶ[tͦ c rkA}3D, r ^OFT%+oЉ4AhFz"ÆD_P^/$b[b%[M(koBmׇEs2ފT]wT+?9r/sd}~j#YX{(ZqK8I&IlG =}Ǥп7!.l:Yя%)x%U1š#AER~?_q#)k7V9-T32A[,}7 ɻ6@ @|f]8 >7Dfpo)H_W%~̕,. fv٦DX5E[G@VƼg rb)w Y940V{RvjoXc,8#dՠ;k~pb3tNE(=8vZgLXq 'q.||s,z|:R7ÑH(xcYAY`wQ%u\NX21/ KM7,qo3!vᮥ' o"}[04$C<4+nI PbltLK Rn vt~kåHVt<_TP*gؼV)?I5NSJPz qku.w̱>"w/ڳӺ*<[h20TMP5qܖ%x 3rj^ykypyʘ h %ܬ.sxNJlr(RzT}=覡 | 3EWTz-[yIAѾY.!Nyr] &bS~tb) f ŤW{1pDTbW~rs[I1AJRCm=nHtY__fj ]o6~jJ(+V|tܸ8@2x/JƎGO111%}hVzbк7JJracnp_}s/@\p"Y-&YKB`RȞP44HJT fh v<l FqY*߯NdL 3j ʏFLPVs{3 Ji|<c &r nbOvrfС9YJTpHȳqZb}U*>FҴП|]1|Cf̩J.MV-ѱX\t /8bofKX0Vr|4꬙`sp&8JFnC%Cµ4AtkԚW2nUo?  Ao\[I8]ؔ͡GЩ^mH(LN"vO4GOdS tyv۲>˦eO8kh-G0IHaҔ*.y:.?+AmPfU50O\ZB+QzS8ISEߵ&.(S8Z1s/-!_=[4Q8 |DW,TM i x8u(\QR vSGѠ..2K.:a[QpWF^m(=`Bʓ &,vXxeklq+Q ,\S2 ,ʁH!_:__5!,^|Ґ[(LD)uHLt: l$WgֈdZJV&o˴f7nĻF 5 IGSvd:] ue0ف46/)]UZ,IWȯ\d3SyBPA't^JXʼn8]hxQ]T{U݅@Mjxq,k3IRFdV*'zT.^v /`!䛭o\3Q(4k%i*v] ,gqfXX9=xrqG6,q/$HJ0w_})Fp|E+MS&,vL3,1',L!mVm 6$yLc}Q '3:Cw 7; ҂H/.q8 }X=8 w/US`/k*,NmB}Z<¬|O64UD1~#%p~RnT8 kw0_L-c6;2nX(xEeג8UUBE@k٭nslHiQ-j;tI/ǙQ'J@AsE/ič6mt{CXLAFA;Erg['B荥8g ֳd Uh[ |Vct[sI "(oj-$f<RIEQf5ֆP{@\cd,G  bm/ 1\tggF/**"CJ!Q u2c ƕ$J`)paɚT o5yROF˩(H]پՈ1M!R';9r:!Qeªuh%1䥈m9WI׺(.f]̻,ۆDJ.^*TYB.DWik3Y ;8c_F;Xq[V?~}:ʾ?s s=P6@%sړB*(X݇5G.;0IYQ"@'[JC a$>bBw~v5TE) k(Ehy"{ԉ7Fyp Yw"ge6хK_e ;v_ lc4|pm;}^`3}d5a&[)5E 'i!.N,h@u|~,>FLp8`9vN =OH&g*H2ӌJKAPaz{D'&(Iǩ+U{6}*lFۛJ 򟱏} 3)/9s e]^䧽Vmv%_f7}D@v2c@WrJѬaQT2c4IGAԺjYcåyW e&+qE(mP%qtD,LlƱ;8丹_pQt8{pwY= DJI5mvG?ϰ7/?t&:{o״]:(LGYϩ].X+G y'0+h01-`ƥ˶Wk%J*v۽ë̀;Y- #_bqTZ1򺛢q?+BLRz|y 9hnŴrh;@(2)%ra@k*M U~ECeڎaB1q)]Yg4E񗈱HKV?=M@Uo)>x憀)xn4Y5Jz }ZU]qVw /Mp/()SF'L~rYOl?Y^t%ÌXBN#rU${_Mo$~Lڪ&{:X.Z:|@"!y ?FK%uB\%϶o &.}a:snl n> Mt˞F(NY)M:͂7@4Lpe1x1trQ3Ac_R!YC^%%gޚUr#TF%[pҨQ*D of wٙ,̄WǮAvq?0~K1۽c%+?θ3=HKݴP=m{4ӑv$~˝X HT>X!T=AGqP"mv=B-i؛3B 5hl,P|}e*vL amCKnl37o9󨕖f{B/Gfy 8lZN@ :½ȳܱ:bmm3V~ 3Ȓ"=TtgޡOG|!|ocغU.' rYZP]U0Om{ iٜq=36xX|L.*ljRXʎ/,I5}bV+2t|b tK|%? 5KYzhf e_T#NMäl`ayQ6x(7ePPlԽ'ed6VcV嗹?g<:<(Rm1ruw)Mg}gCG,80"ʐ.m4 VYQ#XMZ5j;iקX)Z}`=lP~8\ #5$ R;;lz}DW794.[ ]u>X_]C& MBQ5.yE%pő)WE0>`hV>(++=nfՀp~d?m(%slzX1i'A qW%&E gHMP%LY`P"e-?s>@qY 3l/squOr S22 ?bŽ7[#R;oCKpEٻ="XX/m(N`eK2 P&ҍ~b3 ӆ]Wz''_ 3$G~Lj b~ 甔  srB) )Ou g&U<nND@w@E^ҎRǟ6>Xjh||SMlުJT(@ms[&߹$'KH~+u}eqUOK SЄUzr6p {d7UuOM3&JB5CGK<UZ\ϊq5~f!M#4!-T;L{͋R "7UwMgTpҡ*($i@KR N jɸ G8xxHS4OG VycC>%BK.ۈ#=N8i5A\3ݎ@W|RRl, ξS@StbFpy9`ft56[h+&Ӈ7p>Z?6e%G> X~]uNp ȇC s((˵kLaĝcY8QtSa%u[ibR0mXh0&0ejUӓiw ՞Qj!dG.yeI?bf򯕶V~Q@)4yVZ~ׁ)(x3C2E%D*<4%pBHAD̎f$y =+pVRhwKxw݇/ ˁ{qV' 0EF7"h{V".! 2ȽZHG U?)4¾~4R;|mUrk=ۼe!AONTc-k01ǥ qNr~*@Iuc G w8h:. Ɨ]tRpR_%Hg4J-?bvin% o0j)FdL\m'9udHYmޠp1-ڞDPJw&L&z}3#] s&9&%Wv@-'t!v(WKUlP/Wn![ܠoafMso2.+eM5| kk]Cu @&{[XAd&ќ闎Qtuq: Z]V`D'raOԩk(d{dy*Ka $}YY]lo4wLB9BD29AUgnwu gH?4YYJ6y375C&Rf7u^컥+%f~*tMhSKV%ۍH,S{yѪߊ&r0MXJ2:ƍHB~<,{*wt:ŖՐW}c Fm/냅G'8`M+E{l%NPa7j} -[n96CyݱNE`j Bh7V<ЗU_+)װ}O{3NF/Ӫtw"|.}pi4J,{9\rbO7PR.:q_ !9tE=9XwZwRkss0g \̍yf㭐55/ιZ)KfTe"O)10)8SiC ]vGTz$Nmlϣ *P~pv'd q9J7~m?ЋU@mfW3D"Bu$[!X/T-5;(m/rѷ]+.x2PqlFlisY]QeDJ #HAuo k<ZO.Js=C2"d80&7up~V2FP1Cu-l-i1 XnvjYE@bP/h),8ô w =-yÅ foqfz2R[L4ʼnqMeb@ d=F vђCzRWݱQjfV. 3^¿~x^T̺ ]ЉΛFht-DWf}rJ_xMLdvذq4;\NƖǕahWF-]#oRIފ 7kb j!,87&\3N=zEI uodR7.,VpV]DĚNH]EN%iP"S.)QhWؼd9|q?=\j7C)k@+;m^O?B'3],uKO?pYf?ym3!Y7VtQ{M!8:n{\Ѱ,Vmۺz$sa-/{"xPG |܇GLI+o쉛hSYPI=*n3 Orp$p2;<,iv;ӂ6}9 ϝb[_ӭpm]PsʙY86&b !yPx)Ì%v#K iiu2zdvkZv i4nh1sDowvJN`rPvrȡVc]+h\VmMHr8Y{QԸOXw@Lz\eڲB(5)2G괻WOʢCAKXX YCp6'E-M!l}vER5Oʚ7F> Z+'i'k&/g t|x4{'0T/}~[UφѠL]2[ `xzίp`!<) uP~J&Cy\PO#ir6 \6J;bW=woía5`0go2,lꞸr*]gZWWsHl}VC]&U(@Ol(ϙjTn4mtSPnGE/N,Y 4q$w'h^Qk3#!g3vՉBəLRuw3Cs[ TO '@*/[OL$o::;}}UPH?Bn-; E1*u}q[C2@TSmp!vmxo*Rx긙L'9O|!j틝IV⨟j\U@X4KY+[S9guc BOb1'âggG u8# 9p{_M]B%#6 F)lEܡt 9ByFt>Y@[£`֛BZp2u,dhLu5ܟ{fx.5~fO5]п =+,2:&> V 9YE_\Xr$O~d4y @>^]Mt?/L/uszWHHϊ.7ݿ:o@YYL0n!M/k QLRͻ GBk!0AHr|C:LK805={7˙ hh! %,GEiL}-G)T;bj>@')_dmeOmΟѴ"@./>.{SLvs 2ܒ;N9hg+ڒsC$I Qp"%xtACT):msEv؋M"ߺqSJg_ܼ^rjg60D) I\H`k V7M;%p$q kMB,x`Ǝ30"ne9+q Cdg .@*R`R˾K5e֑E f.Eɷ ) h+XxX!+Paٙc:,k}"=m(6sU82 g1QbT&oK>q-|(bPd\\3n6U(p.޽Tj3E\'/ԾX;L\5Ç_TA~ܥzYPEAF}CE"u'8 ONX쨞3qꗂ3P p+ӷ`]"q\89m[]Q(=={l`=.[jbSve ":ɊfMJ{t=@%bSff1ر 4[͜`~>~.5):6%G:]lD\|vP0@TU +|zFDJLeUyJ#?'mtxguM E0R{Y4`Mp4 :ۏ6'oZSYs.ǤKRAJ4p)%i& yި 8UoHr_S3=)\V3 }*7f`[`& pY%JtA_LqX(|_0N16AH(}Px-6-nd#>I2 "$ }!,7O(fHdQ(c@-3"E_"MKdY,<OhYYRA8p.pVAzq5y0|,"]|ep*LѯlcG?pC5>lU޷r}9Tz3\-0[GF͌8n$4x*A.JoT]+AT!l'~TKr&rIsDDGg>`_j5zgUq"Q F%rx%ډLZycj9:!bxjn Ԃ`94tG5*g)3M6n$d[>=EΧFF =U2R{|WtzDRKfUl%I3K7[)Rҷ2I0i"*T-U3H9l`X}f :Zs a)NI;,p@ny]d8L/R80h'C5nAX4HwO܅XI e=Ќԥax;BڢsՒYfalyKXY0Ҙ-Ϙ_pr˅ֆly)2Z$VdŹ0E^ñ0Sm^#uhE\o\n]@iG:EћDT:<մYxBU[^| R?VoTǜVU±TWбW5I(1 V SE=h $0Xz(+`+fL[tipLf{j 3?Hzj xkpԆ'u0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019023l.pfm000066400000000000000000000111131404163720200220750ustar00rootroot00000000000000KCopyright 1999 URW Software. See file COPYING for license.op ,," u, x~2L222PostScriptNimbusSanLNimbusSanL-ReguItalc,,yMMHM,,,,,,,,,,HHH,c ,A  cc,M,,,,,,A,,,,M,NNH^^^,M,,MM^^^^MM^,MM^^^M,,,,,Mr,H^^^HM,^Mm,c     H c,,,,,,y,,,,,,,,,,,Hc,,,,,1,7,A,F,N,P,vT,U,V,W,Y,k,r,v,w,y,,,,,,,,,,A-F-K-L-tP-R-T-V-W-X-Y-k-r-v-w-y----1.7.A.F.N.P.vT.U.V.W.Y.k.r.v.w.y..........10,1.101112131415161718191127213730414243444546474849415751676071727374757677787971878197:T:hV:W:Y:r:t:v:w:y:T;tV;W;Y;r;t;v;w;y;-ABACADAFAGAJALANAOAPASATAUAVAWAYAAAAAAAAAAAAAAAAACKCLCNCRCTCVCWCXCYCCCCCCCAGKGLGNGRGTGVGWGYGGGGGGGCHDJFJPJTJCKAOBOCOFOKOLONOROTOVOWOXOYOOOOOOOAQXQQQQQQQKSLSTSVSWSYStS-TATDTGTKTLTOTRTSTVTWT YTiTnToTTTTTTT|TTTTTTTTTTTAULURUUUUUUU-VAVBVDVGVLVOVRVSVTVVVV V VVVVVVVVVVVVV-WAWBWDWGWLWOWRWSWTWWWWWWWWWWWWWWWDXOXX-YAYBYDYGYLYOYRYSYTY YYYYY}YwYYYYYYYYYYYAaFaKaNaPaRaTaVaWaXaYafagakaratavawaxayaaaaAbbbbbAcTcqcrcvcwcxcyccccAdrdddddAeFeKeNePeReTeVeWeXeYefegekeretevewexeyeeeff rfAgTgVgWgYgkgrgvgwgyggggchrhthFiTiViWiYifiriFjTjajfjijrjckrkflglrlvlwlylUmrmmmUnrnnnAoFoKoNoPoRoToVoWoXoYofokorotovowoxoyoooooUpYpmpnprpppAqrqxqqqqFrTrUrVrWrgrrrrrrTsfsksrsvswsyssAtStetftotptrtstttttttAuFuKuLuNuRuTuVuWuXuYukuquruuuuAvTvYvZvavbvevlvmvnvovrvvvvvvvvvvvvvvvAwTwawbwewmwnwowrwwwwwwwwwwwwwwwexoxrx xAyKyLyRyTyVyWyXyZyaybyeyhylymynyoypyryyyyyyyyyyyyyyyrzATVWYċŋBKRT,.ALgaefhnorstuĒŒ,.ALoĔŔFPRfrATVWYīūDFGTVWY-BCDFGLNOPSTUVWYBDF²GT˜UV³WYšBDFòGTØUVóWYÚ-BCDFIJGJLNOPĪSTĘUVijWYĚĶĴ-BCDFŲGJLNOPŪSTŘUVųWYŚŶŴ-BCGJL NOPƣSTƖUVƬWYƔƪƨƺƸALNRBLTVWYBCKLNRTVWYBLTVWYLTVWYABCFKLNRTVWXYBTVWYAAAALRrvwyFNPRfkrtvwyrvwyvwyFKNPRfgkrtvwyFKNPRfgkrtvwyFKNPRTVWYfgkrtvwyArrvwyFNPRfgkrtvwxyrvwyrvwyFKNPRfgkrtvwyrFKNPRfgkrtvwyFNPTVWYfrvwyRKLNRkgnustep-back-0.29.0/Fonts/Helvetica.nfont/n019024l.afm000066400000000000000000000762351404163720200220770ustar00rootroot00000000000000StartFontMetrics 3.0 Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development Comment Creation Date: 12/22/1999 Comment See the file COPYING (GNU General Public License) for license conditions. FontName NimbusSanL-BoldItal FullName Nimbus Sans L Bold Italic FamilyName Nimbus Sans L Weight Bold ItalicAngle -12.0 IsFixedPitch false UnderlinePosition -111 UnderlineThickness 69 Version 1.05 Notice (URW)++,Copyright 1999 by (URW)++ Design & Development EncodingScheme AdobeStandardEncoding FontBBox -177 -309 1107 953 CapHeight 729 XHeight 540 Descender -217 Ascender 729 StartCharMetrics 316 C 32 ; WX 278 ; N space ; B 245 0 245 0 ; C 33 ; WX 333 ; N exclam ; B 112 0 417 726 ; C 34 ; WX 474 ; N quotedbl ; B 177 470 579 729 ; C 35 ; WX 556 ; N numbersign ; B 33 -32 660 697 ; C 36 ; WX 556 ; N dollar ; B 59 -126 628 763 ; C 37 ; WX 889 ; N percent ; B 129 -20 903 709 ; C 38 ; WX 722 ; N ampersand ; B 89 -23 720 723 ; C 39 ; WX 278 ; N quoteright ; B 165 469 356 729 ; C 40 ; WX 333 ; N parenleft ; B 84 -200 458 729 ; C 41 ; WX 333 ; N parenright ; B -21 -200 356 729 ; C 42 ; WX 389 ; N asterisk ; B 145 407 478 729 ; C 43 ; WX 584 ; N plus ; B 87 -10 596 473 ; C 44 ; WX 278 ; N comma ; B 27 -174 245 146 ; C 45 ; WX 333 ; N hyphen ; B 70 207 371 342 ; C 46 ; WX 278 ; N period ; B 64 0 245 146 ; C 47 ; WX 278 ; N slash ; B -1 -14 427 714 ; C 48 ; WX 556 ; N zero ; B 81 -23 614 724 ; C 49 ; WX 556 ; N one ; B 172 0 529 709 ; C 50 ; WX 556 ; N two ; B 30 0 628 724 ; C 51 ; WX 556 ; N three ; B 67 -23 613 724 ; C 52 ; WX 556 ; N four ; B 57 0 599 709 ; C 53 ; WX 556 ; N five ; B 59 -23 641 709 ; C 54 ; WX 556 ; N six ; B 85 -23 625 724 ; C 55 ; WX 556 ; N seven ; B 131 0 679 709 ; C 56 ; WX 556 ; N eight ; B 60 -23 620 724 ; C 57 ; WX 556 ; N nine ; B 68 -23 611 724 ; C 58 ; WX 333 ; N colon ; B 113 0 374 520 ; C 59 ; WX 333 ; N semicolon ; B 76 -174 374 520 ; C 60 ; WX 584 ; N less ; B 77 -10 630 474 ; C 61 ; WX 584 ; N equal ; B 61 52 622 412 ; C 62 ; WX 584 ; N greater ; B 38 -10 591 474 ; C 63 ; WX 611 ; N question ; B 168 0 672 744 ; C 64 ; WX 975 ; N at ; B 73 -137 1032 745 ; C 65 ; WX 722 ; N A ; B 26 0 703 729 ; C 66 ; WX 722 ; N B ; B 82 0 762 729 ; C 67 ; WX 722 ; N C ; B 107 -23 793 741 ; C 68 ; WX 722 ; N D ; B 77 0 776 729 ; C 69 ; WX 667 ; N E ; B 79 0 762 729 ; C 70 ; WX 611 ; N F ; B 74 0 741 729 ; C 71 ; WX 778 ; N G ; B 107 -23 819 741 ; C 72 ; WX 722 ; N H ; B 68 0 812 729 ; C 73 ; WX 278 ; N I ; B 63 0 368 729 ; C 74 ; WX 556 ; N J ; B 59 -23 641 729 ; C 75 ; WX 722 ; N K ; B 74 0 843 729 ; C 76 ; WX 611 ; N L ; B 80 0 606 729 ; C 77 ; WX 833 ; N M ; B 66 0 931 729 ; C 78 ; WX 722 ; N N ; B 68 0 816 729 ; C 79 ; WX 778 ; N O ; B 106 -23 828 741 ; C 80 ; WX 667 ; N P ; B 76 0 747 729 ; C 81 ; WX 778 ; N Q ; B 109 -54 831 741 ; C 82 ; WX 722 ; N R ; B 80 0 785 729 ; C 83 ; WX 667 ; N S ; B 76 -23 725 741 ; C 84 ; WX 611 ; N T ; B 142 0 753 729 ; C 85 ; WX 722 ; N U ; B 119 -23 809 729 ; C 86 ; WX 667 ; N V ; B 179 0 802 729 ; C 87 ; WX 944 ; N W ; B 168 0 1087 729 ; C 88 ; WX 667 ; N X ; B 22 0 802 729 ; C 89 ; WX 667 ; N Y ; B 182 0 805 729 ; C 90 ; WX 611 ; N Z ; B 30 0 733 729 ; C 91 ; WX 333 ; N bracketleft ; B 23 -200 463 729 ; C 92 ; WX 278 ; N backslash ; B 138 -23 285 709 ; C 93 ; WX 333 ; N bracketright ; B -25 -200 415 729 ; C 94 ; WX 584 ; N asciicircum ; B 119 270 580 695 ; C 95 ; WX 556 ; N underscore ; B -65 -145 550 -76 ; C 96 ; WX 278 ; N quoteleft ; B 167 469 357 729 ; C 97 ; WX 556 ; N a ; B 50 -23 578 549 ; C 98 ; WX 611 ; N b ; B 59 -23 640 729 ; C 99 ; WX 556 ; N c ; B 77 -23 597 549 ; C 100 ; WX 611 ; N d ; B 79 -23 700 729 ; C 101 ; WX 556 ; N e ; B 64 -23 591 549 ; C 102 ; WX 333 ; N f ; B 90 0 464 729 ; C 103 ; WX 611 ; N g ; B 26 -218 656 549 ; C 104 ; WX 611 ; N h ; B 67 0 629 729 ; C 105 ; WX 278 ; N i ; B 67 0 362 729 ; C 106 ; WX 278 ; N j ; B -43 -218 365 729 ; C 107 ; WX 556 ; N k ; B 59 0 651 729 ; C 108 ; WX 278 ; N l ; B 67 0 362 729 ; C 109 ; WX 889 ; N m ; B 60 0 911 549 ; C 110 ; WX 611 ; N n ; B 63 0 629 549 ; C 111 ; WX 611 ; N o ; B 82 -23 634 549 ; C 112 ; WX 611 ; N p ; B 11 -218 637 549 ; C 113 ; WX 611 ; N q ; B 72 -218 659 549 ; C 114 ; WX 389 ; N r ; B 63 0 487 549 ; C 115 ; WX 556 ; N s ; B 60 -23 589 549 ; C 116 ; WX 333 ; N t ; B 101 -23 414 674 ; C 117 ; WX 611 ; N u ; B 88 -23 656 540 ; C 118 ; WX 556 ; N v ; B 129 0 651 540 ; C 119 ; WX 778 ; N w ; B 120 0 881 540 ; C 120 ; WX 556 ; N x ; B 16 0 648 540 ; C 121 ; WX 556 ; N y ; B 37 -219 653 540 ; C 122 ; WX 500 ; N z ; B 21 0 575 540 ; C 123 ; WX 389 ; N braceleft ; B 84 -200 472 729 ; C 124 ; WX 280 ; N bar ; B 57 -200 335 729 ; C 125 ; WX 389 ; N braceright ; B 29 -200 419 729 ; C 126 ; WX 584 ; N asciitilde ; B 97 142 581 314 ; C 161 ; WX 333 ; N exclamdown ; B 26 -186 331 540 ; C 162 ; WX 556 ; N cent ; B 79 -124 598 634 ; C 163 ; WX 556 ; N sterling ; B 49 -23 629 715 ; C 164 ; WX 167 ; N fraction ; B -177 -20 489 715 ; C 165 ; WX 556 ; N yen ; B 107 0 702 704 ; C 166 ; WX 556 ; N florin ; B -21 -220 690 744 ; C 167 ; WX 556 ; N section ; B 56 -201 596 723 ; C 168 ; WX 556 ; N currency ; B 66 100 644 604 ; C 169 ; WX 238 ; N quotesingle ; B 177 470 343 729 ; C 170 ; WX 500 ; N quotedblleft ; B 171 469 588 729 ; C 171 ; WX 556 ; N guillemotleft ; B 135 72 571 481 ; C 172 ; WX 333 ; N guilsinglleft ; B 128 72 351 481 ; C 173 ; WX 333 ; N guilsinglright ; B 96 72 319 481 ; C 174 ; WX 611 ; N fi ; B 85 0 703 729 ; C 175 ; WX 611 ; N fl ; B 88 0 701 729 ; C 177 ; WX 556 ; N endash ; B 35 207 624 311 ; C 178 ; WX 556 ; N dagger ; B 109 -194 626 709 ; C 179 ; WX 556 ; N daggerdbl ; B 35 -194 623 709 ; C 180 ; WX 278 ; N periodcentered ; B 143 182 270 282 ; C 182 ; WX 556 ; N paragraph ; B 121 -191 684 729 ; C 183 ; WX 350 ; N bullet ; B 111 175 367 425 ; C 184 ; WX 278 ; N quotesinglbase ; B 37 -135 228 125 ; C 185 ; WX 500 ; N quotedblbase ; B 37 -135 462 125 ; C 186 ; WX 500 ; N quotedblright ; B 173 469 595 729 ; C 187 ; WX 556 ; N guillemotright ; B 103 72 533 481 ; C 188 ; WX 1000 ; N ellipsis ; B 92 0 939 146 ; C 189 ; WX 1000 ; N perthousand ; B 72 -21 1021 739 ; C 191 ; WX 611 ; N questiondown ; B 52 -204 556 540 ; C 193 ; WX 333 ; N grave ; B 175 607 339 757 ; C 194 ; WX 333 ; N acute ; B 247 607 475 757 ; C 195 ; WX 333 ; N circumflex ; B 135 610 453 757 ; C 196 ; WX 333 ; N tilde ; B 117 622 500 744 ; C 197 ; WX 333 ; N macron ; B 150 642 467 722 ; C 198 ; WX 333 ; N breve ; B 188 611 455 754 ; C 199 ; WX 333 ; N dotaccent ; B 241 621 377 741 ; C 200 ; WX 333 ; N dieresis ; B 147 621 469 741 ; C 202 ; WX 333 ; N ring ; B 214 593 398 773 ; C 203 ; WX 333 ; N cedilla ; B -13 -220 270 0 ; C 205 ; WX 333 ; N hungarumlaut ; B 82 610 498 757 ; C 206 ; WX 333 ; N ogonek ; B 23 -233 248 0 ; C 207 ; WX 333 ; N caron ; B 167 610 485 757 ; C 208 ; WX 1000 ; N emdash ; B 37 207 1070 311 ; C 225 ; WX 1000 ; N AE ; B 1 0 1104 729 ; C 227 ; WX 370 ; N ordfeminine ; B 96 262 451 729 ; C 232 ; WX 611 ; N Lslash ; B 54 0 624 729 ; C 233 ; WX 778 ; N Oslash ; B 34 -39 906 749 ; C 234 ; WX 1000 ; N OE ; B 90 -23 1107 741 ; C 235 ; WX 365 ; N ordmasculine ; B 92 262 471 729 ; C 241 ; WX 889 ; N ae ; B 54 -23 927 549 ; C 245 ; WX 278 ; N dotlessi ; B 67 0 322 540 ; C 248 ; WX 278 ; N lslash ; B 50 0 372 729 ; C 249 ; WX 611 ; N oslash ; B 12 -38 709 557 ; C 250 ; WX 944 ; N oe ; B 71 -23 986 549 ; C 251 ; WX 611 ; N germandbls ; B 67 -23 654 729 ; C -1 ; WX 722 ; N Udieresis ; B 119 -23 809 920 ; C -1 ; WX 722 ; N Uacute ; B 119 -23 809 936 ; C -1 ; WX 667 ; N Scedilla ; B 76 -220 725 741 ; C -1 ; WX 611 ; N Tcaron ; B 142 0 753 936 ; C -1 ; WX 667 ; N Scaron ; B 76 -23 725 936 ; C -1 ; WX 722 ; N Rcaron ; B 80 0 785 936 ; C -1 ; WX 722 ; N Racute ; B 80 0 785 936 ; C -1 ; WX 667 ; N Sacute ; B 76 -23 725 936 ; C -1 ; WX 778 ; N Otilde ; B 106 -23 828 923 ; C -1 ; WX 611 ; N ucircumflex ; B 88 -23 656 757 ; C -1 ; WX 778 ; N Ohungarumlaut ; B 106 -23 841 936 ; C -1 ; WX 722 ; N Uhungarumlaut ; B 119 -23 809 936 ; C -1 ; WX 667 ; N Yacute ; B 182 0 805 936 ; C -1 ; WX 722 ; N Eth ; B 73 0 776 729 ; C -1 ; WX 722 ; N Dcroat ; B 73 0 776 729 ; C -1 ; WX 611 ; N Zacute ; B 30 0 733 936 ; C -1 ; WX 722 ; N Uring ; B 119 -23 809 953 ; C -1 ; WX 611 ; N gbreve ; B 26 -218 656 754 ; C -1 ; WX 556 ; N eogonek ; B 64 -233 591 549 ; C -1 ; WX 556 ; N edotaccent ; B 64 -23 591 741 ; C -1 ; WX 556 ; N ecaron ; B 64 -23 593 757 ; C -1 ; WX 722 ; N Ugrave ; B 119 -23 809 936 ; C -1 ; WX 667 ; N Thorn ; B 76 0 721 729 ; C -1 ; WX 556 ; N eacute ; B 64 -23 591 757 ; C -1 ; WX 556 ; N edieresis ; B 64 -23 591 741 ; C -1 ; WX 722 ; N dcaron ; B 79 -23 882 729 ; C -1 ; WX 556 ; N ccedilla ; B 77 -220 597 549 ; C -1 ; WX 556 ; N ccaron ; B 77 -23 607 757 ; C -1 ; WX 556 ; N cacute ; B 77 -23 597 757 ; C -1 ; WX 556 ; N aogonek ; B 50 -233 578 549 ; C -1 ; WX 556 ; N aring ; B 50 -23 578 773 ; C -1 ; WX 556 ; N atilde ; B 50 -23 612 744 ; C -1 ; WX 556 ; N abreve ; B 50 -23 578 754 ; C -1 ; WX 556 ; N egrave ; B 64 -23 591 757 ; C -1 ; WX 556 ; N agrave ; B 50 -23 578 757 ; C -1 ; WX 556 ; N aacute ; B 50 -23 587 757 ; C -1 ; WX 556 ; N adieresis ; B 50 -23 581 741 ; C -1 ; WX 722 ; N Uogonek ; B 119 -233 809 729 ; C -1 ; WX 611 ; N ugrave ; B 88 -23 656 757 ; C -1 ; WX 611 ; N uacute ; B 88 -23 656 757 ; C -1 ; WX 611 ; N udieresis ; B 88 -23 656 741 ; C -1 ; WX 404 ; N tcaron ; B 101 -23 578 829 ; C -1 ; WX 556 ; N scommaaccent ; B 60 -307 589 549 ; C -1 ; WX 611 ; N Zcaron ; B 30 0 733 936 ; C -1 ; WX 556 ; N ecircumflex ; B 64 -23 591 757 ; C -1 ; WX 722 ; N Ucircumflex ; B 119 -23 809 936 ; C -1 ; WX 556 ; N acircumflex ; B 50 -23 578 757 ; C -1 ; WX 611 ; N Zdotaccent ; B 30 0 733 918 ; C -1 ; WX 556 ; N scaron ; B 60 -23 597 757 ; C -1 ; WX 722 ; N Amacron ; B 26 0 706 901 ; C -1 ; WX 556 ; N sacute ; B 60 -23 589 757 ; C -1 ; WX 611 ; N Tcommaaccent ; B 142 -307 753 729 ; C -1 ; WX 667 ; N Ydieresis ; B 182 0 805 920 ; C -1 ; WX 611 ; N thorn ; B 11 -218 637 729 ; C -1 ; WX 667 ; N Emacron ; B 79 0 762 901 ; C -1 ; WX 778 ; N Ograve ; B 106 -23 828 936 ; C -1 ; WX 778 ; N Oacute ; B 106 -23 828 936 ; C -1 ; WX 778 ; N Odieresis ; B 106 -23 828 920 ; C -1 ; WX 722 ; N Ntilde ; B 68 0 816 923 ; C -1 ; WX 722 ; N Ncaron ; B 68 0 816 936 ; C -1 ; WX 722 ; N Nacute ; B 68 0 816 936 ; C -1 ; WX 611 ; N Lcaron ; B 80 0 607 729 ; C -1 ; WX 611 ; N Lacute ; B 80 0 606 936 ; C -1 ; WX 278 ; N Idotaccent ; B 63 0 388 918 ; C -1 ; WX 389 ; N racute ; B 63 0 500 757 ; C -1 ; WX 278 ; N Icircumflex ; B 63 0 467 936 ; C -1 ; WX 611 ; N ohungarumlaut ; B 82 -23 710 757 ; C -1 ; WX 611 ; N otilde ; B 82 -23 639 744 ; C -1 ; WX 556 ; N Euro ; B 21 -23 648 724 ; C -1 ; WX 611 ; N ocircumflex ; B 82 -23 634 757 ; C -1 ; WX 444 ; N onesuperior ; B 210 284 438 709 ; C -1 ; WX 444 ; N twosuperior ; B 124 284 499 718 ; C -1 ; WX 444 ; N threesuperior ; B 147 271 490 718 ; C -1 ; WX 278 ; N Igrave ; B 63 0 368 936 ; C -1 ; WX 278 ; N Iacute ; B 63 0 489 936 ; C -1 ; WX 278 ; N Imacron ; B 63 0 466 901 ; C -1 ; WX 278 ; N Iogonek ; B 7 -233 368 729 ; C -1 ; WX 278 ; N Idieresis ; B 63 0 483 920 ; C -1 ; WX 778 ; N Gbreve ; B 107 -23 819 934 ; C -1 ; WX 722 ; N Umacron ; B 119 -23 809 901 ; C -1 ; WX 722 ; N Kcommaaccent ; B 74 -307 843 729 ; C -1 ; WX 611 ; N ograve ; B 82 -23 634 757 ; C -1 ; WX 667 ; N Scommaaccent ; B 76 -307 725 741 ; C -1 ; WX 667 ; N Eogonek ; B 79 -233 762 729 ; C -1 ; WX 611 ; N oacute ; B 82 -23 634 757 ; C -1 ; WX 667 ; N Edotaccent ; B 79 0 762 918 ; C -1 ; WX 268 ; N iogonek ; B 0 -233 351 729 ; C -1 ; WX 611 ; N gcommaaccent ; B 26 -218 656 854 ; C -1 ; WX 611 ; N odieresis ; B 82 -23 634 741 ; C -1 ; WX 611 ; N ntilde ; B 63 0 646 744 ; C -1 ; WX 611 ; N ncaron ; B 63 0 629 757 ; C -1 ; WX 667 ; N Ecaron ; B 79 0 762 936 ; C -1 ; WX 667 ; N Ecircumflex ; B 79 0 762 936 ; C -1 ; WX 556 ; N scedilla ; B 60 -220 589 549 ; C -1 ; WX 389 ; N rcaron ; B 63 0 533 757 ; C -1 ; WX 667 ; N Egrave ; B 79 0 762 936 ; C -1 ; WX 667 ; N Eacute ; B 79 0 762 936 ; C -1 ; WX 778 ; N Gcommaaccent ; B 107 -307 819 741 ; C -1 ; WX 722 ; N Rcommaaccent ; B 80 -307 785 729 ; C -1 ; WX 667 ; N Edieresis ; B 79 0 762 920 ; C -1 ; WX 611 ; N nacute ; B 63 0 629 757 ; C -1 ; WX 611 ; N uogonek ; B 88 -233 656 540 ; C -1 ; WX 611 ; N umacron ; B 88 -23 656 722 ; C -1 ; WX 722 ; N Dcaron ; B 77 0 776 936 ; C -1 ; WX 384 ; N lcaron ; B 67 0 544 729 ; C -1 ; WX 722 ; N Ccaron ; B 107 -23 793 936 ; C -1 ; WX 722 ; N Cacute ; B 107 -23 793 936 ; C -1 ; WX 722 ; N Ccedilla ; B 107 -220 793 741 ; C -1 ; WX 606 ; N degree ; B 240 383 543 686 ; C -1 ; WX 722 ; N Aogonek ; B 26 -233 703 729 ; C -1 ; WX 584 ; N minus ; B 77 172 606 292 ; C -1 ; WX 584 ; N multiply ; B 102 18 582 444 ; C -1 ; WX 584 ; N divide ; B 77 0 606 462 ; C -1 ; WX 722 ; N Aring ; B 26 0 703 953 ; C -1 ; WX 1000 ; N trademark ; B 213 273 1087 729 ; C -1 ; WX 389 ; N rcommaaccent ; B 8 -307 487 549 ; C -1 ; WX 278 ; N lacute ; B 67 0 474 936 ; C -1 ; WX 611 ; N omacron ; B 82 -23 634 722 ; C -1 ; WX 722 ; N Atilde ; B 26 0 739 923 ; C -1 ; WX 278 ; N icircumflex ; B 67 0 426 757 ; C -1 ; WX 278 ; N igrave ; B 67 0 322 757 ; C -1 ; WX 611 ; N ncommaaccent ; B 63 -307 629 549 ; C -1 ; WX 278 ; N lcommaaccent ; B 11 -307 362 729 ; C -1 ; WX 584 ; N plusminus ; B 50 0 630 633 ; C -1 ; WX 1055 ; N onehalf ; B 210 -20 1050 715 ; C -1 ; WX 1055 ; N onequarter ; B 210 -20 1032 715 ; C -1 ; WX 1055 ; N threequarters ; B 147 -20 1032 718 ; C -1 ; WX 278 ; N iacute ; B 67 0 448 757 ; C -1 ; WX 722 ; N Abreve ; B 26 0 703 934 ; C -1 ; WX 556 ; N kcommaaccent ; B 59 -307 651 729 ; C -1 ; WX 778 ; N Omacron ; B 106 -23 828 901 ; C -1 ; WX 278 ; N imacron ; B 67 0 424 722 ; C -1 ; WX 556 ; N emacron ; B 64 -23 591 722 ; C -1 ; WX 556 ; N amacron ; B 50 -23 579 722 ; C -1 ; WX 333 ; N tcommaaccent ; B 62 -307 414 674 ; C -1 ; WX 556 ; N ydieresis ; B 37 -219 653 741 ; C -1 ; WX 500 ; N zdotaccent ; B 21 0 575 741 ; C -1 ; WX 500 ; N zcaron ; B 21 0 575 757 ; C -1 ; WX 500 ; N zacute ; B 21 0 575 757 ; C -1 ; WX 556 ; N yacute ; B 37 -219 653 757 ; C -1 ; WX 611 ; N uhungarumlaut ; B 88 -23 697 757 ; C -1 ; WX 611 ; N eth ; B 83 -23 633 744 ; C -1 ; WX 611 ; N uring ; B 88 -23 656 773 ; C -1 ; WX 778 ; N Ocircumflex ; B 106 -23 828 936 ; C -1 ; WX 333 ; N commaaccent ; B 43 -307 217 -60 ; C -1 ; WX 737 ; N copyright ; B 54 -22 837 743 ; C -1 ; WX 737 ; N registered ; B 55 -22 837 743 ; C -1 ; WX 722 ; N Acircumflex ; B 26 0 703 936 ; C -1 ; WX 278 ; N idieresis ; B 67 0 442 741 ; C -1 ; WX 489 ; N lozenge ; B 95 0 541 744 ; C -1 ; WX 729 ; N Delta ; B 8 0 721 729 ; C -1 ; WX 584 ; N notequal ; B 61 -74 622 544 ; C -1 ; WX 542 ; N radical ; B 102 -36 705 913 ; C -1 ; WX 722 ; N Agrave ; B 26 0 703 936 ; C -1 ; WX 722 ; N Aacute ; B 26 0 714 936 ; C -1 ; WX 584 ; N lessequal ; B 35 0 657 624 ; C -1 ; WX 584 ; N greaterequal ; B 44 0 627 624 ; C -1 ; WX 584 ; N logicalnot ; B 103 86 632 376 ; C -1 ; WX 711 ; N summation ; B -18 -97 760 760 ; C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ; C -1 ; WX 722 ; N Ncommaaccent ; B 68 -307 816 729 ; C -1 ; WX 611 ; N dcroat ; B 79 -23 746 729 ; C -1 ; WX 280 ; N brokenbar ; B 57 -200 335 729 ; C -1 ; WX 611 ; N Lcommaaccent ; B 80 -309 606 729 ; C -1 ; WX 722 ; N Adieresis ; B 26 0 708 920 ; C -1 ; WX 611 ; N mu ; B 11 -220 655 540 ; C -1 ; WX 278 ; N .notdef ; B 245 0 245 0 ; EndCharMetrics StartKernData StartKernPairs 998 KPX A C -36 KPX A Ccedilla -36 KPX A G -38 KPX A O -37 KPX A Odieresis -37 KPX A Q -39 KPX A T -91 KPX A U -37 KPX A Uacute -37 KPX A Ucircumflex -37 KPX A Udieresis -37 KPX A Ugrave -37 KPX A V -74 KPX A W -57 KPX A Y -96 KPX A a -11 KPX A b -10 KPX A c -17 KPX A ccedilla -17 KPX A comma 9 KPX A d -17 KPX A e -10 KPX A g -20 KPX A guillemotleft -48 KPX A guilsinglleft -44 KPX A hyphen 2 KPX A o -19 KPX A period 13 KPX A q -13 KPX A quotedblright -71 KPX A quoteright -67 KPX A t -21 KPX A u -17 KPX A v -42 KPX A w -28 KPX A y -41 KPX Aacute C -37 KPX Aacute G -38 KPX Aacute O -38 KPX Aacute Q -40 KPX Aacute T -91 KPX Aacute U -38 KPX Aacute V -74 KPX Aacute W -57 KPX Aacute Y -96 KPX Aacute a -11 KPX Aacute b -10 KPX Aacute c -17 KPX Aacute comma 9 KPX Aacute d -17 KPX Aacute e -11 KPX Aacute g -20 KPX Aacute guillemotleft -48 KPX Aacute guilsinglleft -45 KPX Aacute hyphen 2 KPX Aacute o -20 KPX Aacute period 12 KPX Aacute q -14 KPX Aacute quoteright -67 KPX Aacute t -22 KPX Aacute u -18 KPX Aacute v -42 KPX Aacute w -29 KPX Aacute y -41 KPX Acircumflex C -36 KPX Acircumflex G -38 KPX Acircumflex O -37 KPX Acircumflex Q -39 KPX Acircumflex T -91 KPX Acircumflex U -37 KPX Acircumflex V -74 KPX Acircumflex W -57 KPX Acircumflex Y -96 KPX Acircumflex comma 9 KPX Acircumflex period 13 KPX Adieresis C -37 KPX Adieresis G -38 KPX Adieresis O -38 KPX Adieresis Q -39 KPX Adieresis T -91 KPX Adieresis U -38 KPX Adieresis V -74 KPX Adieresis W -57 KPX Adieresis Y -96 KPX Adieresis a -11 KPX Adieresis b -10 KPX Adieresis c -17 KPX Adieresis comma 9 KPX Adieresis d -17 KPX Adieresis g -20 KPX Adieresis guillemotleft -48 KPX Adieresis guilsinglleft -44 KPX Adieresis hyphen 2 KPX Adieresis o -20 KPX Adieresis period 12 KPX Adieresis q -13 KPX Adieresis quotedblright -71 KPX Adieresis quoteright -67 KPX Adieresis t -22 KPX Adieresis u -17 KPX Adieresis v -42 KPX Adieresis w -28 KPX Adieresis y -41 KPX Agrave C -36 KPX Agrave G -38 KPX Agrave O -37 KPX Agrave Q -39 KPX Agrave T -91 KPX Agrave U -37 KPX Agrave V -74 KPX Agrave W -57 KPX Agrave Y -96 KPX Agrave comma 9 KPX Agrave period 13 KPX Aring C -36 KPX Aring G -38 KPX Aring O -37 KPX Aring Q -39 KPX Aring T -91 KPX Aring U -37 KPX Aring V -74 KPX Aring W -57 KPX Aring Y -96 KPX Aring a -11 KPX Aring b -10 KPX Aring c -17 KPX Aring comma 9 KPX Aring d -17 KPX Aring e -10 KPX Aring g -20 KPX Aring guillemotleft -48 KPX Aring guilsinglleft -44 KPX Aring hyphen 2 KPX Aring o -19 KPX Aring period 13 KPX Aring q -13 KPX Aring quotedblright -71 KPX Aring quoteright -67 KPX Aring t -21 KPX Aring u -17 KPX Aring v -42 KPX Aring w -28 KPX Aring y -41 KPX Atilde C -38 KPX Atilde G -40 KPX Atilde O -39 KPX Atilde Q -41 KPX Atilde T -92 KPX Atilde U -39 KPX Atilde V -74 KPX Atilde W -57 KPX Atilde Y -96 KPX Atilde comma 9 KPX Atilde period 11 KPX B A -41 KPX B AE -30 KPX B Aacute -41 KPX B Acircumflex -41 KPX B Adieresis -41 KPX B Aring -41 KPX B Atilde -41 KPX B O -18 KPX B OE -9 KPX B Oacute -18 KPX B Ocircumflex -18 KPX B Odieresis -18 KPX B Ograve -18 KPX B Oslash -17 KPX B V -46 KPX B W -30 KPX B Y -63 KPX C A -34 KPX C AE -23 KPX C Aacute -34 KPX C Adieresis -34 KPX C Aring -34 KPX C H -1 KPX C K -4 KPX C O -12 KPX C Oacute -12 KPX C Odieresis -12 KPX Ccedilla A -34 KPX D A -40 KPX D Aacute -40 KPX D Acircumflex -40 KPX D Adieresis -40 KPX D Agrave -40 KPX D Aring -40 KPX D Atilde -40 KPX D J -4 KPX D T -24 KPX D V -37 KPX D W -20 KPX D X -40 KPX D Y -62 KPX F A -68 KPX F Aacute -68 KPX F Acircumflex -68 KPX F Adieresis -68 KPX F Agrave -68 KPX F Aring -68 KPX F Atilde -68 KPX F J -33 KPX F O -24 KPX F Odieresis -24 KPX F a -23 KPX F aacute -23 KPX F adieresis -23 KPX F ae -26 KPX F aring -23 KPX F comma -84 KPX F e -12 KPX F eacute -12 KPX F hyphen 4 KPX F i -15 KPX F j -17 KPX F o -21 KPX F oacute -21 KPX F odieresis -21 KPX F oe -16 KPX F oslash -24 KPX F period -82 KPX F r -35 KPX F u -32 KPX G A -17 KPX G AE -5 KPX G Aacute -17 KPX G Acircumflex -17 KPX G Adieresis -17 KPX G Agrave -17 KPX G Aring -17 KPX G Atilde -17 KPX G T -28 KPX G V -41 KPX G W -25 KPX G Y -65 KPX J A -38 KPX J AE -29 KPX J Adieresis -38 KPX J Aring -38 KPX K C -59 KPX K G -61 KPX K O -60 KPX K OE -51 KPX K Oacute -60 KPX K Odieresis -60 KPX K S -45 KPX K T 5 KPX K a -17 KPX K adieresis -17 KPX K ae -17 KPX K aring -17 KPX K e -38 KPX K hyphen -52 KPX K o -45 KPX K oacute -45 KPX K odieresis -45 KPX K u -35 KPX K udieresis -35 KPX K y -74 KPX L A 0 KPX L AE 12 KPX L Aacute 0 KPX L Adieresis 0 KPX L Aring 0 KPX L C -35 KPX L Ccedilla -36 KPX L G -40 KPX L O -39 KPX L Oacute -39 KPX L Ocircumflex -39 KPX L Odieresis -39 KPX L Ograve -39 KPX L Otilde -39 KPX L S -14 KPX L T -104 KPX L U -35 KPX L Udieresis -35 KPX L V -102 KPX L W -79 KPX L Y -121 KPX L hyphen -20 KPX L quotedblright -147 KPX L quoteright -143 KPX L u -17 KPX L udieresis -17 KPX L y -64 KPX N A -15 KPX N AE -2 KPX N Aacute -15 KPX N Adieresis -15 KPX N Aring -15 KPX N C -1 KPX N Ccedilla -1 KPX N G -2 KPX N O -2 KPX N Oacute -2 KPX N Odieresis -2 KPX N a 5 KPX N aacute 5 KPX N adieresis 5 KPX N ae 4 KPX N aring 5 KPX N comma 7 KPX N e 10 KPX N eacute 10 KPX N o 1 KPX N oacute 1 KPX N odieresis 1 KPX N oslash 2 KPX N period 8 KPX N u 4 KPX N udieresis 4 KPX O A -42 KPX O AE -33 KPX O Aacute -42 KPX O Adieresis -42 KPX O Aring -42 KPX O T -32 KPX O V -40 KPX O W -24 KPX O X -43 KPX O Y -65 KPX Oacute A -42 KPX Oacute T -32 KPX Oacute V -40 KPX Oacute W -24 KPX Oacute Y -65 KPX Ocircumflex T -32 KPX Ocircumflex V -40 KPX Ocircumflex Y -65 KPX Odieresis A -42 KPX Odieresis T -32 KPX Odieresis V -40 KPX Odieresis W -24 KPX Odieresis X -43 KPX Odieresis Y -65 KPX Ograve T -32 KPX Ograve V -40 KPX Ograve Y -65 KPX Oslash A -34 KPX Otilde T -32 KPX Otilde V -40 KPX Otilde Y -65 KPX P A -71 KPX P AE -62 KPX P Aacute -71 KPX P Adieresis -71 KPX P Aring -71 KPX P J -52 KPX P a -14 KPX P aacute -14 KPX P adieresis -14 KPX P ae -15 KPX P aring -14 KPX P comma -103 KPX P e -13 KPX P eacute -13 KPX P hyphen -7 KPX P o -22 KPX P oacute -22 KPX P odieresis -22 KPX P oe -17 KPX P oslash -26 KPX P period -101 KPX R C -12 KPX R Ccedilla -12 KPX R G -13 KPX R O -13 KPX R OE -3 KPX R Oacute -13 KPX R Odieresis -13 KPX R T -12 KPX R U -12 KPX R Udieresis -12 KPX R V -38 KPX R W -22 KPX R Y -50 KPX R a -4 KPX R aacute -4 KPX R adieresis -4 KPX R ae -5 KPX R aring -4 KPX R e 0 KPX R eacute 0 KPX R hyphen 10 KPX R o -9 KPX R oacute -9 KPX R odieresis -9 KPX R oe -4 KPX R u -6 KPX R uacute -6 KPX R udieresis -6 KPX R y -4 KPX S A -26 KPX S AE -14 KPX S Aacute -26 KPX S Adieresis -26 KPX S Aring -26 KPX S T -15 KPX S V -36 KPX S W -20 KPX S Y -54 KPX S t -4 KPX T A -93 KPX T AE -85 KPX T Aacute -93 KPX T Acircumflex -93 KPX T Adieresis -93 KPX T Agrave -93 KPX T Aring -93 KPX T Atilde -93 KPX T C -29 KPX T G -30 KPX T J -95 KPX T O -30 KPX T OE -20 KPX T Oacute -30 KPX T Ocircumflex -30 KPX T Odieresis -30 KPX T Ograve -30 KPX T Oslash -36 KPX T Otilde -30 KPX T S -7 KPX T V 9 KPX T W 15 KPX T Y 7 KPX T a -77 KPX T ae -78 KPX T c -79 KPX T colon -104 KPX T comma -75 KPX T e -72 KPX T g -79 KPX T guillemotleft -107 KPX T guilsinglleft -103 KPX T hyphen -53 KPX T i -9 KPX T j -11 KPX T o -81 KPX T oslash -80 KPX T period -73 KPX T r -76 KPX T s -81 KPX T semicolon -105 KPX T u -78 KPX T v -91 KPX T w -85 KPX T y -89 KPX U A -40 KPX U AE -30 KPX U Aacute -40 KPX U Acircumflex -40 KPX U Adieresis -40 KPX U Aring -40 KPX U Atilde -40 KPX U comma -17 KPX U m -3 KPX U n -5 KPX U p -3 KPX U period -12 KPX U r -5 KPX Uacute A -40 KPX Uacute comma -17 KPX Uacute m -3 KPX Uacute n -5 KPX Uacute p -3 KPX Uacute period -12 KPX Uacute r -5 KPX Ucircumflex A -40 KPX Udieresis A -40 KPX Udieresis b -4 KPX Udieresis comma -17 KPX Udieresis m -3 KPX Udieresis n -5 KPX Udieresis p -3 KPX Udieresis period -12 KPX Udieresis r -5 KPX Ugrave A -40 KPX V A -75 KPX V AE -65 KPX V Aacute -75 KPX V Acircumflex -75 KPX V Adieresis -75 KPX V Agrave -75 KPX V Aring -75 KPX V Atilde -75 KPX V C -43 KPX V G -44 KPX V O -44 KPX V Oacute -44 KPX V Ocircumflex -44 KPX V Odieresis -44 KPX V Ograve -44 KPX V Oslash -42 KPX V Otilde -44 KPX V S -31 KPX V T 12 KPX V a -51 KPX V ae -52 KPX V colon -74 KPX V comma -76 KPX V e -46 KPX V g -54 KPX V guillemotleft -81 KPX V guilsinglleft -77 KPX V hyphen -26 KPX V i -13 KPX V o -56 KPX V oslash -55 KPX V period -74 KPX V r -43 KPX V semicolon -77 KPX V u -42 KPX V y -19 KPX W A -59 KPX W AE -50 KPX W Aacute -59 KPX W Acircumflex -59 KPX W Adieresis -59 KPX W Agrave -59 KPX W Aring -59 KPX W Atilde -59 KPX W C -28 KPX W G -29 KPX W O -29 KPX W Oacute -29 KPX W Ocircumflex -29 KPX W Odieresis -29 KPX W Ograve -29 KPX W Oslash -27 KPX W Otilde -29 KPX W S -22 KPX W T 16 KPX W a -34 KPX W ae -34 KPX W colon -61 KPX W comma -53 KPX W e -28 KPX W g -36 KPX W guillemotleft -63 KPX W guilsinglleft -59 KPX W hyphen -9 KPX W i -9 KPX W o -38 KPX W oslash -37 KPX W period -51 KPX W r -33 KPX W semicolon -63 KPX W u -32 KPX W y -9 KPX X C -39 KPX X O -40 KPX X Odieresis -40 KPX X Q -43 KPX X a -17 KPX X e -33 KPX X hyphen -33 KPX X o -43 KPX X u -35 KPX X y -48 KPX Y A -91 KPX Y AE -81 KPX Y Aacute -91 KPX Y Acircumflex -91 KPX Y Adieresis -91 KPX Y Agrave -91 KPX Y Aring -91 KPX Y Atilde -91 KPX Y C -60 KPX Y G -61 KPX Y O -61 KPX Y Oacute -61 KPX Y Ocircumflex -61 KPX Y Odieresis -61 KPX Y Ograve -61 KPX Y Oslash -58 KPX Y Otilde -61 KPX Y S -39 KPX Y T 14 KPX Y a -71 KPX Y ae -71 KPX Y colon -90 KPX Y comma -85 KPX Y e -66 KPX Y g -73 KPX Y guillemotleft -105 KPX Y guilsinglleft -101 KPX Y hyphen -55 KPX Y i -11 KPX Y o -76 KPX Y oslash -74 KPX Y p -53 KPX Y period -84 KPX Y semicolon -93 KPX Y u -57 KPX Y v -36 KPX Z v -21 KPX Z y -19 KPX a j -7 KPX a quoteright -14 KPX a v -23 KPX a w -10 KPX a y -24 KPX aacute v -23 KPX aacute w -10 KPX aacute y -24 KPX adieresis v -23 KPX adieresis w -10 KPX adieresis y -24 KPX ae v -21 KPX ae w -7 KPX ae y -23 KPX agrave v -23 KPX agrave w -10 KPX agrave y -24 KPX aring v -23 KPX aring w -10 KPX aring y -24 KPX b v -23 KPX b w -9 KPX b y -25 KPX c h -9 KPX c k -5 KPX comma one -79 KPX comma quotedblright -39 KPX comma quoteright -35 KPX e quoteright -13 KPX e t -9 KPX e v -22 KPX e w -9 KPX e x -25 KPX e y -25 KPX eacute v -22 KPX eacute w -9 KPX eacute y -25 KPX ecircumflex v -22 KPX ecircumflex w -9 KPX ecircumflex y -25 KPX eight four 2 KPX eight one -32 KPX eight seven -15 KPX f a -6 KPX f aacute -6 KPX f adieresis -6 KPX f ae -6 KPX f aring -6 KPX f e -6 KPX f eacute -6 KPX f f 14 KPX f i -13 KPX f j -15 KPX f l -13 KPX f o -16 KPX f oacute -16 KPX f odieresis -16 KPX f oe -11 KPX f oslash -16 KPX f quoteright 0 KPX f s -10 KPX f t 14 KPX five four -3 KPX five one -37 KPX five seven -17 KPX four four 0 KPX four one -55 KPX four seven -33 KPX g a -3 KPX g adieresis -3 KPX g ae -4 KPX g aring -3 KPX g e 1 KPX g eacute 1 KPX g l -5 KPX g oacute -8 KPX g odieresis -8 KPX g r -3 KPX guillemotright A -56 KPX guillemotright AE -46 KPX guillemotright Aacute -56 KPX guillemotright Adieresis -56 KPX guillemotright Aring -56 KPX guillemotright T -115 KPX guillemotright V -84 KPX guillemotright W -65 KPX guillemotright Y -117 KPX guilsinglright A -52 KPX guilsinglright AE -42 KPX guilsinglright Aacute -52 KPX guilsinglright Adieresis -52 KPX guilsinglright Aring -52 KPX guilsinglright T -110 KPX guilsinglright V -79 KPX guilsinglright W -60 KPX guilsinglright Y -113 KPX h quoteright -15 KPX h y -25 KPX hyphen A -7 KPX hyphen AE 2 KPX hyphen Aacute -7 KPX hyphen Adieresis -7 KPX hyphen Aring -7 KPX hyphen T -64 KPX hyphen V -34 KPX hyphen W -15 KPX hyphen Y -71 KPX i T -12 KPX i j -7 KPX k a -13 KPX k aacute -13 KPX k adieresis -13 KPX k ae -15 KPX k aring -13 KPX k comma -3 KPX k e -19 KPX k eacute -19 KPX k g -26 KPX k hyphen -31 KPX k o -28 KPX k oacute -28 KPX k odieresis -28 KPX k period -3 KPX k s -23 KPX k u -8 KPX k udieresis -8 KPX l v -14 KPX l y -11 KPX m p -1 KPX m v -23 KPX m w -9 KPX m y -23 KPX n T -87 KPX n p -2 KPX n quoteright -15 KPX n v -24 KPX n w -11 KPX n y -25 KPX nine four -6 KPX nine one -30 KPX nine seven -23 KPX o T -90 KPX o quoteright -19 KPX o t -13 KPX o v -27 KPX o w -13 KPX o x -30 KPX o y -29 KPX oacute v -27 KPX oacute w -13 KPX oacute y -29 KPX ocircumflex t -13 KPX odieresis t -13 KPX odieresis v -27 KPX odieresis w -13 KPX odieresis x -30 KPX odieresis y -29 KPX ograve v -27 KPX ograve w -13 KPX ograve y -29 KPX one comma -51 KPX one eight -47 KPX one five -50 KPX one four -70 KPX one nine -47 KPX one one -92 KPX one period -49 KPX one seven -72 KPX one six -48 KPX one three -53 KPX one two -56 KPX one zero -44 KPX p t -10 KPX p y -25 KPX period one -80 KPX period quotedblright -39 KPX period quoteright -35 KPX q c -3 KPX q u -3 KPX quotedblbase A 7 KPX quotedblbase AE 19 KPX quotedblbase T -79 KPX quotedblbase V -77 KPX quotedblbase W -54 KPX quotedblbase Y -96 KPX quotedblleft A -72 KPX quotedblleft AE -64 KPX quotedblleft Aacute -72 KPX quotedblleft Adieresis -72 KPX quotedblleft Aring -72 KPX quotedblleft T -11 KPX quotedblleft V 0 KPX quotedblleft W 9 KPX quotedblleft Y -15 KPX quotedblright A -72 KPX quotedblright AE -64 KPX quotedblright Aacute -72 KPX quotedblright Adieresis -72 KPX quotedblright Aring -72 KPX quotedblright T -7 KPX quotedblright V 1 KPX quotedblright W 11 KPX quotedblright Y -14 KPX quoteleft A -76 KPX quoteleft AE -69 KPX quoteleft Aacute -76 KPX quoteleft Adieresis -76 KPX quoteleft Aring -76 KPX quoteleft T -15 KPX quoteleft V -4 KPX quoteleft W 5 KPX quoteleft Y -20 KPX quoteright A -80 KPX quoteright AE -72 KPX quoteright Aacute -80 KPX quoteright Adieresis -80 KPX quoteright Aring -80 KPX quoteright comma -53 KPX quoteright d -30 KPX quoteright o -34 KPX quoteright period -51 KPX quoteright r -20 KPX quoteright s -27 KPX quoteright t -11 KPX quoteright v -11 KPX quoteright w -4 KPX quoteright y -9 KPX r a -1 KPX r aacute -1 KPX r acircumflex -1 KPX r adieresis -1 KPX r ae -2 KPX r agrave -1 KPX r aring -1 KPX r c -6 KPX r ccedilla -6 KPX r colon -36 KPX r comma -64 KPX r d -5 KPX r e 2 KPX r eacute 2 KPX r ecircumflex 2 KPX r egrave 2 KPX r f 15 KPX r g -7 KPX r h -12 KPX r hyphen -40 KPX r i -12 KPX r j -13 KPX r k -8 KPX r l -12 KPX r m -8 KPX r n -10 KPX r o -7 KPX r oacute -7 KPX r ocircumflex -7 KPX r odieresis -7 KPX r oe -2 KPX r ograve -7 KPX r oslash -12 KPX r p -7 KPX r period -63 KPX r q -2 KPX r quoteright 4 KPX r r -10 KPX r s -4 KPX r semicolon -37 KPX r t 15 KPX r u -8 KPX r v 12 KPX r w 17 KPX r x 7 KPX r y 14 KPX r z 2 KPX s quoteright -12 KPX s t -9 KPX seven colon -71 KPX seven comma -95 KPX seven eight -10 KPX seven five -28 KPX seven four -70 KPX seven one -21 KPX seven period -94 KPX seven seven 2 KPX seven six -21 KPX seven three -7 KPX seven two -11 KPX six four -1 KPX six one -29 KPX six seven -13 KPX t S -9 KPX t a -3 KPX t aacute -3 KPX t adieresis -3 KPX t ae -5 KPX t aring -3 KPX t colon -41 KPX t e -5 KPX t eacute -5 KPX t h -9 KPX t o -15 KPX t oacute -15 KPX t odieresis -15 KPX t quoteright -3 KPX t semicolon -42 KPX three four -2 KPX three one -34 KPX three seven -19 KPX two four -16 KPX two one -24 KPX two seven -12 KPX u quoteright -8 KPX v a -21 KPX v aacute -21 KPX v acircumflex -21 KPX v adieresis -21 KPX v ae -21 KPX v agrave -21 KPX v aring -21 KPX v atilde -21 KPX v c -25 KPX v colon -41 KPX v comma -57 KPX v e -18 KPX v eacute -18 KPX v ecircumflex -18 KPX v egrave -18 KPX v g -26 KPX v hyphen -5 KPX v l -12 KPX v o -28 KPX v oacute -28 KPX v odieresis -28 KPX v ograve -28 KPX v oslash -28 KPX v period -55 KPX v s -25 KPX v semicolon -43 KPX w a -11 KPX w aacute -11 KPX w acircumflex -11 KPX w adieresis -11 KPX w ae -12 KPX w agrave -11 KPX w aring -11 KPX w atilde -11 KPX w c -12 KPX w colon -36 KPX w comma -38 KPX w e -5 KPX w eacute -5 KPX w ecircumflex -5 KPX w egrave -5 KPX w g -13 KPX w hyphen 7 KPX w l -8 KPX w o -15 KPX w oacute -15 KPX w odieresis -15 KPX w ograve -15 KPX w oslash -14 KPX w period -36 KPX w s -15 KPX w semicolon -38 KPX x a -22 KPX x c -27 KPX x e -20 KPX x eacute -20 KPX x o -30 KPX x q -23 KPX y a -20 KPX y aacute -20 KPX y acircumflex -20 KPX y adieresis -20 KPX y ae -20 KPX y agrave -20 KPX y aring -20 KPX y atilde -20 KPX y c -26 KPX y colon -40 KPX y comma -58 KPX y e -19 KPX y eacute -19 KPX y ecircumflex -19 KPX y egrave -19 KPX y g -27 KPX y hyphen -4 KPX y l -11 KPX y o -28 KPX y oacute -28 KPX y odieresis -28 KPX y ograve -28 KPX y oslash -27 KPX y period -55 KPX y s -24 KPX y semicolon -43 KPX zero four -3 KPX zero one -29 KPX zero seven -21 EndKernPairs EndKernData EndFontMetrics gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019024l.pfb000066400000000000000000001141451404163720200220740ustar00rootroot00000000000000h%!PS-AdobeFont-1.0: NimbusSanL-BoldItal 1.05 %%CreationDate: Wed Dec 22 1999 % Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development % (URW)++,Copyright 1999 by (URW)++ Design & Development % See the file COPYING (GNU General Public License) for license conditions. % As a special exception, permission is granted to include this font % program in a Postscript or PDF file that consists of a document that % contains text to be displayed or printed using this font, regardless % of the conditions or license applying to the document itself. 12 dict begin /FontInfo 10 dict dup begin /version (1.05) readonly def /Notice ((URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General Public License) for license conditions. As a special exception, permission is granted to include this font program in a Postscript or PDF file that consists of a document that contains text to be displayed or printed using this font, regardless of the conditions or license applying to the document itself.) readonly def /Copyright (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development) readonly def /FullName (Nimbus Sans L Bold Italic) readonly def /FamilyName (Nimbus Sans L) readonly def /Weight (Bold) readonly def /ItalicAngle -12.0 def /isFixedPitch false def /UnderlinePosition -111 def /UnderlineThickness 69 def end readonly def /FontName /NimbusSanL-BoldItal def /PaintType 0 def /WMode 0 def /FontBBox {-177 -309 1107 953} readonly def /FontType 1 def /FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def /Encoding StandardEncoding def /UniqueID 5020910 def currentdict end currentfile eexec Տ `,i"[[5j5mTʻ^+݄fKitrޟm%9۩*++`[&NfA-O!J"|UY+; <Ԟ2?.P2QhnDtw=y0)n*[ Y]~ ΁RzYi[AXm>o/ᄃ_w[B[{'tG2̕>YxOe;i毊TE{jvm/@ɇ a9:ruKٴ\fFJkD@%Q{𴪣 ˭:J4iNa$Snz3=D>upUڻ[y;T)S{@HeQ,TiV#kbšV?%Yזgnqj"cYs=iXnc sh?:HO1R>႓i3=6vV7٩Tp aDUn5%#2:30<袓5RZ( Tۜ,S5aƷ<6H-3i  hA=uf6H ؘxbL-6nHo VYviz>RkGK4@FNJKGsi0{\ T%eh 7t QcBiٜQ,QjNZ1:RddnBA 7J. ERVsoٵb%vR{}8ߧvNHP։ck` gmȭ +O'3eJx0dtEr7v@$aR!@O>\7@?;5\ϛ̜22EK)9nK!*61V*ir IVn78XYQ#"jvcAc¬A[˃=#YZ!N`4/;`Ph/^  !@'*STckӘ+g[{Vk@.)wlx:+#DYC7AF$;v(}WYvkt$"kbM_QnMOqy8KDŽ䬼:J7L8\=;AIuI$"nj9 3Pc۬qxAђ0دy=Qv׺Ͻ95z!65= .O% "7@`F} ]v-iyɿ1[s3Mx?s;.?>.#?ybѼލܕjKxWQ`xWh(\pWn#xY+pnG[1'}R{1C!Jn#a^JkcKu6/ܛb0-+B{nz{bRv{nJym j\'* čA?YjQӫ=#ˡ,'@hfqy$Pd'GdvfAWO]%|шL@7#xݫu}@0 E9v**#.]'9nx/|%g)΋d B~Ѝև SHTd~q/IM"SάaenhЃM7;?71Վڶ ]>2K L>l=Bt =#9lԜ,$F~~aMu'j*Pr|7tf˽a?#~靦J@ aph.C>(E:P-sR=bJ8="_O_> UZ OZgYĈnHCʼBEE9O_B SZkU"32~z6==| ]BO@tl4-1iZkܬ9sP<@txFIi5ҍuh;t3Zd F}U&{8:}^_CG.*AB$eʹɱAayT" W g,M~`Ȝ peM#Tpx[:zE tr-:֯0.K}4,?{D飋gc]G{ 3JCH?B^6D}JTxsJXVc ΀8 #7>X{p3|VYa qCV_/8WdJ0U1jdQC-ǗaUàAvI>riYyIjIؾޗ_ ڇ$ڏ2ahMw/{%uJg%.? ^_=N$aMY^jLks`6e#i~4.zF֑TxUoFhp(kpr1%DF6>g#T>7F'-](|n]>H  y[mj ,^Ҧ*AOZ9UjTkڥնU ^dYG9-tnY/\cp?s47si#חjWVo9uZS:m s_J]E/?rXNiϘ}N7E?p2} 7Ma{r91tQQ\ҏٝ%}иMZ-m?T^{Mp7#d8!Et1 [1Fa`T Z|lhB.WBy3,ZZYa/^w|8Nef|̭_͞5t>?B Z7MiĞI/{y' g$R!}}ƻyr2F?~o.YId~h7-"i}YmrM7wv-oE6g OXr7Ri_Y&vAl$A C@|1i;vD J+q[ {F0B4U N@bDAZXP+Vp$+r'3i4y.M' a`O~DRX  Fҷ>L%IK#s~L#JFA=LA7n &5Kt&63qC>ǧMe"_^'^^B҉v2) 0L+`Vɡ1\Zm o/o / ;$=)|'rk(pbS_k,C~μlh`ɱ(Kn@GNݲR*Dg& ~[rR`q ;OF|jfl&A3qE#䖬kIeF '"{wTͼ DYe&J:􇲡U;df%4b?ťs-92*%nMeNJ? ҄%|Gam]2@'X)crع WB).Ç?K7KA1O/ gyDE3#zS ^0$,IhdݣG68=#Tj$v㦍cP+Ue?)~'\VY0lg+ NaßKzԧO"ԥMџ|T\]nY}IzЈul.R 4C KZhq`D&XAC&+QuưVP|=ݗҍœI#W/XaWl޾6J1Pt .1P3iގT5`#U|uv;fp#-ڇ˪υA&l+oO4.{Ř5Ubܗ8ja2/O fV8Y61MްHO7B\ԂLF?,I4\ɢʢD?ny8czɻåעbYj*ijv]dW$p[u~-ߧ1Ph/&"џ Whl_%3Km"P^޸|#]c$5Evg66!f0G[>ĐEF׺όj^ #+V &Wd (/Gɉ+* 7ZsE+rdy?>()_=A6 1Ҙ䬘K7 ",@3FFH\X"i6ݺEڊ6i;2ÑvIv /ϔ.{)UNӿaIQǼDf]D2(~ y\7 !ȃ1pyKXAG"<57=@~C(M'WYv~28T!3eb q۫.qU-$MO;,bF6i [gOu柗w]X}܌W#h>$υ\L,J'C8,ZېZRnN(p)jl=S7 -q6S9^;XRrQAz}^1kX ԠRMַA852P87!xda jBRdaRf`P ,BmR"E 7E`Q.Giޭܨl?#?ݴmcCA5^-;;+erbeYaFCJ=1\ x5־Og9D^I z;dꂽDE)aoP(\դɲ1v.stŻ68:)\E#W2Ɍlo)cɲXLI҇' (X.{ w줃^Wc0Ik]|VCJ+tfde-1 w}cvuP. d0uQ,t)ZHN7; 68mHbYqsy_ q6bc2WA<96^~>Q>`]a3}\ Sl)'okj߾j+H"ճsgrea*QPVӚay't}]'VDeMy>t-F6Ύay#Nf㘄~Z49Ƅ "J'Lt{k>¡z$G)m[`dW뼄ܓy8Z;I+.j'*mtAv&Vd>ܑ6TesBͽ⼮kAI~ ~ia1i6r- ~X,r2_6-S5[ma`òD{a- /6"?{Y _A8 ?)V+ŠЖ.059[w1Jڳ>z}Ԕj,04(r,;9TV4$d.ϐ/ ش e-j^MJL*P^?P2MRsRk+iO-]]pel=SZ͞T {~k/ F$u$:;vWT𻗱yxvNƒD~^U:}ݕu5 FMy}CK BBsq!9BMYj4mCvɳj|JzB\T-H55>N\%Ab_Kπϫ{YتUJũ+x-Fv은M6kn& diWu8+( >RދvSce!f+F|@$tFHH ;AdPfsd; ,FU6OCe\5q빣ndDԖ3hVSp8HS™+6hXfE//z81%N%gK|BNLJ#U->Ru ϒꐑnP86 K_>k0׃ / 7E ;.fUyʙ!<0ٰUmwrX!C )oYhsiju'zAh @9ۑg.Eb&fERCXつExW5LyO ݤKl@VmD 2aC;vդYvDVth7\Terw %Br ɴt>6>(ȫ/WdmH {~/j>߼]/N_̭n;鰨a9w-7F9RMycCŸE^$)rI^ Ĩ?,1ڨWx_te-]RtQY}RY^3bM%qݜ qRAdaHQ  Ŀ}ea iyp$֘ivsPr-}w0( ʋSq =gpIM̿Ɏ憴>ؽB#$|AqV}Vdc0#LGDĊZx#Yq>34 5VDL#{=^,. no*g2Eӷe+*4"/+"x\u!ia'(_\[GnWyuEH6΁SN7p8F+ [AǤ" f fl<>")0& 9zùKi-mJ5z~[;81M7}q|4#e?&kb\rab Ce,* d, ֗|STBJQ Ve57?k%,6+5A"}M7a-Sla9t_経$W%|3f f${1_r].b R.|L^>͕^G-XmWms.͋?|(g*Udv':L#OV^?CZձL8('"Kצߔ#RȌNG(]FCA~0ƍ^2twd=UCEঀ{P=0.Clq~ah渄Ɗ0XɔĹm@CNLe:O&2. 7F4Ɯ  -J{|^}DAa4+O d|TJv`\MTsx3ph6W*^ #+<횆AMK$5ry踳PY|QFqOXg(*ՎUt660<@Wr|.V:rSR:xK^cmh,5qY7 IH8^CFRm lR-:3Pu`1#l_;/q+:ӓ0~@"G#<|+qcCӋK eO.3otoxS0{?l#Z+ԉ}7|kowhBe?k> >c 'D6 yM^n|O<^O] C`# @+7ogx2q UFpa\b86cYL۵N8Rf@v+<{Wt|[x#?ٔ(X?P@EuA/.Q<,dʹge>qWcL\'Kx&OY&h!7Id̀ٔIN[xݰDYME9suGGZy 4=|Kͽ"==%ؘ U\W@CJ~|krV43Uy"l-{Cz|ݦTwŝOF2V5S{'&!X4vr>Ɉ4a_Kf6f<'p*{CfLOh=37D8(:f \1"Oʈ l5fu-ɇ-[s )~T6xul%u"c$9 鬌^" S?XhJj|2܃%0Ǧ٩V.HSxSN·p6eIA;h^јG8۸LڬM{eoz|JM{[ы&R;Ŋxo6"Z2Vg"6Q*aN%C>.tk1d:m K0IZݕl{+QlhAñݶ`BtO  f/zM&.s(&Z0yf\Qp$/S2~ OBvI-~Q{J,=$MjQWGzri,c]9$oT#OlĹpEB<]# o愳taMt({<W)?ʫ"]U.MK71eb] #2} C+v#l6N{,/0 }~ILd/^Hl^jZ?5-H6z~'6"̚+]h_&apL x[Ɣ0Qq*k7]9sBYnD4lYl{5шE1 GS2[zeϾc 9Qgrʛ:c0Rmf5Gwݬ-!yWcO B,8[!f̂?$ybۏ$&;1XkELq5z1umg$"wZLaĢvVK4K _*H}fBΔCmfyu*utNf\5bts >v< QBI.(qJ)•3P1?[5%@ IFǺI(~NCkX6I pEvn\8hfJ{u8liY_J7+$J:,(6u{M9Mgeyx0f̨pE;/& & }WZ }pC>+e0I;ϭb p;"iЄCZ!Ǝ9XeX{4]@ǿsɓe.@Aoռo8sH}I#OzǬ+A-RZމKzp앻b`&e:nGGY™]޵9 ҃>nSS~AR jև0k֕7Thz,5kN DkU1;wЉ12Vs~K=D`w0Xy&1yqHNm䆟{$m&-43} xn.]60@oˊƵ%X1y[9? äU,~A'IV2joڲk=e^ +Pֈa_Of(ܭ E(}EyH˸-p;o_Ճ*L݅4=cᆚq`F: }019t1CqqUeOa}11&3ہt(FyM tYZOO\ruء[!%i5:i>᝔BqwAbP9s[J 1tF~juMWNW~fHcB"E()>NxfPȧu?`dz:fH$tDc1oq\1_.Z2730:}b)>93$߂uC~Nf9#hjه.MgD>B߄*`0=2gv^G {ȃ2SBWHn:âtO8zXe¢PʮJF[e`J˅|ε17):}x  :7RagDȜ);gY }Рikf 1MxP]u6&ffL wɂL/X2'dtvWxk!;Zg#\}盡 œ:Jl^kZRlQSr PK)?zTZbo|m}EF;;4\v3ʶd_@~b}Q*,LhΊ:U,QrȮ3ꗼ<2^2n' De%UbŰBTİ2,f&yֶ\a[4\IV 8]귶Vq׼E"^gViJ@L9#D+= SPF0^NaM{ӭ%nj*)YZlRYP&YkF1fz/T;(X~#/?&(e+^@ӆNt:jmPGd >HxAj!OFJY1rc2p*u9hZ@);?gnWzMj&8-K+|P,ZXJ==B:K$0ف7vYQ0Sw 1)'7|IR5yC--;R* 8 DT|IQ;GK#8*U\8{<0-ROA'1_.G{3w.n2Jw !>\_?`h:'k~TN#ݝ-clEaMZ0eYT}(s#UOT X޶i;s(eM-Piu؏1C|PV6{iE7xQdO0E?~ׅWٰ 0Sפf$55^`HFǻ0/;m/N$4H#K.>+;))~҈sܑ!]?ʍsge'H&ٜ!Pq+zUn=漁|g^t7š$%ͅم{LSaG&̃WOiDl!nPER\bY.}Sُ(K_~pMq᷐vɖo⪦*zO5di'DFՓom ՞M7vLNx#5ı`1D>*$4E'%y:Qo+";Sl§FJ;$J& Cx4eooxj=,@3fRui.$S6 ,C#vI?| $IF&,PKfN c6C'j)^|}~xk|4pnd$"X]aFJ[voiz4G^QSJ;֟*xs~XME^-'rzlEnkϜn|enxa,P˓m,7:~7J?(Iߛ (OGmxŽ`s1ˎٗlq[2eQ8"fز{=?z(uYR]5f:ZLWqB2k7WCqh|uNXH99kBY8dǬb(F79܍X&\H{B%fx Kz8-υʺҷJrDF^O$d z'$ n>T~AsF+8=5:>4LϻSed!bfћw0XqZ- "P}U6`Y>-O;e<~yBR܁KBOW&vjiAց?7gvmH:>9 m+CՂӌ`9_ʮ-CJfWE N;B #weI[W96< aHu 4i'jHĉetz/$xD#C:zv=-:qD>P^̟kMsQ^0ad'BZ hɘRA7Q%dtMdvtwtYQE\Y'GRЭT`e)ӕ= M%'m)a9T^x Ԙo&0Iܡ/ڙn@H#p*i){Zi}_ |" u4L+F*c1S##̽s"-eŒ ]~ŃSbEn[&:釬K2v(Z(4)cTɿxXRYEEaPLENy :;uuCvbHHL'uTKHt21 BeaDITN,Cȹ` ~έ0: 8mΉ1;KC2녡 3O3$}Bl H0={fWծ!%8_z VHG"UDsRAh؜"ܬ9sP<ݒ6)_5M7wZQ ?yJ;]Gt+̈!@Lcꠢ| &AJ ^Eh6)领!OTɂ2HS쿽N[KF=ӿ#Ş$;֘⵨S3<%,3]%so$M.Io*n0o kP~"ViMʰ5ѐmO^LNp)ֻ;: ֌2i:o7!&̒@,/8TaJ}G̭BgS$4FUBǏp#RWc\rTO X׷$NfA'U(1p寖,<׮&HFfȜ"P'sӭ7)vFiI1)v C[WN=??S@]2Rn6="~f4?a5ֲ'Ux@K:OY‘T W`H _`tEÞԒ ʎtCu WW+(I1Ȉ }K"Wj_MѰ]ƭ908̓c\0 6O ]p3>hl3XrDjOF&D*"D; D7/mU~ %Bܨeq12GPE|UHZhY&ŶWtgOLV<&鈼QC=n UܣZE(>5͐Ys)YAfl19ZƗ2sK={qSOېq-abR@3ܫ0'lytZAU/b3;o R_I;Xn)YG=qX jX:j41R53um=ߦz>AT̢R~j>@oS\scO ~q|KBØU6V y4Z]~JV<|fN-Y{懽0B\A\s2v7L ]GD fsv,Ԍ;x;z}L%ɎS&ĔOg)2;UjeBqm׺/<ŒbrKCMlWVNNqdAGO^G 6T Ɉ㽴RٸvP3i7?3t{VV; 2\nG62OJF Sp_h5ҜS;-˵3(Jr)~p\Hd}{eW-Y +O3 ~޷U>Ciidvbk!q" C(ȖĻAXBoK jH=_Xu51!dQtradani[@/Qb ԇXz"NCs!ɛOѭkųր^ܢo7ʶx=hfՀ$W1G6"[t'I(m!xG}3qpj{))熔>C]2t5S_^Dϲ& S2秄Z)79G $ʲqKJ8NG jxރik}%"?iZ4~^_2͵6InCC2JgV}-df2LŇW'cbXQQ*#BhG)Wh,J|M>V[𣠒~Ξ׷0,d쭌E;W&Az@ϊOPeI&lMLKiSaT;CYR~Ӌzc4>Z`yC-E(n%oa1*:|x|s^CTYNB,>k;yW~&.!Zg{A-9c(kiIC38 NT?>v6oNœ\\lHc\6cyG旘>OF>+ j緮v7mp⣛WdH ߗ<'b4V DIO,NK@5q/ HV>>=}A_A n%kX]٩iq 1BdJIqfa\1+px_aΙ+,B?aGXHiB)+?/Ջ Wg_c7i 64aVzGo28-1KuMg`[fD#jDG EhLcu7^w=?φw&J4 E9%^E'p^$.D[VuZ(Y%Hvx2#y3s V.xzqKီ Ky ّeC 8l{3{ԋ =&gh&5*X ~p-2rj F*tЛ7ܡU0EM\~+ļ̅ęiwLdass d$/;mml˗3@DOUD )}9^Fl9N(n^J|+p1/ش-w<;GoNv'vXj$EZ]0@%c-|Ih}secn\uzc?طof>q16!T"E| syj 昻}U5GNW*UJe w]Z"듃^lB?7mv pm cupg)θbO(gFXZ-#pO q!撃ݏ`;oS%Rgh] tIju3}# %<|&@a.FOSRnx.kD5 ƒ(r>cEY7؆D Sؖ}A: n.ZrmH/LIvUIxKY;BPڥ5v\['HTt?ǜ#Cw^Y/$!+2p,|-9)1 }oKl$8#" .(̶Y/2Vsڍ ;M7;%A% =X=tW* M5ο};ckA%_H3XZi\寲6TQ+H7Ue90m"UAM5i[ܐx K=3{DHA|`Zwhe~L#tZnDg~tK-{NJT= R V͙%ٞ!]:- ȡɓa>| !੆,sF nZ؝{T%Wt]-__ߦVw^};z?+Qx ز_8KI]g ]?MnBU=ׂ:|ά]&1ݝKU0WsK9ӻ 9)\;MGKi/kp |]5w' `,ɿ( kZ;;l^̈́osnT*ױ;|U?7~&Ì@tgxRVZ+e%ݔ^LcǜV+z9RRJGquF=km4Ei:97e.q 1$J#hq!5Xj9Pr9PE EcΥxlx ApRh9In~}oU+>sc0ۀ4{ճD931A(v\fhΦLb?ef\S]S"l#E'GL }gK| !"0׭.o"R,7ķ5#tAV :`D0 a1'#1L@r!#^]>/W ]&|}- wM\`?P9+H3-B~@ _[ cHMSWVFX-s&W-xYiwi9wD(ׂ甕S/V{z1  ȒgƉI x#qvV½*U{?lp8r.x=0s3Ƀ#sJS &ʥ9Rn-x"4g_boG wA<$wq0D>-2%+./Ta<l ۝ZU2[p 8dg1v5!C.X_Ϸ5p0B|>@6R'M=;T&+Ő3Eg-)/I!Dϐib.^ 9^)+ m^Էgzw9wmFShN\ fV*܉iaz:|xK'iE1&_%璥[. o;vlk}6ߍWoG/JfRNaͮp:3164$;8УZ UyE ֋SJ (Tk]yݮwxJFUsפ}(14K%'M89!է8ezg:*<0_*:?Zuȸ4%HBg[Tws=Z;Wb ѳ6Ի0)iRLfoѸ'8ab&FtyVg`Dj X܋Pw ܜ% !n>Q \F1Vsgaۅ6//e_>h`qCXɸfV5=YRPmծgE`H[$+ !i|>SWp?;c{ŖM2 SH{8jvHˎ`q-V"4ILT4CT /Pm/6. z8ɃJ_HiqvhR~JC֪rhe'Yr^ 3"QGWs˜Eb(V! ̛%5&_~Gh&`1&HU[VNSp=G:?we=ָ۸ukXgLk*#ea9šO#twwU{GM%3G#g~><}Q^:LWgGn$+~LW"a{O>; -KuJF%aE}Os2'FHrB~DPCo:dG6#nUXIt՞;}z:LmNXmk&aar< bU#dV3cM%M鱗Y (xH52f ]'{t_ݗ"Bz**rx%>>99k%RjS3+Ro (9Q"(ifSo#9 ߂˹w[oeYj|Wj;wP[W,DZŝ`rJnP3VjQ9HEto7gr{ѕiey[g_V_oG*-BPFf"3!%0wtEɞpXt"Fz= \ogbߕfEkWOŒmKy. {Rn5PL F\4ZYJ=n|Ќ- =c>4aĝNIZ6ZqcL2E+7L꣓]8r1GG{1/D[JN4w{`0LqFJWI΃xX~Q,H1q|Eä_~`xLHھ,|;ck,v*cvA#cKO:|eC{~@ʵN ̣ 5 [G]!wu$Hhz/l./k}F2P?ttw4U  lT4_|`V7Xt&EWEB{{PTJ.WM6)gX-nZD8˾&vSySgD>@̅P`w)rTe^ayܭ0bu v ヹ<3"|%ԣ-.8ieőH[*jJAcFÒڡc2u}ǛP8?Ωb9r+s:֡>+Ev<ȅ6h,uF ɇ>c2œvysMܣzKmap!2,S}`jyT,"0)9#S pFUf65VFVsO'À]x[B)tW "X+ϓ>~S1M!ye%Ѣ9 =o xu{{0'S\̌UUeRG ?Ķ z_F:$ B !,}FU.ɕUFv|]nw{X>HĒZ6T\SP䉒 MǛ7=7 /IJO`~ɧK]V,M2|"tl\nFw݇4BJJh-l 3m}]=pMNڬ5!RKn5Em7"N,a4!kƊ$D`aWpQV#dx-pOWZ=k Edc^<橚"v:4[bk:Қ3*sQE_gBce'Rʝ'6lFzϚvdیx Kf_G/M$P1[m tH ;X2s0 oyֹvӆx:٩4JfdANVoחEZ'r78jH YTzP)8XXJUVgEV4g hfԗ3=8U~{ ^'L_$OR TMr~9}=hxe%v5Ua5.QNa<,\Aczn,+z(тɶGa9r_[ltw{85FO?]$;쟝žy0i ؟79#bGYR US{ڶQN^ϢaYPJ.EJ78am%Bw ,hH:H3voB4Edpͭ5|j Xɋ&I%^F0BqҒZWޑ nFXiQh3+!wT]g |oy˰G:k@ ڮjqWzX18w)Op(x0ÉͷRˌ-;MU0EcfO(H3;]pC0aP~g@J Q!1=h ~\&YQۖ@ JҹuPd,]  A4D6~xS_+e&/YQv^J2 n6=0nkux ;X |) 0ʜr0cA uY# -9EPeF `,u#ͮi|~`lut]{> yun;V,2s/;G's-vo~ ">r0+w Ov8kjW߈"ǡPۧԡ WdnT CTtaA6+k 'щ W$)D'˻^6A sQI PMFx9Vt0NBU=t ;' Pe)T)qʂ=ˡ/Q c"k(7V/\6Uk9G3rR`("MC bW`E b+7 Q/.nM?2t ` &yzVwl΀Wn= x[ƖB #P$#iK뇫A%gK"Z{ePΑG1&D2O`eEG%s2CͤiVpKN6/\9ŽIhsW{ҕu8))?-ԴG[xd`B?80ӡZ_wxiOC<Mw~5} cw}J 24[p |Z"͋`Vt'SYXH"-CapfnjB N'aV&)6m7T-%C,V`!~?P&uYhaA{>ٝmB"V&F!1|zd6$za㭀7.d9vMxqO?z Z)ڲzrO5ȝAd{ǐSӽBFB{$KQcßʑ]5h8W~Kq2| jr!b1sϤ{3wފ'9Vܲr\]`7B{ WJ w`ҊEh=S6zx:z_)M1M&B-Y>ɫ}os&|@$`@sUKЋEgʩ.& "u  RR<+ɚ慟Jb]mb<qiP1NRU*m*; } ?RX8In!6zIٛaYr/e-ȇX9``9B7w5" m0#RYqH 7Qh\^O)Ż ?RoЏ*Y >T4lUK訬/ɛ|8;zITP*y{pjn qi-&^=E!뼏&>W@ <`pAC9 Tւ\1P;PٙlЕUdf PppE@cJ3ނ'Z A=Ww沟Qy~dbo%~ n.3;J9QU[+x;V1eߩ\f%5t&w8;xUK7Y] Wqtǐ:t0S8fm Qۧz-<4q'  g Ay'Ys̀lC.m}w ; t[U rLx`Շ <72,͟ʕt^AMM-"E\`qMn=;I=`ɐD(p'}.;VMfm7 NB /V';t`T_gCӑ%VH$Z!8"p ~-%- `tRʫoHK6?{V&UK3t"¾ ;q[qS9x4oKz+$#P+pYL0 ~Z|!:$6|ZE}P;l+g|f-3/TbJAfR?)~c0gTG5.jв+jCf,|f̒x/ C%FvߣJq$1w8,]PĖ3n<@*zII[Ѷwdrll.NoZG@ @)Z;]kZ $^m%jhO<͞Z1ÏY8N莶5i=FaJ2HRH@6M~*Wj,wI$NZMF<~EApJod0:!#NAPЁCp݂di' =C%G-C&lk~ _>O?R#:Nߚ3EQp> Ng$o8zHyuSE X7!9lv 2V63ލxvPywsɽ8l E|l&@\H_-Ռ27 cItɯσ&Ǟ: Ф ]F9b_/ݒmAPMX0󃻚5]S`!_?p04D80p~6•|TK* _A4M\t-bMPLIw_M Y$)KC asJi{$h))(x i;0)b~ mfJ[Ab}?.9QĊ|A]˾b 䲌Ej]mqrHø϶1^;X SNX51Ӗ(nz_e[!a>3:t^YUn=K@U[ocnc=ᑘӨg `'49ua5u_cpH>RY[,C RBꙊBcd:/볁Zc$e2l:itAPu}sr|('ا-YHo 1YóH"\ VdqoF֎29 k(T_^)?lthN+GdW T_Ė. tlcу@k5gtw{jf R6P2+fثN-N׳}s^IumczcvyËL!Q /4{$nIK:*%OUL3ͱWwnO/ l6;lfVTi}z>繲u@%Ǻh.c) d_IE\%,kbG.ğE&Ǔa0sz?dD@QӉWU VpHŸ ye2f0ߪ`rנ@gqKݬ_1 .ڠ$) 'h)$A|-,f+W!ʣxn<6R00000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019024l.pfm000066400000000000000000000111131404163720200220760ustar00rootroot00000000000000KCopyright 1999 URW Software. See file COPYING for license.op ,,8 u,xLELEE1EPostScriptNimbusSanLNimbusSanL-BoldItalM,,yMMHM,,,,,,,,,,MMHHHcc ,cA  ccMMH,M,c,c,Mcc,ycccc,Mc, ,,H^^^,,,MM^^^^^,M,M^^^M,,,,,Mr,H^^^HMc,^Mm,c     H c,,,,,,y,,,,,cccccccHccccc,c,1,7,A, F,N,P,T,U,V,W,Y,k,r,v,w,y,,, , , , , , ,,A-F-K-L-P-R- T-V-W-X-Y-k-r-v-w-y----1.7.A. F.N.P.T.U.V.W.Y.k.r.v.w.y... . . . . . ..10,1.101112131415161718191127213730414243444546474849415751676071727374757677787971878197:T:V:W:Y:r:t:v:w:y:T;V;W;Y;r;t;v;w;y;-ABACADAFAGAJALANAOAPASATAUAVAWAYAAAAAAAAAAAAAAAAACKCLCNCRCTCVCWCXCYCCCCCCCAGKGLGNGRGTGVGWGYGGGGGGGCHDJFJPJTJCKAOBOCOFOKOLONOROTOVOWOXOYOOOOOOOAQXQQQQQQQKSLSTSVSWSYStS-TATDTGTKTLTOTRTSTVT WTYTiTnToTTTTTTTTTTTTTTTTTTAULURUUUUUUU-VAVBVDVGVLVOVRVSVTV VVVVVVVVVVVVVVVVV-WAWBWDWGWLWOWRWSWTWWWW W WWWWWWWWWWDXOXX-YAYBYDYGYLYOYRYSYTYYYYYYYYYYYYYYYYYYAaFaKaNaPaRaTaVaWaXaYafagakaratavawaxayaaaaAbbbbbAcTcqcrcvcwcxcyccccAdrdddddAeFeKeNe PeReTeVeWeXeYefegekeretevewexeyeeeffrfAgTgVgWgYgkgrgvgwgyggggchrhthFiTiViWiYifiriFjTjajfjijrjckrkflglrlvlwlylUmrmmmUnrnnnAoFoKoNoPoRoToVoWoXoYofokorotovowoxoyoooooUpYpmpnprpppAqrqxqqqqFrTrUrVrWrgrrrrrrTsfsksrsvswsyssAtStetftotptrtstttttttAuFuKuLuNuRuTuVuWuXuYukuquruuuuAvTvYvZvavbvevlvmvnvovrv vvvvvvvvvvvvvvAwTwawbwewmwnwowrwwwwwwwwwwwwwwwexoxrxxAyKyLyRyTyVyWyXyZyaybyeyhylymynyoypyryyyyyyyyyyyyyyyrzATVWYċŋBKRT,.ALqaefhnorstuĒŒ,.ALmĔŔFPRfrATVWYīūDFGTVWY-BCDFGLNOPSTUVWYBDF¼GT£UVµWY¥BDFüGTãUVõWYå-BCDFļGJLNOPĹSTģUVĵWYĥĴİĸĸ-BCDFżGJLNOPŹSTţUVŵWYťŴŰŸŸ-BCGJL NOPSTƫUVƿWYƯƻƸALNRBLTVWYBCKLNRTVWYBLTVWYLTVWYABCFKLNRTVWXYBTVWYAAAALRrvwyFNPRfkrtvwyrvwyvwyFKNPRfgkrtvwyFKNPRfgkrtvwyFKNPRTVWYfgkrtvwyArrvwyFN PRfgkrtvwxyrvwyrvwyFKNPRfgkrtvwyrFKNPRfgkrtvwyFNPTVWYfrvwyRKLNRkgnustep-back-0.29.0/Fonts/Helvetica.nfont/n019043l.afm000066400000000000000000000756621404163720200221030ustar00rootroot00000000000000StartFontMetrics 3.0 Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development Comment Creation Date: 12/22/1999 Comment See the file COPYING (GNU General Public License) for license conditions. FontName NimbusSanL-ReguCond FullName Nimbus Sans L Regular Condensed FamilyName Nimbus Sans L Weight Regular ItalicAngle 0.0 IsFixedPitch false UnderlinePosition -100 UnderlineThickness 50 Version 1.05 Notice (URW)++,Copyright 1999 by (URW)++ Design & Development EncodingScheme AdobeStandardEncoding FontBBox -136 -282 820 951 CapHeight 718 XHeight 523 Descender -207 Ascender 718 StartCharMetrics 316 C 32 ; WX 228 ; N space ; B 21 0 21 0 ; C 33 ; WX 228 ; N exclam ; B 74 0 153 718 ; C 34 ; WX 291 ; N quotedbl ; B 57 463 234 718 ; C 35 ; WX 456 ; N numbersign ; B 23 0 434 688 ; C 36 ; WX 456 ; N dollar ; B 26 -115 427 775 ; C 37 ; WX 729 ; N percent ; B 32 -19 697 703 ; C 38 ; WX 547 ; N ampersand ; B 36 -15 529 718 ; C 39 ; WX 182 ; N quoteright ; B 43 462 129 718 ; C 40 ; WX 273 ; N parenleft ; B 56 -207 245 733 ; C 41 ; WX 273 ; N parenright ; B 28 -207 217 733 ; C 42 ; WX 319 ; N asterisk ; B 32 431 286 718 ; C 43 ; WX 479 ; N plus ; B 32 0 447 505 ; C 44 ; WX 228 ; N comma ; B 71 -147 157 107 ; C 45 ; WX 273 ; N hyphen ; B 36 232 237 322 ; C 46 ; WX 228 ; N period ; B 71 0 157 107 ; C 47 ; WX 228 ; N slash ; B -14 -19 242 737 ; C 48 ; WX 456 ; N zero ; B 30 -19 426 703 ; C 49 ; WX 456 ; N one ; B 83 0 294 703 ; C 50 ; WX 456 ; N two ; B 21 0 416 703 ; C 51 ; WX 456 ; N three ; B 28 -19 428 703 ; C 52 ; WX 456 ; N four ; B 20 0 429 703 ; C 53 ; WX 456 ; N five ; B 26 -19 421 688 ; C 54 ; WX 456 ; N six ; B 31 -19 425 703 ; C 55 ; WX 456 ; N seven ; B 30 0 429 688 ; C 56 ; WX 456 ; N eight ; B 31 -19 424 703 ; C 57 ; WX 456 ; N nine ; B 34 -19 421 703 ; C 58 ; WX 228 ; N colon ; B 71 0 157 516 ; C 59 ; WX 228 ; N semicolon ; B 71 -147 157 516 ; C 60 ; WX 479 ; N less ; B 39 10 440 496 ; C 61 ; WX 479 ; N equal ; B 32 115 447 390 ; C 62 ; WX 479 ; N greater ; B 39 10 440 496 ; C 63 ; WX 456 ; N question ; B 46 0 403 727 ; C 64 ; WX 832 ; N at ; B 121 -19 712 737 ; C 65 ; WX 547 ; N A ; B 11 0 536 718 ; C 66 ; WX 547 ; N B ; B 61 0 514 718 ; C 67 ; WX 592 ; N C ; B 36 -19 558 737 ; C 68 ; WX 592 ; N D ; B 66 0 553 718 ; C 69 ; WX 547 ; N E ; B 71 0 505 718 ; C 70 ; WX 501 ; N F ; B 71 0 478 718 ; C 71 ; WX 638 ; N G ; B 39 -19 577 737 ; C 72 ; WX 592 ; N H ; B 63 0 530 718 ; C 73 ; WX 228 ; N I ; B 75 0 154 718 ; C 74 ; WX 410 ; N J ; B 14 -19 351 718 ; C 75 ; WX 547 ; N K ; B 62 0 544 718 ; C 76 ; WX 456 ; N L ; B 62 0 440 718 ; C 77 ; WX 683 ; N M ; B 60 0 624 718 ; C 78 ; WX 592 ; N N ; B 62 0 530 718 ; C 79 ; WX 638 ; N O ; B 32 -19 606 737 ; C 80 ; WX 547 ; N P ; B 71 0 510 718 ; C 81 ; WX 638 ; N Q ; B 32 -56 606 737 ; C 82 ; WX 592 ; N R ; B 72 0 561 718 ; C 83 ; WX 547 ; N S ; B 40 -19 508 737 ; C 84 ; WX 501 ; N T ; B 11 0 490 718 ; C 85 ; WX 592 ; N U ; B 65 -19 528 718 ; C 86 ; WX 547 ; N V ; B 16 0 531 718 ; C 87 ; WX 774 ; N W ; B 13 0 761 718 ; C 88 ; WX 547 ; N X ; B 16 0 531 718 ; C 89 ; WX 547 ; N Y ; B 11 0 535 718 ; C 90 ; WX 501 ; N Z ; B 19 0 482 718 ; C 91 ; WX 228 ; N bracketleft ; B 52 -196 205 722 ; C 92 ; WX 228 ; N backslash ; B -14 -19 242 737 ; C 93 ; WX 228 ; N bracketright ; B 23 -196 176 722 ; C 94 ; WX 385 ; N asciicircum ; B -11 264 396 688 ; C 95 ; WX 456 ; N underscore ; B 0 -125 456 -75 ; C 96 ; WX 182 ; N quoteleft ; B 53 469 139 725 ; C 97 ; WX 456 ; N a ; B 30 -15 435 538 ; C 98 ; WX 456 ; N b ; B 48 -15 424 718 ; C 99 ; WX 410 ; N c ; B 25 -15 391 538 ; C 100 ; WX 456 ; N d ; B 29 -15 409 718 ; C 101 ; WX 456 ; N e ; B 33 -15 423 538 ; C 102 ; WX 228 ; N f ; B 11 0 215 728 ; C 103 ; WX 456 ; N g ; B 33 -220 409 538 ; C 104 ; WX 456 ; N h ; B 53 0 403 718 ; C 105 ; WX 182 ; N i ; B 55 0 127 718 ; C 106 ; WX 182 ; N j ; B -13 -210 127 718 ; C 107 ; WX 410 ; N k ; B 55 0 411 718 ; C 108 ; WX 182 ; N l ; B 55 0 127 718 ; C 109 ; WX 683 ; N m ; B 53 0 631 538 ; C 110 ; WX 456 ; N n ; B 53 0 403 538 ; C 111 ; WX 456 ; N o ; B 29 -14 427 538 ; C 112 ; WX 456 ; N p ; B 48 -207 424 538 ; C 113 ; WX 456 ; N q ; B 29 -207 405 538 ; C 114 ; WX 273 ; N r ; B 63 0 272 538 ; C 115 ; WX 410 ; N s ; B 26 -15 380 538 ; C 116 ; WX 228 ; N t ; B 11 -7 211 669 ; C 117 ; WX 456 ; N u ; B 56 -15 401 523 ; C 118 ; WX 410 ; N v ; B 7 0 403 523 ; C 119 ; WX 592 ; N w ; B 11 0 581 523 ; C 120 ; WX 410 ; N x ; B 9 0 402 523 ; C 121 ; WX 410 ; N y ; B 9 -214 401 523 ; C 122 ; WX 410 ; N z ; B 25 0 385 523 ; C 123 ; WX 274 ; N braceleft ; B 34 -196 239 722 ; C 124 ; WX 213 ; N bar ; B 77 -19 137 737 ; C 125 ; WX 274 ; N braceright ; B 34 -196 239 722 ; C 126 ; WX 479 ; N asciitilde ; B 50 181 429 322 ; C 161 ; WX 273 ; N exclamdown ; B 97 -195 176 523 ; C 162 ; WX 456 ; N cent ; B 42 -115 421 623 ; C 163 ; WX 456 ; N sterling ; B 27 -16 442 718 ; C 164 ; WX 137 ; N fraction ; B -136 -19 273 703 ; C 165 ; WX 456 ; N yen ; B 2 0 453 688 ; C 166 ; WX 456 ; N florin ; B -9 -207 411 737 ; C 167 ; WX 456 ; N section ; B 35 -191 420 737 ; C 168 ; WX 456 ; N currency ; B 23 99 433 603 ; C 169 ; WX 157 ; N quotesingle ; B 48 463 108 718 ; C 170 ; WX 273 ; N quotedblleft ; B 31 469 252 725 ; C 171 ; WX 456 ; N guillemotleft ; B 80 108 376 446 ; C 172 ; WX 273 ; N guilsinglleft ; B 72 108 201 446 ; C 173 ; WX 273 ; N guilsinglright ; B 72 108 201 446 ; C 174 ; WX 410 ; N fi ; B 11 0 356 728 ; C 175 ; WX 410 ; N fl ; B 11 0 354 728 ; C 177 ; WX 456 ; N endash ; B 0 240 456 313 ; C 178 ; WX 456 ; N dagger ; B 35 -159 421 718 ; C 179 ; WX 456 ; N daggerdbl ; B 35 -159 421 718 ; C 180 ; WX 228 ; N periodcentered ; B 63 190 166 315 ; C 182 ; WX 440 ; N paragraph ; B 15 -173 408 718 ; C 183 ; WX 287 ; N bullet ; B 15 202 273 517 ; C 184 ; WX 182 ; N quotesinglbase ; B 43 -149 129 107 ; C 185 ; WX 273 ; N quotedblbase ; B 21 -149 242 107 ; C 186 ; WX 273 ; N quotedblright ; B 21 462 242 718 ; C 187 ; WX 456 ; N guillemotright ; B 80 108 376 446 ; C 188 ; WX 820 ; N ellipsis ; B 94 0 726 107 ; C 189 ; WX 820 ; N perthousand ; B 6 -19 815 703 ; C 191 ; WX 501 ; N questiondown ; B 75 -201 432 525 ; C 193 ; WX 273 ; N grave ; B 11 593 173 734 ; C 194 ; WX 273 ; N acute ; B 100 593 262 734 ; C 195 ; WX 273 ; N circumflex ; B 17 593 256 734 ; C 196 ; WX 273 ; N tilde ; B -3 606 276 722 ; C 197 ; WX 273 ; N macron ; B 8 627 265 684 ; C 198 ; WX 273 ; N breve ; B 11 595 263 731 ; C 199 ; WX 273 ; N dotaccent ; B 99 604 174 706 ; C 200 ; WX 273 ; N dieresis ; B 33 604 240 706 ; C 202 ; WX 273 ; N ring ; B 61 572 212 756 ; C 203 ; WX 273 ; N cedilla ; B 37 -225 212 0 ; C 205 ; WX 273 ; N hungarumlaut ; B 25 593 335 734 ; C 206 ; WX 273 ; N ogonek ; B 60 -225 235 0 ; C 207 ; WX 273 ; N caron ; B 17 593 256 734 ; C 208 ; WX 820 ; N emdash ; B 0 240 820 313 ; C 225 ; WX 820 ; N AE ; B 7 0 780 718 ; C 227 ; WX 303 ; N ordfeminine ; B 20 304 284 737 ; C 232 ; WX 456 ; N Lslash ; B -16 0 440 718 ; C 233 ; WX 638 ; N Oslash ; B 32 -19 607 737 ; C 234 ; WX 820 ; N OE ; B 30 -19 791 737 ; C 235 ; WX 299 ; N ordmasculine ; B 20 304 280 737 ; C 241 ; WX 729 ; N ae ; B 30 -15 695 538 ; C 245 ; WX 228 ; N dotlessi ; B 78 0 150 523 ; C 248 ; WX 182 ; N lslash ; B -16 0 198 718 ; C 249 ; WX 501 ; N oslash ; B 23 -22 440 545 ; C 250 ; WX 774 ; N oe ; B 29 -15 740 538 ; C 251 ; WX 501 ; N germandbls ; B 55 -15 468 728 ; C -1 ; WX 592 ; N Udieresis ; B 65 -19 528 901 ; C -1 ; WX 592 ; N Uacute ; B 65 -19 528 929 ; C -1 ; WX 547 ; N Scedilla ; B 35 -225 508 737 ; C -1 ; WX 501 ; N Tcaron ; B 11 0 490 929 ; C -1 ; WX 547 ; N Scaron ; B 40 -19 508 929 ; C -1 ; WX 592 ; N Rcaron ; B 72 0 561 929 ; C -1 ; WX 592 ; N Racute ; B 72 0 561 903 ; C -1 ; WX 547 ; N Sacute ; B 40 -19 508 903 ; C -1 ; WX 638 ; N Otilde ; B 32 -19 606 917 ; C -1 ; WX 456 ; N ucircumflex ; B 56 -15 401 734 ; C -1 ; WX 638 ; N Ohungarumlaut ; B 32 -19 606 929 ; C -1 ; WX 592 ; N Uhungarumlaut ; B 65 -19 528 929 ; C -1 ; WX 547 ; N Yacute ; B 11 0 535 929 ; C -1 ; WX 592 ; N Eth ; B 0 0 553 718 ; C -1 ; WX 592 ; N Dcroat ; B 0 0 553 718 ; C -1 ; WX 501 ; N Zacute ; B 19 0 482 903 ; C -1 ; WX 592 ; N Uring ; B 65 -19 528 951 ; C -1 ; WX 456 ; N gbreve ; B 33 -220 409 731 ; C -1 ; WX 456 ; N eogonek ; B 33 -225 423 538 ; C -1 ; WX 456 ; N edotaccent ; B 33 -15 423 706 ; C -1 ; WX 456 ; N ecaron ; B 33 -15 423 734 ; C -1 ; WX 592 ; N Ugrave ; B 65 -19 528 929 ; C -1 ; WX 547 ; N Thorn ; B 71 0 510 718 ; C -1 ; WX 456 ; N eacute ; B 33 -15 423 734 ; C -1 ; WX 456 ; N edieresis ; B 33 -15 423 706 ; C -1 ; WX 496 ; N dcaron ; B 29 -15 516 718 ; C -1 ; WX 410 ; N ccedilla ; B 25 -225 391 538 ; C -1 ; WX 410 ; N ccaron ; B 25 -15 391 734 ; C -1 ; WX 410 ; N cacute ; B 25 -15 391 734 ; C -1 ; WX 456 ; N aogonek ; B 30 -225 466 538 ; C -1 ; WX 456 ; N aring ; B 30 -15 435 769 ; C -1 ; WX 456 ; N atilde ; B 30 -15 435 722 ; C -1 ; WX 456 ; N abreve ; B 30 -15 435 731 ; C -1 ; WX 456 ; N egrave ; B 33 -15 423 734 ; C -1 ; WX 456 ; N agrave ; B 30 -15 435 734 ; C -1 ; WX 456 ; N aacute ; B 30 -15 435 734 ; C -1 ; WX 456 ; N adieresis ; B 30 -15 435 706 ; C -1 ; WX 592 ; N Uogonek ; B 65 -225 528 718 ; C -1 ; WX 456 ; N ugrave ; B 56 -15 401 734 ; C -1 ; WX 456 ; N uacute ; B 56 -15 401 734 ; C -1 ; WX 456 ; N udieresis ; B 56 -15 401 706 ; C -1 ; WX 248 ; N tcaron ; B 11 -7 268 718 ; C -1 ; WX 410 ; N scommaaccent ; B 26 -282 380 538 ; C -1 ; WX 501 ; N Zcaron ; B 19 0 482 929 ; C -1 ; WX 456 ; N ecircumflex ; B 33 -15 423 734 ; C -1 ; WX 592 ; N Ucircumflex ; B 65 -19 528 929 ; C -1 ; WX 456 ; N acircumflex ; B 30 -15 435 734 ; C -1 ; WX 501 ; N Zdotaccent ; B 19 0 482 901 ; C -1 ; WX 410 ; N scaron ; B 26 -15 380 734 ; C -1 ; WX 547 ; N Amacron ; B 11 0 536 879 ; C -1 ; WX 410 ; N sacute ; B 26 -15 380 734 ; C -1 ; WX 501 ; N Tcommaaccent ; B 11 -282 490 718 ; C -1 ; WX 547 ; N Ydieresis ; B 11 0 535 901 ; C -1 ; WX 456 ; N thorn ; B 48 -207 424 718 ; C -1 ; WX 547 ; N Emacron ; B 71 0 505 879 ; C -1 ; WX 638 ; N Ograve ; B 32 -19 606 929 ; C -1 ; WX 638 ; N Oacute ; B 32 -19 606 929 ; C -1 ; WX 638 ; N Odieresis ; B 32 -19 606 901 ; C -1 ; WX 592 ; N Ntilde ; B 62 0 530 917 ; C -1 ; WX 592 ; N Ncaron ; B 62 0 530 929 ; C -1 ; WX 592 ; N Nacute ; B 62 0 530 903 ; C -1 ; WX 456 ; N Lcaron ; B 62 0 440 718 ; C -1 ; WX 456 ; N Lacute ; B 62 0 440 903 ; C -1 ; WX 228 ; N Idotaccent ; B 75 0 154 901 ; C -1 ; WX 273 ; N racute ; B 63 0 272 734 ; C -1 ; WX 228 ; N Icircumflex ; B -5 0 234 929 ; C -1 ; WX 456 ; N ohungarumlaut ; B 29 -14 427 734 ; C -1 ; WX 456 ; N otilde ; B 29 -14 427 722 ; C -1 ; WX 510 ; N Euro ; B 0 -12 495 730 ; C -1 ; WX 456 ; N ocircumflex ; B 29 -14 427 734 ; C -1 ; WX 273 ; N onesuperior ; B 35 281 182 703 ; C -1 ; WX 273 ; N twosuperior ; B 3 280 265 714 ; C -1 ; WX 273 ; N threesuperior ; B 4 270 266 714 ; C -1 ; WX 228 ; N Igrave ; B -11 0 154 929 ; C -1 ; WX 228 ; N Iacute ; B 75 0 240 903 ; C -1 ; WX 228 ; N Imacron ; B -15 0 242 879 ; C -1 ; WX 228 ; N Iogonek ; B 10 -225 185 718 ; C -1 ; WX 228 ; N Idieresis ; B 11 0 218 901 ; C -1 ; WX 638 ; N Gbreve ; B 39 -19 577 926 ; C -1 ; WX 592 ; N Umacron ; B 65 -19 528 879 ; C -1 ; WX 547 ; N Kcommaaccent ; B 62 -282 544 718 ; C -1 ; WX 456 ; N ograve ; B 29 -14 427 734 ; C -1 ; WX 547 ; N Scommaaccent ; B 40 -282 508 737 ; C -1 ; WX 547 ; N Eogonek ; B 71 -225 536 718 ; C -1 ; WX 456 ; N oacute ; B 29 -14 427 734 ; C -1 ; WX 547 ; N Edotaccent ; B 71 0 505 901 ; C -1 ; WX 182 ; N iogonek ; B -17 -225 158 718 ; C -1 ; WX 456 ; N gcommaaccent ; B 33 -220 409 813 ; C -1 ; WX 456 ; N odieresis ; B 29 -14 427 706 ; C -1 ; WX 456 ; N ntilde ; B 53 0 403 722 ; C -1 ; WX 456 ; N ncaron ; B 53 0 403 734 ; C -1 ; WX 547 ; N Ecaron ; B 71 0 505 929 ; C -1 ; WX 547 ; N Ecircumflex ; B 71 0 505 929 ; C -1 ; WX 410 ; N scedilla ; B 26 -225 380 538 ; C -1 ; WX 273 ; N rcaron ; B 44 0 283 734 ; C -1 ; WX 547 ; N Egrave ; B 71 0 505 929 ; C -1 ; WX 547 ; N Eacute ; B 71 0 505 929 ; C -1 ; WX 638 ; N Gcommaaccent ; B 39 -282 577 737 ; C -1 ; WX 592 ; N Rcommaaccent ; B 72 -282 561 718 ; C -1 ; WX 547 ; N Edieresis ; B 71 0 505 901 ; C -1 ; WX 456 ; N nacute ; B 53 0 403 734 ; C -1 ; WX 456 ; N uogonek ; B 56 -225 432 523 ; C -1 ; WX 456 ; N umacron ; B 56 -15 401 684 ; C -1 ; WX 592 ; N Dcaron ; B 66 0 553 929 ; C -1 ; WX 212 ; N lcaron ; B 55 0 232 718 ; C -1 ; WX 592 ; N Ccaron ; B 36 -19 558 929 ; C -1 ; WX 592 ; N Cacute ; B 36 -19 558 903 ; C -1 ; WX 592 ; N Ccedilla ; B 36 -225 558 737 ; C -1 ; WX 328 ; N degree ; B 44 411 284 703 ; C -1 ; WX 547 ; N Aogonek ; B 11 -225 567 718 ; C -1 ; WX 479 ; N minus ; B 32 216 447 289 ; C -1 ; WX 479 ; N multiply ; B 32 0 447 506 ; C -1 ; WX 479 ; N divide ; B 32 -19 447 524 ; C -1 ; WX 547 ; N Aring ; B 11 0 536 944 ; C -1 ; WX 820 ; N trademark ; B 38 306 740 718 ; C -1 ; WX 273 ; N rcommaaccent ; B 57 -282 272 538 ; C -1 ; WX 182 ; N lacute ; B 55 0 217 903 ; C -1 ; WX 456 ; N omacron ; B 29 -14 427 684 ; C -1 ; WX 547 ; N Atilde ; B 11 0 536 917 ; C -1 ; WX 228 ; N icircumflex ; B -5 0 234 734 ; C -1 ; WX 228 ; N igrave ; B -11 0 151 734 ; C -1 ; WX 456 ; N ncommaaccent ; B 53 -282 403 538 ; C -1 ; WX 182 ; N lcommaaccent ; B 50 -282 133 718 ; C -1 ; WX 479 ; N plusminus ; B 32 0 447 561 ; C -1 ; WX 684 ; N onehalf ; B 35 -19 634 703 ; C -1 ; WX 684 ; N onequarter ; B 60 -19 620 703 ; C -1 ; WX 684 ; N threequarters ; B 37 -19 664 714 ; C -1 ; WX 228 ; N iacute ; B 78 0 240 734 ; C -1 ; WX 547 ; N Abreve ; B 11 0 536 926 ; C -1 ; WX 410 ; N kcommaaccent ; B 55 -282 411 718 ; C -1 ; WX 638 ; N Omacron ; B 32 -19 606 879 ; C -1 ; WX 228 ; N imacron ; B -15 0 242 684 ; C -1 ; WX 456 ; N emacron ; B 33 -15 423 684 ; C -1 ; WX 456 ; N amacron ; B 30 -15 435 684 ; C -1 ; WX 228 ; N tcommaaccent ; B 11 -282 211 669 ; C -1 ; WX 410 ; N ydieresis ; B 9 -214 401 706 ; C -1 ; WX 410 ; N zdotaccent ; B 25 0 385 706 ; C -1 ; WX 410 ; N zcaron ; B 25 0 385 734 ; C -1 ; WX 410 ; N zacute ; B 25 0 385 734 ; C -1 ; WX 410 ; N yacute ; B 9 -214 401 734 ; C -1 ; WX 456 ; N uhungarumlaut ; B 56 -15 427 734 ; C -1 ; WX 456 ; N eth ; B 29 -15 428 737 ; C -1 ; WX 456 ; N uring ; B 56 -15 401 756 ; C -1 ; WX 638 ; N Ocircumflex ; B 32 -19 606 929 ; C -1 ; WX 273 ; N commaaccent ; B 95 -282 178 -60 ; C -1 ; WX 604 ; N copyright ; B -11 -19 617 737 ; C -1 ; WX 604 ; N registered ; B -11 -19 617 737 ; C -1 ; WX 547 ; N Acircumflex ; B 11 0 536 929 ; C -1 ; WX 228 ; N idieresis ; B 11 0 218 706 ; C -1 ; WX 405 ; N lozenge ; B 15 0 382 740 ; C -1 ; WX 502 ; N Delta ; B 5 0 499 688 ; C -1 ; WX 479 ; N notequal ; B 32 10 447 495 ; C -1 ; WX 450 ; N radical ; B -5 -74 433 927 ; C -1 ; WX 547 ; N Agrave ; B 11 0 536 929 ; C -1 ; WX 547 ; N Aacute ; B 11 0 536 929 ; C -1 ; WX 479 ; N lessequal ; B 39 0 439 594 ; C -1 ; WX 479 ; N greaterequal ; B 39 0 439 594 ; C -1 ; WX 479 ; N logicalnot ; B 32 108 447 390 ; C -1 ; WX 585 ; N summation ; B 12 -123 570 752 ; C -1 ; WX 405 ; N partialdiff ; B 21 -10 379 753 ; C -1 ; WX 592 ; N Ncommaaccent ; B 62 -282 530 718 ; C -1 ; WX 456 ; N dcroat ; B 29 -15 456 718 ; C -1 ; WX 213 ; N brokenbar ; B 77 -19 137 737 ; C -1 ; WX 456 ; N Lcommaaccent ; B 62 -282 440 718 ; C -1 ; WX 547 ; N Adieresis ; B 11 0 536 901 ; C -1 ; WX 456 ; N mu ; B 56 -207 401 523 ; C -1 ; WX 228 ; N .notdef ; B 21 0 21 0 ; EndCharMetrics StartKernData StartKernPairs 998 KPX A C -28 KPX A Ccedilla -29 KPX A G -30 KPX A O -27 KPX A Odieresis -27 KPX A Q -28 KPX A T -74 KPX A U -29 KPX A Uacute -29 KPX A Ucircumflex -29 KPX A Udieresis -29 KPX A Ugrave -29 KPX A V -56 KPX A W -39 KPX A Y -78 KPX A a -3 KPX A b 0 KPX A c -10 KPX A ccedilla -10 KPX A comma 5 KPX A d -11 KPX A e -14 KPX A g -14 KPX A guillemotleft -40 KPX A guilsinglleft -36 KPX A hyphen -2 KPX A o -13 KPX A period 5 KPX A q -11 KPX A quotedblright -37 KPX A quoteright -48 KPX A t -15 KPX A u -12 KPX A v -27 KPX A w -21 KPX A y -27 KPX Aacute C -28 KPX Aacute G -30 KPX Aacute O -27 KPX Aacute Q -28 KPX Aacute T -74 KPX Aacute U -29 KPX Aacute V -56 KPX Aacute W -39 KPX Aacute Y -78 KPX Aacute a -3 KPX Aacute b 0 KPX Aacute c -10 KPX Aacute comma 5 KPX Aacute d -11 KPX Aacute e -14 KPX Aacute g -14 KPX Aacute guillemotleft -40 KPX Aacute guilsinglleft -36 KPX Aacute hyphen -2 KPX Aacute o -13 KPX Aacute period 5 KPX Aacute q -11 KPX Aacute quoteright -48 KPX Aacute t -15 KPX Aacute u -12 KPX Aacute v -27 KPX Aacute w -21 KPX Aacute y -27 KPX Acircumflex C -28 KPX Acircumflex G -30 KPX Acircumflex O -27 KPX Acircumflex Q -28 KPX Acircumflex T -74 KPX Acircumflex U -29 KPX Acircumflex V -56 KPX Acircumflex W -39 KPX Acircumflex Y -78 KPX Acircumflex comma 5 KPX Acircumflex period 5 KPX Adieresis C -28 KPX Adieresis G -30 KPX Adieresis O -27 KPX Adieresis Q -28 KPX Adieresis T -74 KPX Adieresis U -29 KPX Adieresis V -56 KPX Adieresis W -39 KPX Adieresis Y -78 KPX Adieresis a -3 KPX Adieresis b 0 KPX Adieresis c -10 KPX Adieresis comma 5 KPX Adieresis d -11 KPX Adieresis g -14 KPX Adieresis guillemotleft -40 KPX Adieresis guilsinglleft -36 KPX Adieresis hyphen -2 KPX Adieresis o -13 KPX Adieresis period 5 KPX Adieresis q -11 KPX Adieresis quotedblright -37 KPX Adieresis quoteright -48 KPX Adieresis t -15 KPX Adieresis u -12 KPX Adieresis v -27 KPX Adieresis w -21 KPX Adieresis y -27 KPX Agrave C -28 KPX Agrave G -30 KPX Agrave O -27 KPX Agrave Q -28 KPX Agrave T -74 KPX Agrave U -29 KPX Agrave V -56 KPX Agrave W -39 KPX Agrave Y -78 KPX Agrave comma 5 KPX Agrave period 5 KPX Aring C -28 KPX Aring G -30 KPX Aring O -27 KPX Aring Q -28 KPX Aring T -74 KPX Aring U -29 KPX Aring V -56 KPX Aring W -39 KPX Aring Y -78 KPX Aring a -3 KPX Aring b 0 KPX Aring c -10 KPX Aring comma 5 KPX Aring d -11 KPX Aring e -14 KPX Aring g -14 KPX Aring guillemotleft -40 KPX Aring guilsinglleft -36 KPX Aring hyphen -2 KPX Aring o -13 KPX Aring period 5 KPX Aring q -11 KPX Aring quotedblright -37 KPX Aring quoteright -48 KPX Aring t -15 KPX Aring u -12 KPX Aring v -27 KPX Aring w -21 KPX Aring y -27 KPX Atilde C -28 KPX Atilde G -30 KPX Atilde O -27 KPX Atilde Q -28 KPX Atilde T -74 KPX Atilde U -29 KPX Atilde V -56 KPX Atilde W -39 KPX Atilde Y -78 KPX Atilde comma 5 KPX Atilde period 5 KPX B A -15 KPX B AE -14 KPX B Aacute -15 KPX B Acircumflex -15 KPX B Adieresis -15 KPX B Aring -15 KPX B Atilde -15 KPX B O -3 KPX B OE 0 KPX B Oacute -3 KPX B Ocircumflex -3 KPX B Odieresis -3 KPX B Ograve -3 KPX B Oslash 0 KPX B V -25 KPX B W -14 KPX B Y -31 KPX C A -25 KPX C AE -24 KPX C Aacute -25 KPX C Adieresis -25 KPX C Aring -25 KPX C H -6 KPX C K -5 KPX C O -4 KPX C Oacute -4 KPX C Odieresis -4 KPX Ccedilla A -28 KPX D A -33 KPX D Aacute -33 KPX D Acircumflex -33 KPX D Adieresis -33 KPX D Agrave -33 KPX D Aring -33 KPX D Atilde -33 KPX D J -1 KPX D T -30 KPX D V -32 KPX D W -18 KPX D X -38 KPX D Y -44 KPX F A -55 KPX F Aacute -55 KPX F Acircumflex -55 KPX F Adieresis -55 KPX F Agrave -55 KPX F Aring -55 KPX F Atilde -55 KPX F J -50 KPX F O -15 KPX F Odieresis -15 KPX F a -26 KPX F aacute -26 KPX F adieresis -26 KPX F ae -26 KPX F aring -26 KPX F comma -102 KPX F e -19 KPX F eacute -19 KPX F hyphen -12 KPX F i -8 KPX F j -8 KPX F o -17 KPX F oacute -17 KPX F odieresis -17 KPX F oe -17 KPX F oslash -17 KPX F period -102 KPX F r -32 KPX F u -28 KPX G A -4 KPX G AE -2 KPX G Aacute -4 KPX G Acircumflex -4 KPX G Adieresis -4 KPX G Agrave -4 KPX G Aring -4 KPX G Atilde -4 KPX G T -30 KPX G V -36 KPX G W -20 KPX G Y -47 KPX J A -22 KPX J AE -21 KPX J Adieresis -22 KPX J Aring -22 KPX K C -37 KPX K G -40 KPX K O -37 KPX K OE -33 KPX K Oacute -37 KPX K Odieresis -37 KPX K S -27 KPX K T 22 KPX K a -6 KPX K adieresis -6 KPX K ae -7 KPX K aring -6 KPX K e -26 KPX K hyphen -38 KPX K o -26 KPX K oacute -26 KPX K odieresis -26 KPX K u -21 KPX K udieresis -21 KPX K y -52 KPX L A 18 KPX L AE 20 KPX L Aacute 18 KPX L Adieresis 18 KPX L Aring 18 KPX L C -28 KPX L Ccedilla -32 KPX L G -31 KPX L O -29 KPX L Oacute -29 KPX L Ocircumflex -29 KPX L Odieresis -29 KPX L Ograve -29 KPX L Otilde -29 KPX L S -11 KPX L T -81 KPX L U -25 KPX L Udieresis -25 KPX L V -78 KPX L W -50 KPX L Y -92 KPX L hyphen -110 KPX L quotedblright -105 KPX L quoteright -116 KPX L u -9 KPX L udieresis -9 KPX L y -47 KPX N A -4 KPX N AE -2 KPX N Aacute -4 KPX N Adieresis -4 KPX N Aring -4 KPX N C 0 KPX N Ccedilla 0 KPX N G -1 KPX N O 1 KPX N Oacute 1 KPX N Odieresis 1 KPX N a -1 KPX N aacute -1 KPX N adieresis -1 KPX N ae -1 KPX N aring -1 KPX N comma -4 KPX N e 1 KPX N eacute 1 KPX N o 1 KPX N oacute 1 KPX N odieresis 1 KPX N oslash 4 KPX N period -4 KPX N u 0 KPX N udieresis 0 KPX O A -29 KPX O AE -29 KPX O Aacute -29 KPX O Adieresis -29 KPX O Aring -29 KPX O T -27 KPX O V -30 KPX O W -14 KPX O X -35 KPX O Y -42 KPX Oacute A -29 KPX Oacute T -27 KPX Oacute V -30 KPX Oacute W -14 KPX Oacute Y -42 KPX Ocircumflex T -27 KPX Ocircumflex V -30 KPX Ocircumflex Y -42 KPX Odieresis A -29 KPX Odieresis T -27 KPX Odieresis V -30 KPX Odieresis W -14 KPX Odieresis X -35 KPX Odieresis Y -42 KPX Ograve T -27 KPX Ograve V -30 KPX Ograve Y -42 KPX Oslash A -27 KPX Otilde T -27 KPX Otilde V -30 KPX Otilde Y -42 KPX P A -62 KPX P AE -64 KPX P Aacute -62 KPX P Adieresis -62 KPX P Aring -62 KPX P J -70 KPX P a -21 KPX P aacute -21 KPX P adieresis -21 KPX P ae -21 KPX P aring -21 KPX P comma -123 KPX P e -24 KPX P eacute -24 KPX P hyphen -28 KPX P o -24 KPX P oacute -24 KPX P odieresis -24 KPX P oe -22 KPX P oslash -22 KPX P period -123 KPX R C -7 KPX R Ccedilla -7 KPX R G -9 KPX R O -6 KPX R OE -3 KPX R Oacute -6 KPX R Odieresis -6 KPX R T -12 KPX R U -8 KPX R Udieresis -8 KPX R V -22 KPX R W -15 KPX R Y -29 KPX R a -6 KPX R aacute -6 KPX R adieresis -6 KPX R ae -6 KPX R aring -6 KPX R e -5 KPX R eacute -5 KPX R hyphen 4 KPX R o -5 KPX R oacute -5 KPX R odieresis -5 KPX R oe -5 KPX R u -4 KPX R uacute -5 KPX R udieresis -5 KPX R y -1 KPX S A -15 KPX S AE -14 KPX S Aacute -15 KPX S Adieresis -15 KPX S Aring -15 KPX S T -14 KPX S V -25 KPX S W -17 KPX S Y -31 KPX S t -2 KPX T A -78 KPX T AE -76 KPX T Aacute -78 KPX T Acircumflex -78 KPX T Adieresis -78 KPX T Agrave -78 KPX T Aring -78 KPX T Atilde -78 KPX T C -27 KPX T G -31 KPX T J -80 KPX T O -26 KPX T OE -22 KPX T Oacute -26 KPX T Ocircumflex -26 KPX T Odieresis -26 KPX T Ograve -26 KPX T Oslash -27 KPX T Otilde -26 KPX T S -15 KPX T V 17 KPX T W 19 KPX T Y 19 KPX T a -79 KPX T ae -79 KPX T c -73 KPX T colon -95 KPX T comma -80 KPX T e -77 KPX T g -76 KPX T guillemotleft -100 KPX T guilsinglleft -96 KPX T hyphen -60 KPX T i -2 KPX T j -2 KPX T o -76 KPX T oslash -72 KPX T period -80 KPX T r -77 KPX T s -74 KPX T semicolon -93 KPX T u -75 KPX T v -79 KPX T w -80 KPX T y -79 KPX U A -32 KPX U AE -32 KPX U Aacute -32 KPX U Acircumflex -32 KPX U Adieresis -32 KPX U Aring -32 KPX U Atilde -32 KPX U comma -24 KPX U m -1 KPX U n -1 KPX U p 0 KPX U period -22 KPX U r -6 KPX Uacute A -32 KPX Uacute comma -24 KPX Uacute m -1 KPX Uacute n -1 KPX Uacute p 0 KPX Uacute period -22 KPX Uacute r -6 KPX Ucircumflex A -32 KPX Udieresis A -32 KPX Udieresis b 0 KPX Udieresis comma -24 KPX Udieresis m -1 KPX Udieresis n -1 KPX Udieresis p 0 KPX Udieresis period -22 KPX Udieresis r -6 KPX Ugrave A -32 KPX V A -58 KPX V AE -60 KPX V Aacute -58 KPX V Acircumflex -58 KPX V Adieresis -58 KPX V Agrave -58 KPX V Aring -58 KPX V Atilde -58 KPX V C -31 KPX V G -34 KPX V O -30 KPX V Oacute -30 KPX V Ocircumflex -30 KPX V Odieresis -30 KPX V Ograve -30 KPX V Oslash -27 KPX V Otilde -30 KPX V S -26 KPX V T 18 KPX V a -47 KPX V ae -47 KPX V colon -41 KPX V comma -73 KPX V e -46 KPX V g -44 KPX V guillemotleft -68 KPX V guilsinglleft -64 KPX V hyphen -29 KPX V i -5 KPX V o -46 KPX V oslash -41 KPX V period -73 KPX V r -37 KPX V semicolon -41 KPX V u -35 KPX V y -12 KPX W A -42 KPX W AE -43 KPX W Aacute -42 KPX W Acircumflex -42 KPX W Adieresis -42 KPX W Agrave -42 KPX W Aring -42 KPX W Atilde -42 KPX W C -15 KPX W G -18 KPX W O -14 KPX W Oacute -14 KPX W Ocircumflex -14 KPX W Odieresis -14 KPX W Ograve -14 KPX W Oslash -12 KPX W Otilde -14 KPX W S -19 KPX W T 20 KPX W a -29 KPX W ae -29 KPX W colon -31 KPX W comma -46 KPX W e -26 KPX W g -24 KPX W guillemotleft -48 KPX W guilsinglleft -44 KPX W hyphen -9 KPX W i -3 KPX W o -26 KPX W oslash -21 KPX W period -46 KPX W r -26 KPX W semicolon -31 KPX W u -24 KPX W y -2 KPX X C -33 KPX X O -33 KPX X Odieresis -33 KPX X Q -33 KPX X a -12 KPX X e -31 KPX X hyphen -40 KPX X o -31 KPX X u -27 KPX X y -42 KPX Y A -80 KPX Y AE -82 KPX Y Aacute -80 KPX Y Acircumflex -80 KPX Y Adieresis -80 KPX Y Agrave -80 KPX Y Aring -80 KPX Y Atilde -80 KPX Y C -43 KPX Y G -47 KPX Y O -43 KPX Y Oacute -43 KPX Y Ocircumflex -43 KPX Y Odieresis -43 KPX Y Ograve -43 KPX Y Oslash -44 KPX Y Otilde -43 KPX Y S -33 KPX Y T 20 KPX Y a -73 KPX Y ae -73 KPX Y colon -60 KPX Y comma -92 KPX Y e -74 KPX Y g -73 KPX Y guillemotleft -103 KPX Y guilsinglleft -99 KPX Y hyphen -68 KPX Y i -3 KPX Y o -74 KPX Y oslash -69 KPX Y p -48 KPX Y period -92 KPX Y semicolon -60 KPX Y u -54 KPX Y v -31 KPX Z v -24 KPX Z y -25 KPX a j -5 KPX a quoteright -10 KPX a v -19 KPX a w -14 KPX a y -20 KPX aacute v -19 KPX aacute w -14 KPX aacute y -20 KPX adieresis v -19 KPX adieresis w -14 KPX adieresis y -20 KPX ae v -17 KPX ae w -11 KPX ae y -19 KPX agrave v -19 KPX agrave w -14 KPX agrave y -20 KPX aring v -19 KPX aring w -14 KPX aring y -20 KPX b v -13 KPX b w -8 KPX b y -15 KPX c h 2 KPX c k 1 KPX comma one -83 KPX comma quotedblright -22 KPX comma quoteright -33 KPX e quoteright -5 KPX e t -8 KPX e v -16 KPX e w -11 KPX e x -19 KPX e y -18 KPX eacute v -16 KPX eacute w -11 KPX eacute y -18 KPX ecircumflex v -16 KPX ecircumflex w -11 KPX ecircumflex y -18 KPX eight four 6 KPX eight one -36 KPX eight seven -16 KPX f a -9 KPX f aacute -9 KPX f adieresis -9 KPX f ae -9 KPX f aring -9 KPX f e -12 KPX f eacute -12 KPX f f 17 KPX f i -5 KPX f j -5 KPX f l -5 KPX f o -12 KPX f oacute -12 KPX f odieresis -12 KPX f oe -12 KPX f oslash -8 KPX f quoteright 12 KPX f s -4 KPX f t 17 KPX five four 4 KPX five one -56 KPX five seven -16 KPX four four 8 KPX four one -65 KPX four seven -39 KPX g a 1 KPX g adieresis 1 KPX g ae 1 KPX g aring 1 KPX g e 4 KPX g eacute 4 KPX g l 4 KPX g oacute 4 KPX g odieresis 4 KPX g r 0 KPX guillemotright A -42 KPX guillemotright AE -43 KPX guillemotright Aacute -42 KPX guillemotright Adieresis -42 KPX guillemotright Aring -42 KPX guillemotright T -101 KPX guillemotright V -68 KPX guillemotright W -48 KPX guillemotright Y -102 KPX guilsinglright A -38 KPX guilsinglright AE -39 KPX guilsinglright Aacute -38 KPX guilsinglright Adieresis -38 KPX guilsinglright Aring -38 KPX guilsinglright T -96 KPX guilsinglright V -64 KPX guilsinglright W -43 KPX guilsinglright Y -98 KPX h quoteright -3 KPX h y -14 KPX hyphen A -3 KPX hyphen AE -4 KPX hyphen Aacute -3 KPX hyphen Adieresis -3 KPX hyphen Aring -3 KPX hyphen T -61 KPX hyphen V -29 KPX hyphen W -9 KPX hyphen Y -67 KPX i T -2 KPX i j 0 KPX k a -5 KPX k aacute -5 KPX k adieresis -5 KPX k ae -5 KPX k aring -5 KPX k comma 1 KPX k e -19 KPX k eacute -19 KPX k g -18 KPX k hyphen -31 KPX k o -19 KPX k oacute -19 KPX k odieresis -19 KPX k period 1 KPX k s -9 KPX k u -3 KPX k udieresis -3 KPX l v -3 KPX l y -3 KPX m p 4 KPX m v -13 KPX m w -7 KPX m y -13 KPX n T -75 KPX n p 4 KPX n quoteright -3 KPX n v -14 KPX n w -8 KPX n y -14 KPX nine four 1 KPX nine one -31 KPX nine seven -19 KPX o T -77 KPX o quoteright -8 KPX o t -7 KPX o v -15 KPX o w -9 KPX o x -18 KPX o y -17 KPX oacute v -15 KPX oacute w -9 KPX oacute y -17 KPX ocircumflex t -7 KPX odieresis t -7 KPX odieresis v -15 KPX odieresis w -9 KPX odieresis x -18 KPX odieresis y -17 KPX ograve v -15 KPX ograve w -9 KPX ograve y -17 KPX one comma -54 KPX one eight -46 KPX one five -49 KPX one four -59 KPX one nine -47 KPX one one -90 KPX one period -54 KPX one seven -64 KPX one six -44 KPX one three -51 KPX one two -50 KPX one zero -43 KPX p t -6 KPX p y -15 KPX period one -83 KPX period quotedblright -22 KPX period quoteright -33 KPX q c 6 KPX q u 1 KPX quotedblbase A 24 KPX quotedblbase AE 25 KPX quotedblbase T -60 KPX quotedblbase V -53 KPX quotedblbase W -25 KPX quotedblbase Y -71 KPX quotedblleft A -41 KPX quotedblleft AE -44 KPX quotedblleft Aacute -41 KPX quotedblleft Adieresis -41 KPX quotedblleft Aring -41 KPX quotedblleft T 16 KPX quotedblleft V 24 KPX quotedblleft W 31 KPX quotedblleft Y 14 KPX quotedblright A -49 KPX quotedblright AE -52 KPX quotedblright Aacute -49 KPX quotedblright Adieresis -49 KPX quotedblright Aring -49 KPX quotedblright T 11 KPX quotedblright V 16 KPX quotedblright W 23 KPX quotedblright Y 9 KPX quoteleft A -52 KPX quoteleft AE -55 KPX quoteleft Aacute -52 KPX quoteleft Adieresis -52 KPX quoteleft Aring -52 KPX quoteleft T 5 KPX quoteleft V 13 KPX quoteleft W 20 KPX quoteleft Y 3 KPX quoteright A -60 KPX quoteright AE -63 KPX quoteright Aacute -60 KPX quoteright Adieresis -60 KPX quoteright Aring -60 KPX quoteright comma -48 KPX quoteright d -16 KPX quoteright o -24 KPX quoteright period -48 KPX quoteright r -15 KPX quoteright s -13 KPX quoteright t -3 KPX quoteright v 0 KPX quoteright w 1 KPX quoteright y 0 KPX r a -3 KPX r aacute -3 KPX r acircumflex -3 KPX r adieresis -3 KPX r ae -3 KPX r agrave -3 KPX r aring -3 KPX r c -6 KPX r ccedilla -3 KPX r colon -5 KPX r comma -48 KPX r d -4 KPX r e -10 KPX r eacute -10 KPX r ecircumflex -10 KPX r egrave -10 KPX r f 23 KPX r g -4 KPX r h 2 KPX r hyphen -30 KPX r i 1 KPX r j 0 KPX r k 1 KPX r l 1 KPX r m 2 KPX r n 2 KPX r o -11 KPX r oacute -11 KPX r ocircumflex -11 KPX r odieresis -11 KPX r oe -7 KPX r ograve -11 KPX r oslash -7 KPX r p 4 KPX r period -48 KPX r q -4 KPX r quoteright 14 KPX r r -3 KPX r s 2 KPX r semicolon -5 KPX r t 23 KPX r u 0 KPX r v 24 KPX r w 22 KPX r x 19 KPX r y 23 KPX r z 6 KPX s quoteright -5 KPX s t -5 KPX seven colon -47 KPX seven comma -95 KPX seven eight -15 KPX seven five -22 KPX seven four -72 KPX seven one -34 KPX seven period -95 KPX seven seven 3 KPX seven six -24 KPX seven three -14 KPX seven two -14 KPX six four 6 KPX six one -31 KPX six seven -13 KPX t S -8 KPX t a 1 KPX t aacute 1 KPX t adieresis 1 KPX t ae 1 KPX t aring 1 KPX t colon -13 KPX t e -10 KPX t eacute -10 KPX t h 1 KPX t o -10 KPX t oacute -10 KPX t odieresis -10 KPX t quoteright 10 KPX t semicolon -13 KPX three four 8 KPX three one -34 KPX three seven -15 KPX two four -38 KPX two one -29 KPX two seven -14 KPX u quoteright 5 KPX v a -16 KPX v aacute -16 KPX v acircumflex -16 KPX v adieresis -16 KPX v ae -16 KPX v agrave -16 KPX v aring -16 KPX v atilde -16 KPX v c -12 KPX v colon -8 KPX v comma -50 KPX v e -16 KPX v eacute -16 KPX v ecircumflex -16 KPX v egrave -16 KPX v g -15 KPX v hyphen -3 KPX v l -2 KPX v o -16 KPX v oacute -16 KPX v odieresis -16 KPX v ograve -16 KPX v oslash -12 KPX v period -50 KPX v s -10 KPX v semicolon -8 KPX w a -13 KPX w aacute -13 KPX w acircumflex -13 KPX w adieresis -13 KPX w ae -13 KPX w agrave -13 KPX w aring -13 KPX w atilde -13 KPX w c -5 KPX w colon -10 KPX w comma -37 KPX w e -9 KPX w eacute -9 KPX w ecircumflex -9 KPX w egrave -9 KPX w g -8 KPX w hyphen 3 KPX w l -4 KPX w o -9 KPX w oacute -9 KPX w odieresis -9 KPX w ograve -9 KPX w oslash -5 KPX w period -37 KPX w s -7 KPX w semicolon -10 KPX x a -10 KPX x c -13 KPX x e -17 KPX x eacute -17 KPX x o -17 KPX x q -14 KPX y a -16 KPX y aacute -16 KPX y acircumflex -16 KPX y adieresis -16 KPX y ae -16 KPX y agrave -16 KPX y aring -16 KPX y atilde -16 KPX y c -13 KPX y colon -9 KPX y comma -49 KPX y e -17 KPX y eacute -17 KPX y ecircumflex -17 KPX y egrave -17 KPX y g -15 KPX y hyphen -2 KPX y l -3 KPX y o -16 KPX y oacute -16 KPX y odieresis -16 KPX y ograve -16 KPX y oslash -12 KPX y period -49 KPX y s -11 KPX y semicolon -9 KPX zero four 5 KPX zero one -31 KPX zero seven -21 EndKernPairs EndKernData EndFontMetrics gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019043l.pfb000066400000000000000000001074071404163720200221000ustar00rootroot00000000000000n%!PS-AdobeFont-1.0: NimbusSanL-ReguCond 1.05 %%CreationDate: Wed Dec 22 1999 % Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development % (URW)++,Copyright 1999 by (URW)++ Design & Development % See the file COPYING (GNU General Public License) for license conditions. % As a special exception, permission is granted to include this font % program in a Postscript or PDF file that consists of a document that % contains text to be displayed or printed using this font, regardless % of the conditions or license applying to the document itself. 12 dict begin /FontInfo 10 dict dup begin /version (1.05) readonly def /Notice ((URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General Public License) for license conditions. As a special exception, permission is granted to include this font program in a Postscript or PDF file that consists of a document that contains text to be displayed or printed using this font, regardless of the conditions or license applying to the document itself.) readonly def /Copyright (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development) readonly def /FullName (Nimbus Sans L Regular Condensed) readonly def /FamilyName (Nimbus Sans L) readonly def /Weight (Regular) readonly def /ItalicAngle 0.0 def /isFixedPitch false def /UnderlinePosition -100 def /UnderlineThickness 50 def end readonly def /FontName /NimbusSanL-ReguCond def /PaintType 0 def /WMode 0 def /FontBBox {-136 -282 820 951} readonly def /FontType 1 def /FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def /Encoding StandardEncoding def /UniqueID 5020913 def currentdict end currentfile eexec q `,i"[[5j5mTʻ^+݄fKitrޟm%9۩*++`[&NfA-O!J"|UY+; <Ԟ2?.P2QhnDtw=y0)n*[ Y]~ ΁RzYi[AXm>o,vK2Zq$yb8?VɄn)cF,о-xH)›jcKeVRG)8(hgZUBF\Z=;j7ű c9SϿO;FsM|e}ƍ^ϗʙb,'s=O0wȅͻ]/MQo@J^h2^kL;lH!_lJc N2෴Voj0իz4pApRKSZLj4Nr Ye 2 ʤVR"XF!=zy[RJϧv/ %"~aDʳ#85s'JSLOVaҝ7Wh{ ^0wNsS6yK)C20Ŧe,mw!,t_Iu$X>yd&PƳʸl1맮m,n |H_2~V)= pZi:MR%1=W0>ޗT > x#QУof(5TxP6.fNvlsضۥilrwL`C];I (hQ@άQ=PXqv6'JR&k/戏FwN8&j{[L4 7LRI8Z|5dvɛi6ッNbC88Rv_&߾3. v2[W;u_ł Ý͂[el % _?:7=zWn_Nח_֚ea|>4L&Os Vēml u)DUeV3)k3&Ҿ8 zhJ>V)/L"mml +\w^ $ppjxiw]hiWBqS\0G.08 &ty`oH }Ӥ;7yF׬(tDd>\mvrS0Et+Sc"8khNj{!݆ɏBɩ!56miFtBLχI`Hd TW~'~!-Jʧη|\ϊ#VKK'('ϣxH[j(btJ{;CP\(ZjALNb'M ic u1[l}q?Y͒X4eiPBF0+0O }bc8yh +C]t)黙e(/p&Q2_!Oll.S:]C_mxf%.:O̭@Nh ݆;'&kOc[U,s>d3K@gt A@#290TKc(k/#Z2A}t1'FOοU4oQ=rS`\ {kRc˃d$&o5LH1-%O@*Do-~U>$E5{?>у3riV$,<ܟ #DԽ"ͤq+WKbuZ5^!3߮blM[Rz$hʇ[u|,Jaӫz1>^Iu!&O%f(~rhs;=#Jv9A;I.(!?p*U}VOToԥbl&RSȤ3(G06Vʸ-{evq:C)e*J3g'w㠤i ^jm (X8a, r7᙭D[SJTx_ Y;)OQC6~Z#X]2%:'BgnHL@ù C Lh 6`H5H:ūۡIqmsԠA~6\+fMQn30M4^~KZ>u-m̗P۳Zbl=Y3Z)8-~,`ȚkPޥ2bx[fNy.rw`'b$- $fA4L>JN5F 76 8P nKk'W$њ,lO86ki.+Q5F1+pr5kJi6Q4„ ,%2O)OjLsZzvya6Qd<;Eڌm]Zk.ʾ1rk!V\ sr" VմZOh=՚=Cx0Kv-(KJ XsKg/J"*jD6ElU"PkZ2 9B!iOU >e/\'fy!mƐ%m aU;q탣^$U8@aZwf%rhH }ӤD+ @#D:q.o0C` /}U-R>Wɾ6T"O_ZR{ѣG96uM᭠]YFNF5Sg6'a9kg*tF|Z>۴BJ ^'0l~#ܢWBծ*$O;i{ͯ)S%a"iM:)3Ǽa XR )DB*{5aEy{|za AvAT`M-TCO#< U)G="ρLɡONS:ɧ>+"̓oMw\e]]9T[PE$Qd3&t@f9&ctglXh&Ve܉ b/nukix; %X:<*9p #}A]Ep1{ұtO t 鬘ՇNEGQO$6_~Sn vbz\Q',:-l<5HwM @øY.~euMOF/^^Z*:ݱy]S#cq2ٺP ]#/ℽ>`jq(L/dޓT[^܌:įB," ~RXQѲ&6s1 , }%1/n!(9< uJUS20yJwm%*?ɭ`Wߘ+}"@v0k"H,ot_]X_aUYUTүXfHc퀔,DdVS$fG*"@v:tƺFؤ|B -ΚdP)A6əx5NYЈ4 Bcx rbsDȋيڅ&.wb-ıax5ꄋy ' ܷ_@49RAB_aT걊 8'Kf8bjiʈ B=3dIVKmuV8[n3=_NFXt1!6{06d_ 8PG5J%?=7b9n9zPps0XWrf\ػsǕ*IK&r+*d4 5>?#3jw:b,&Tǂf\ WIf4OY^f~[?P~LUD è A&! |r>T>ѕ[RVN. 4ckʱZG>ez#ދ7le IlBUB] -P@BHDuQ"Bz֋s6 .ўZW̗ cnSq:iw]azcRU5Ԓk`az3(Ѣ HOoYU_CŘ`.rWE5\OJ6JaMUG>qo0JgaH@ʵ{YaK?܃da=K@|_|yWy_bA ֫<}fkؽ3I4S lNfRd V8Bߎw4VX.ޭrAW4_E"\6 R1u0jʈ9N0til%C 8jP 6") `PsGfMIt,_ǍLY+q:bBK?3[ĜoTq>51?gd|^w ܂l5HB0Y̊<!f,'a?z*5ʥk)QQƒ H*C9`>TGi_eΨHi=֭[9I个ZdnMz20HE_/a@ S$ab^IyHȋuCEFdpO-\Z>Yz.L϶Wǰ j3slTdi IagT=LA,-rsbϏp( VPM`<( }BN^Qj/3+*P>>%>< I>Tx'R9^vFEExBH%Z;L=9'ę:RSԦZ-ͤ'LYZVU t#W-%\4ʭKyk|uD'ɀI3jj4dMU 3PU})}|PI ߰ 1&;vBlvNKX鵠5:DQ%8{0&v|t[HgeC]D24Ej= C)Vx\`֡ug"g)dgm@Vת*w,[ˆ [v{j9'CD6SN?mv8}zƚ7E$yzRG@Y4ƻ`ԧ7zdK[_9Iq^OLi D7^rJP nF:=b|CE*44)zen7p;&VJܙ=Ƕ Q !q Ή{Y\B%ɀX8E=)1[],vt;.rqpjs*GTފѕ&l"tBW'Pą-w =HxBJÁN}^PqH~r[4V='f'2 /V VRrV瀞%3ftta3o(ץU `E/D QB]ps}%q+Q5+Q/uϏB'Pe\SG=z[*p( gL'u;Gⷳ 4PiK{9 Hj]95i[ʨj!_J.򎞿 nA;gg1q.N R¢l)eT+4ar$0hƎ5 qޝFfBZhƮ yvDhrZ;QOAώa]yI=ìp3X֤L"ؐ7er 6&UZ٫w.7èсh:P_s&̌^Q:xUd /Ƅ QqyCm?:AA= Ga:iϹseN ȧ䘮7yy.q>Wd}~!:sCg҆kG>ۥ*C7Ւ,Zp{b=>d&Ԣ])aQ*'Hk6aTZb5|_1+>h{Lzh~fQĿF )ضӦ7ԭɑz4];(zLp~+zM4(rmPCǑSAn e+PQaM@=ׅ8 *<܎乳qypsB3@S䟳V&"v<78dû B @L\v֧?w&}dKn><>W8/@1f>x$S:j.ȃaYHU<'j@;ypUW_m:>w}{-l[2˅V7hfO4ivl 讔D+$îl=[C.:Њy uóVnLP1H#VpV]9#I1 WsK,r^Yѓլ<^CJ5悟7*wȗdD  <4x<B/h NLDǝ!i?/V3:4e;aJKFfJ Qܓ@ 7JRڄ? G (b ?.kUXT4,BToB/"e$pl A>"H֔i,,hD5u c^L.ϡ!?f9Q悬{ϲ^MXumcK41nE#*LdH6|Bg8U>lj=}KA!5;r2*~.ul)ÈK#6')ә[U5ElKxh_D.h/VnsnZ"G Ke_-~$Sҥl°/YCy$0Hm?w#@wYabw1ίX.w;+agE>qX,l8e);٦"Rxi Iupgٛd7l+bfU;)* QZqr?$m*ҠA {H]:g LQ_{nyQ˳e9j4&?7i+lnMg$R>(>EqZ6-~cm%݆o@mTLM})҉1QAv.^ڢlduQ3eܢwPhD8?f}u5#j8N#96ZsrW*z#*6`= )ݬL#a#GJ>pX֠!\ߡXņdv*oFGJ;bsIBRh62;x}$1,P7 vIUCӾnں`dnbnk4LsF? 8#%O( u:ƈ fq5] a^"TrVٞ0׉E)PTH -˝٩= ߝ|@ D)`Ei丽N".| ]ςGKO19^yQM_ӗk' ]TɟWZV=<4{ȰAa= Hg~BܦXb=lǁDg[qDE3wb\WSI)x >N\[P~~B OzA6P&I7^\@ZY țP]2&e7. 4r ~2w4W+nr3kYiLf݀{nH*eF;d\(?S"Nskngb4Xظyz30T,+?!f9j1!t~RcF#ucdɺ&o^sz!ac~u,ߪvEԼp㉃4#9tM~`HEx,bK'vGiFYkRfx@=s٤ĄlcWĐKyntZ\)C#(F\e{__#WdibKҷnG4IRSE]/- ./K;4:O$2ţη [ NA;z! (JɺxGhh*Kv =/{mvȉRE^]%&XA{-❞rvAd R gNXOdu,,0L"a[M<Lَ Z3Qxm(֎\1;$L.8ie<>eV;bv.}֖Y0Vuy9 5ǃِ.pb3Ҩor$/2 @{vnTh'WA k_!._z9.~ 9vMqIxfW} Ͼ, )ok{֞FS.BhGWuN_-bׇ]Yi@^AV:vK U3f~G~"F')"2ZrWIr肤=1+mᑻ~ aS+HK%ؒNS=~T+yW_Ң$!ڈ0\ 㛈3˭=Л )H:x(Aˬ݄Fl@m6 %H e7 ʁf.`XWFkt6eώTɚ'p(tޯ17oԆ+z<(#]29G,:SqUGMsdTyG 7P8%\.1 ҢNȸvyW¸|Ǭwbؐ?c/[ ~5 ='Ѩ |ŨgNϬJm)rU(R hɫc29:>һ7&|<˦ܒ=#8^9gx 7mSɔtODx9i".,ڌe-"ou@f"ZT0/ W@V<aDeJ.^-x_0\/`=-59ّ`{&=ů=G  C^"r8oGZ?LNfoJ7A, "a>~S /EqSкZmH(Ǎ f᡻? z bXw੺U'XYesqW<+oAQYX'^`Np8o ,2ƒqi4 @C%k\YXe VH^VGb];ns=ϐbš 3ŵ V_-CEN"f hJ&qdw\ y+ex wZX >ϡ$D3 #6F[5ӣ+Ⱦ'T(QŠjT)Ji Z0̦VH?Dt*-Fܫk']ǹd~Dȶ,mP.S \ ?"&&J]=yP.VFCp_ JGyFf$gf_仃kAן|iBT\״m]'8t]vHgpU3gރSŅΑpC1$Xo kCR֑bgK'ihՋ# V/ȖĻhBѴ BYF`|˰#OTٰXroaJs0kCѠ1]_ՊX_(Dt80)OXGUJ }J:fܜRۤ!we4O)m e<kqN+U2vӰaĩ+&йߑ0:HC#f{n=( ؋uEVIA3y2[l%pF P1$=q͵U g.D0I_:FJ}q[m!]+@v #u/FM Xt\T'??hHNl' ˚VGl(8^K(a2fAW1CMd*)djpGx%r&_Y{[ ->?B hwB\NN0Tvca#Ȼ~]yl.}j7gdoYu/vwȊWmP5uٸGGԐ*P)&tXOLdkTU%V-=wHص3$owT̋'וϚ nCPgPnhÇϹ|sd' զ$ jv+Z^0{.27{F֠?vo{|eVٵhSsCG3|hPRxOUI~5Yp%)"gkUCŲLFeǤ:BxI0Q(ZB$(؉0ĢwqԚϯ +edȲL-_m?y,7=d>2x]Yuh-#~ *仱^!Okq{u 2"n/g鰯goeL0=fT$eD,1f|Эȟ:ߚgoNNÚp%!Hh07]̈́Ub|12DŋڧK<v? /{,X${5'U/;YXS.,ׇ7Ep1 K+pYIhxi$EՄ ^ѻ(`e}?8G d37?Y}lq !3j'((.ܾѭhkTGxW>wNzkχ w *!ޙ_{:rEO؞% r95@b) ~ EbA5Q IfnuN{ Ăa#Dcywxÿ/$3߈o^H_y ?#7\.^<`޻ 7k`|(A+pId@gF~OkJ^dko\jiUɢ"iq %ۮ'<,v>ux,קoIf!(“s-W'5Ο<". OpAXeŕ*Ѭ҂#(|%$5u*5u #wC}s֥F&$@RR\^}z+'pӲ#ovBn 4rK2u- S1Ni_1z_Z"0{oMjF;Gp4y]͝󒎆SD>6T5]xS= (蘳Lk?B6yf iE6tsJEAߨhڜK u: Jvv Jjk6K O"Qy]pdDA@gFugьZɦiQqD (gGkϑe4B #ebcvefcJ[s31q9vKR|4BZ%Q2N#h|^.%UĖ/R/7Rg*dTn]]2Y{m *6hÌNvbJ伒m8\t׫N< O#X2B-'fso7{gWjE<T yG/74oۗ%RV@hVe=ù8*|^{ 2 ؚ{^)({UFGU-NN5*bGY|ӖT/S1I9(!k|*WӦ+ pc?$Ms^BAwak}K`,(D^IaOiIjߌCjc;R7xgyVeKžxΒR%tAn,G#Q4F[4(6LU1^z6maF, r9RV-9PZhCQQH6Yr`/CqM!5aAHcLOe3)"!:}[IXLӯfaFS!OFXbc1F<yv&kɸjTSeX0f-10pb)K˗W7w12FD4=W5ZMцn`]POTr[  ui|{1}}ցs_widDݛT~"4*RUbAvo>Wc:t1SMM@$/+yt}gcSn=;nZtTw\0?Kzo DzyT ld i( &i<| +_hWyrl?$"OrTВƯmbJ`??5_\t|/DKl@ (%.gq2|,x(P>(5 oSzDyz{?V3;Ա"~v]\ xPPĵ@V~ܧW'tU65RGvuuHrKJNo}s-LC , LሺWr;Lzt[~rc`,r@н"ճ ^HNGڥ:F~.Cp{O~P>cSnDd(3t%zf؊~+(9q޿R8PnS΀ͣ=O6;HTX'!""#ŶXIDS$BjLGW"Td_?@ނ1_{SSWs逘 ]Z`OhGkOx9lt܍/U]d}Rсa9]G3F|P?.(; %P+m;p/neFA}!75i t]Ԙ_kCq${7@I@Z>Eǎ R}Z ʪ_fn+auIBMgFm_k<o07I_4G4%~PZb'X EΓ±W*;wm~V} VF<5(Tuik!Mauњ\!?yfG|n.]`Vo-8a+8d]eϥwߪ>}is<-'vE?$h]8˨[X{Q{-"ĥM΂Y9Z|C?a,GE쑜gɑ8;X,:9vSnabu9>\L'Te*JBFVC^J 0>yn|be@]QzG ГSxR\-F^]f(aUWM6CxbJ\Y &ܢ'mIpw(U/A)YWs1_R栬5."UqhO#F\Lu׹BoA8dj`P?$QQwBinLMpyZ#J"Nϛ'¥|2 XƐi!A>2OL3{`) rZB;eswX LUNsSR[ب(/3ck}Mʚ6pGoCA~e_>eK w45MҒSkҧ75fifH]2iW.WeʣVP*HmoKz( ,}{\5J A w9 ;u:8%~6l 3qeSXlZdžTQ#_ 4eBJ>W|VFDjz=T6frǏL&jLMIB.Smb< ^\iwOl|6\@>=ո>rg6U/-Wg4ޘ !{IqePv~ΪN֏B5,*w)v춺J& mKwά@@{0t0 *oVeq4?ߚMbK#?x5cuB xLk#Jo^K GJ;N8b6 37hnzhǁ(4/D5ދ$F4!]~*e"C AjXc b\-> y Y֦N]M8})j}Rˍilig=QjKUFlm=9b%T `8BZ%&K븡1|/''}WGi "rP7z.10%k[vdyJYσ7 6o?;ebk`՝?Շ곡EVWˈDbU^+4`9q!VA'Sd@J84GNv2v.9HHyO'}- 7 ]Zf l~jLbD'0Snb+0Bl=ٳ'A܁:2ߓKלXTZj0K CrM4%pNwElGX7v7[xr3j=?:WK֮5<rg`8P9+l!$x%JG] J8co{r%2л, nT6/%tfrsJvzG(Ֆw<r q  T@*@HզWVT!%ӿ sc76B )<1F>{\|w:DyBkkfFL-i(फ़xem4HA>Gh&(5x?C3?>J4NA-p Jm] Y&Ӡ4:sqzNG>XҸ C;kU Qz8ߤ= v cPc-y6hE=n$&KGӲ7 ğ*9m@?\Adj֍D8OV~iC8Q92HOu9]봛o@ b U἗Jz1W} :0{dПںJoc&w̤fgv}% jdhI.gK"7 *)h%[;_;"?m4[#hKl/h!u, F,sTM@tHbtT1 A&x(F7sõ|hi0uJVCv+9*ַH6Dplz!y@˻^K[E2UX?@_P,EpVUٻۮDſ|$-EuNXe a$nl>G E Pr2譏-L|{KnOc/`_ `^k#2[ c_&ǒaSm, ^v"hͤc3+5Z3u([F'/t-_owwwXdBPyUU)\]K\axnb.>EPmK,Ia $bmAeU&%<y/#eMQdC2UE $6\ <3C[]4%Q|p y {: v2G ĽVí_6?#ϲ[зt2(U9WX 1m;w1Զ/R헿c -w#,sTq\pz%j*^ ? ̛`O#Ik97`iSR<)7#a( |'~_ ba(QVB =򑧪 YF֫Ci7o'4NtsEOIIQc1).<¨^+*ai,`ڗ :OCfB U5MFEǂ 5 +'hPui[v =3F(̓4oK~D@gy4>=a t ,NTcM5Wy2є搚#2[xfBJVm9բv1WnFeC {?EJ!kx1* Co ,_OT)XV4 yr‹)KPdVg_"tꉄ^ xc2pMf|Z &cs5KzTŞ©Bp*:yIW j:FwEΝf(zZi%cT}uG܈81DFgaI7?qh,G湙r M 5W|!=̐q.ߌCA=O 3iUV}A&zo|g8`N#2sқ rYV*zm/}ld\cT.1&ȂDC}֏)Ma  At`($ŠyjbaLyP!hX4b4El!T~2zԆGwٸ`wv ))dV}EtV+MWmҶg1Xa}`݊ r[")nY*pOKrR_-6M3@M>!& %ڶm> f.W*> ~YgPvH D4SdE`$ b #nh6R#.ĄsGEygџX$:e@vJ4&Q5X`a4[g,Yx-H+`:H!>ǂU|+ˋW8.Lh;6@)EG(:Ǚ,oҙ  ^c,jXLa8+z,E, '0츧=0;z̢Fv,QX;js*(4$[ܷ3QoX}Ga&vQVaHYsF%U JY7ˠ4᠈bdH][(oTJXal+H?ⵥRMڹ!xTG&y? x}Nl))5f$x$#R{^vu(}A:( 9(l&KWXQd\露܂1_;FCG *^uR}wAa]= lKNO^=oo'8{۲y.c/\C͞ TyUywҚ̌b %?4@ dkY0AO9;9.=n{\N7i徲"K\7ukqo=+h󯛴jO{}F^I#.9| s=_gbjZ-Ŕ"B/ Kr,7E,7k0E>HMZK*g.~Ͽ#ES^)^y7%&.T =o [xv cb´+w]9+ILFVg!`C(TOe_(EO1D E_iz[B:;]_*H@NA%ov=[=늝B022Bm$ku#5hjj$[AD,wW`28n2K~Mq]:A~K{|1wz(l~?4ZWTj`\)FshQ"? )UQVnV 3Huw{֘MU[)Ffcy$͆zAhﻺ b# \|ZDA8^] 0'0dv8IKm6f,Sf)VjO!E ЯR=x6jiিAiBg4B-U2PDL~]8O\p(2XX2.S!-5*HB(lQm+׉dB2 p g-X.5آpPʼn[-yXFg$fXw3|d!xR6C؅d[֜t*.5{zfiߞ@[+bvpNii6J>H sQpW"DGg'!wm&fc?''9[S1 /i3?v M y |Jg'w`1]KmCk4]QIz7n[_gPG C(3HB}Fund vd<{lQ~Bm0; EJAuB7H| 0F5(y- ֋lˌkyDܙbr3eI,eFSbn0ײU[OW9{ l0Jg CM!vP<)|Srhawl ~txݷbV4zg hݥB@t܊aR(j7w}xM,7\v=,IT(=c$`z)|fyk 5>sKnw!WsNl~2V}>{ꞧ:<#SJpc悕Ӥ+݈s}V!LL qE77hG{p1|lk#X؍NKKSC.Tr?y?u )_Vg$96n; 6j@iC7~f}b)xYFz_tt'Pf\N5f3 Eֲ= g/B(sPo!Rud[EFH7 qŋSp#_| w㠂ڐ!Ul`XJ-< wB2|Dփ-&|갼 W*H$-sZjq3;Bd%HeT ]lwɰ<ӊ7/(+Vjip*$[̖xä/Ƹj# ܻffɍ|H#tLӵsa(ߣ$G__l6~`]^%.impdQ JąǯlTx )V}moPѰgZ/1?.l@@RPB¼B:gf @Ftwq:A+ȫ{j\ }umYSm:ptbLcwRيG1|ijF(0.d&<]A2y<ߍΛBtZG):zr%ж-=Dxc5*wڶFJ*@w9?.˾6/ (^m\ R5kE}K"Ku iti :ݔ_o}dA'`POVfdžZd[,61tF=l ;| 5z_Mƫ,6oPx/DXpGZjvJI<3%kRjh֑mY啚ʣ!3y.mCo]PIVr;K9/ʡ(SRHN7Z=X[t4uխvzJ4e%^I[Eq޸<`PcJb3vCqK\^X[X[M7s |BVzMZ(s10zZ -+gw;V°Z_:H/SjX_f2x^-p71J*rB!7FS0 z%n~cqK,PT;hRC\]h/z7 };O"m$duF.׾ö/{R >38V |mgV-ڌ ځ=?,XP oOSB`cBAt[{vp/7xvC2z!S2LcZ9)#pgـ 6 F{n.Q 7Vyu55?3'1S9Wd֭,kbD?1]jHMnNjU6=$`'S8NZLXjdH/)Lu$~7dQ\Zz*rGqvgq= F}kw.>F f>+4iS{bj4nAHY)nvy~Dj Xs5'dSW;~bKSU_@~(IT *nԟ3={f#Ke?%,XO43ZX_ /M[t"_s*i/ky?xBJF!gɯb&5ZL<|I`Jy-2bÏ.0]n`Uo1"x:\@=}MҴf^ޕvz Ve@m)#+\RgWVu"_H]sxIPAIŮJb0y{QrG ksƒ2$2>e@k,X+N"wztF.מ;}Ir#/ѓ.~%n%MQY׶JP ,W`z1h.XB0kQぇ^?@Ytkă˄K+( Ǚqm:ei0 }޸YP SaK'U6VPAl?3 "Fk0. ,cwK7Bu BdDG)o= :I|k ig9WDQd LVSh^`"kk_X_3~=eOwҙ \6W/ #ُ-7%,t6rTk;^ #PLC6b؛Tc8'ksFfXTAnTP /T8Xѽ YIakEE۽$~\/Fݣ@xG;,IsCC(w_ } .#bQ^I!NoPa ߚ\;f*Ldb!IagP),#5fcJxd-oEBcAx>W,sqؤN+g!'h~_yfx© z-r$cY qnɤE9'N1`O >ܜFS(pc6>] D۷*ǧqw >l ~>x|0D ADhtkv@o&x@ZZB6qbWEzMW "oDj<襑4Fo721d):O`wayP;8rj|G$sƲ:7i-sѰi4 U%o +k;>O3hAk JqOJ%tH 1?| DOyOP'k\f ^"G)+gEPӨ_ςy}NHjS3Xԋ#i"vy4,p+c7S: 7,SXfrz.3'JCa[2nm_LKSAb U)ЁʲL:`#aPLJMt%<Ոf.>~.ZI тZ0?T0~f"̩/ZyI#xNˋbDAys\WL1|-ff>v{A(#띊 $- the)+@Ɖ 9):))jAɷbCie/R#p@)VIH_ 8&bsk_cQN"qB ETٕ d͓bg0D](V ׿^gBp0 (iƇNr/xeqgZbqYv$@oBl(>˻@g av?uqn\:P:ΑÐwt20 ʈ]'+Կ;e#{95HY6qb^IJeꑽ,7_e0ͬ{M2Iδ&Xf< uڐMټPA]*S*m oָUx'uŷHX dv=^BU N~;?`6kaS TPc6rcEܘMip-;y pKw[88i+C=y_>9ePyIK(O[Cn69k= 7|s/(PTo?s,שs9 |;< 4 Y L=@<Z &6:U^Uf:zG2t6){-a~B9iݭ S7=[/_RV_  ZĂ?XyfDSM/d3aMgll gv&3wu+ϒ&q̞ #).Z"홰H .A>K_- >?trm+jv|Bux/ٛ f* 0rcG}%KY{ 7Ա=҆ד{s!!(\ٺHâ9fQ O@8ׄ1_;s1\ 3[5"\CX{'NVxe#:.7ڠ3|bak;rȴm+>!3!恩eILSVG"n KlAWgFE&?yf!q;sMEmY%? Y*Iη _*%tRy'16,l5 컘 %px@I20s8 4O_uyxTWtgOLVf(\! nb[P0t#_?&s`(n]@+^ Ƃa '40geRcQ:(;+KSDXucXɁ!/y4Rvyw S/#ܦ:94g3ڙVDp0CQ9([<<^~r A=g={ ޘ7TX wDIqJCy ҤPp# 17?udžM$̘giVq%Rp.`;HaO@XM`/6F\=nQ0%Cճ♟)B@T~=a릷3&gi!1*Y!XPo82k\9[ggp_l{5V!$1afh,e$5 NFb#71gGVzPˁ,[9iX5G"d]809Dr\GGJsT jx}:b &U+F$5uPpx'ϲU*ws֮$QQJkհ>mX5P]>g_dሇ͘yɜ'*nz I'@?pH3t#R Yp>oF˾rC,1"r;2%#1@{^5 p?t~=Z;ݘESaIL4+qxtKZ+[Ik tG;i Xq )4RK[E*RW+G$ui&G.G' L-UD7_Oj{U\~tysqu;MBݫhDs7֕lrm sd|{PWr2ОR+AU ʏZFK=m&ַY^9אP&LIo7XH4tE蛜$88e$Ry;X1)]V[l}PPA/{͑=؟OpB9λA1 :'#[x>O҃ 25p( IF~E,~L=Meh.EJ}TSy>aO+K`n'֢ 8B.=lHM44˽[*Dkڞ=d]4CuKA6cGE# u[e8n >*h<kQ!k'mġ9F7l,>8?DjB5TÒ)IHͣ7a3- |T\Jx7AOlfꨪvټ~+zCJ&_'?9?OH- S̮'A؝$XfQR`ġ{!rɯa;Ȇ|l/ PL]bh†́(vڤ?%F2Ӌ4=~=j Y<gvҫIhe~zDcPݨǵ"ْXÒ{js #դ+ADcy٦Mlۣe_g5Nd[ޛv? _qrp~HV-V 8Iaө~x՛KVYP.չe1d z|n[t&$"[i]/3HDJ۸t?!K_`\_TL(DFxe|ڳf{My9[0ɤmޘɼ=cJO@>x7,XQnRQ{|D#%V/)ٍn $X; mX6ue]omE|_c?N|tr#OXeQ۹ U2[W‾zwk)<~$L6֖5o+-!36XYZIY>F\@y -ZQIT73!L]&-}CYnsѷJ|#C~"TQs$NH P{~mS]0h՚FђQ P bLKZ%! ˪Ȁ'=پ94!/*s!5=F3<E_7B_l\D͒ l^/ Nub, f*jnMa,Ljjey!Cd/%Aʖ)Q%^t{GiMn^rщS 6BT3gi{?rPF٘K\͈dG/$;f4%vkvi{#˿$Mm+Gul"V3܋IVO>f&Q HAR|Zy|Fƣ*rڇ; } hFR]3)G\0Q2j>"ߤh'z9-,D Ϊe!X5|:e ظs}e~ha 7l|}HI=Ez6J75D?;G,]OHG 6`(3]QR|b+q:}K=#]ƒTX0HjC?ĴȎLOxߔ JrWXo&F֦DUx6Yƅi=/@~ 1"nȣH$lRڰܩD6z?^r5ċ'=Q>xK8R1nAmÅ R9Pe .$!bFօȕvnlaUIc:v]wMY[҃PCkYz*͢SJc2񗠤 SIdsRk65"a!wk7\oU/fއ5z/.KrؕrL;܁tjV܀mbB=m}K i#P׳u*6dC <-Eb@ -,mJC NMĔ5P'Ácqy )=O:D_T6^q1*1|#t P2N8ꄉkx@}Q eTT?K-op2}I;xi !x 2s+kIUGcu/KC1JX+%*tI Ml 9.((Ij0NS3Bh q`۠5.6#{ΙlEcV3*1xЍw)2OXn,镦xeS9 gL;/-N |ǔ\CF Bix {g=9̺>ӕ]w-a/?0Y!F$k3?dvA!3 6$VXV*LVpd/vJRtYJ㬰I{XH}Uda2l?BtʲHF̝ak(hsGd3_oLv7jvn햻'82o+|lDZX̫L8aPz.N΋*MQua`PBz(;iwґhHph0 p[)PY`Zhu!R$wW=j U<0,(ЈW,;8!~•|Z{zڏAeow|!;VLضl34n@q:tE; rfZ'b7u<5zѱ1 uCeyF'7HK7Doh|-/o-x%7.?1_[>"@ h{cedK^Үve[%9;MdyI#qW!yam42@3k,UTsGd: زx?"9`#ü؇tf3sRH` [tJk.S|? @F;1 N TRK7@(;me^cs7u'?>H()L?ebB#ZmwwM\ ^[ ƚҹ;؜>nxa󘴛AǺA ͊[9@s;A.(!z(P#YrKNSLړ[K99cb63C_TEkrJ5Ҷ`Iba05r\̬?M{QwT9UAY`M次2D~Χ J;U]`@^4$v 1bDyԉΫ=ܢ޳V/ՔƹςQUá&\"rqvObVan6+Wer) 8ۃx=g#"* !F8zӘ?+G#"|͚> z%/> A'vm.l_!ys<9_mgs:_1o/ҧ÷lHv 1 i8*7lF+N1:`–M|I5}$3e ?8%waB(4]Forߐl*Xm_KkfA4l!@i`لLF]O 0ොGz3K>ӝ@uN?]T".UhQp-/LR_{piXG Aë\?Y ؏r;yiJ _L2W&Qkn7{o;S;X:/o-Ms_* vlhR#EVC{nrro4Sog$ki Q}2c>ĊcSK~Fl {Dž ;ȩG1'Pqf 5D_<2e/Cb g #j;.'RڴsVeP{?:2I#iku5/j:xynIZ 7u7}qḔH|lI6@gq̦Sf8ږDGlqU]a;ۦZr*Rg,7vmSF{(5{AF?8HJrSXa_ 1<2 MR0Wb>su͔TFHT*&K 9.tnH8aL.üS'ނӟnP$~W엻%spnj}iT2b'\_ eyC4+,9>ѶrE3#`E'=ڠ%8$,˞:D6/PIVH\ cRB~ wާ QZ@%E+0܈ 8A^,%5v;bI+>`nJSmi@%X+u]/dv _060pŰ&w5Gl EEsuݷmmˑ$f^4 nx@gzmz>&LPV0R:ܡ#WHE[l#=smB`};zƇ%bɷώ9"k65i@\3u%55}l :iYxGg vZt Z`xTB֬o@ͣ!/kI=yB÷'i?7g6hސ,Nb[9N*&=,:N2UD6K"$*pY3si,KԴ \Cjs59髋sz6 gWvtcܯI ;dh*Dȋl狈_*rMpP0}oHf(..0o/zvqmywxܡv5_|mce:C=eS6D5=lN&e @4*'X}3f'\"v8 9Y2-5 nn]5t"fzX x!? YoV[t I(}-#~d硂:j[ZgԻtVG7lA_`gX"p=&"%K#Ѱix"8dVJ<`3;&R~y Fx#FT W^Gt7BηQƚLً{׿2L59%/_6eDNk{acFUŇu^`lpijV @|[{sR53T S-ulW[PA(3BZ(1کZ}2*?$țuB_\չL#)}I:i n-9E Й#y+Nm㸙5PdA:T2 .Xi1f0c7.dtkwgz{o-z Yw8DĺzhXEneaept׺~wҿ{{ P^rD7=L|֖0"Hp'\."Lu,d["!|~ pwC!LDSzQʷdMU%[Qj_=w"Ykc^;.ƣ14d e﹐C m7J1ԧXnX[L~2*g!3&C'1~ĶKp ڐފNOz}q:Y)f{'cғ. 6M]1GdF滛 :tX824m ZsA`=%:JB2㟿(M6xmw׫L}ׄX?Vo F[o\LdYZ[@<]IGu/0f?8\D)c'>~Ce&@U7C(1Y>Θ _W?O!gVIPGգ|W{XL@`Ӄ$)f5=AWS<ǧMe%b{xPQu4ڍ=Cs!?RwYpwDrĿ1߈B'Pde=^1>QΥ;~f㸓'`:8 dhឭ⌀PM');# \~fzZ9o^Jj٬ !">^u‡#_tj /!yJ,xCԼ1[ƥ2%ܥ=f5ZFsIhXEY&@@ .b ܩt.X !E T?yߣh[ؔp xE Ou;H{@^ΘL w Vy  HQH6%- ;2ܥmţ5&i:X!mh@2߯ o߳X!OUݢj]\NO"/}=mě՞Y9h Ѭ[tF?j2^lZ%}b]&"R5襱GB t }@Dn镦k{XA{VdeE00+V 64WY%x讈ُW*k{g=%%_]ʒg`qkis&Dd.=|cj>QDBP.(@MںJ]E 9? >%ɀX8%v[xf+78ɣnj6b@ٗ*_C蛴lʱYޔ}s 23s#n=$Gl?"@ D`jWxT5ˢT#O rBA+%]NXqǍXx,O5!wJW"qfd'ݥ;y&/Җ\Oeܼ쑷b_)_)EL  UT0WBքC L>.8JD:H v@ە[g}{wUrk{E{ں1AqNf 9+9[>U$ .d>5Zw}@+zDS^7J~ޗ7705jU L1:ѽ>ܰP9N[88PE9hT)--%#tEP( %?h=#Qw4Vpy1u>CW[ߊL|zW6SeDId=; K?JlF&E07=\vWZ 'w'1 WNDۂBYe铔gB{A\Id~Fp(w֧hqxD9w*V#NO Ob#AI3D@JFgTQ [HI}@pf*e_n"QhO)ĕ뫙j(P&oׁSxґYdC&$FznAC5ι+3 }r3Wڻ"pg^+6&@w\Y4}ş=;9K.-X25v@ӯ[ՠ79>",&Ӟ-OrEВC;So"EP,]r}i0(&`GMs>%>khsQt{a5B)[r/ƝyzCIos:Y=4 $m~lw'1SQX&׳+NJA=쉪F]hO lL?DvG" QqX#V,%@7I3N e-Ƭ pgVC|CZCN'rA94Oǭմ2HʸcRIn~j1K~gw;eVrgޚɰ}JztkǞj&h|-f7h"&^HBhe"ROGjȴ&p{tm%eǀ,׼X&;-e Ǐm8 YyktEPU'IJ j;3ѳfELPDKkwCv ^2,=*rŃD"5xWkWDWqM~cEs |Tݯyǿ=WZCzS (.{D_-OkhGoGa};PR3WBѫN v00(PFxWrO?Lit/f1b~SU;P1@6rUDGɰ}tPˤ}^b?d uXFq@4zK~ q .V-۸]!gM6.B?+ܟYÜ4]Lɇ5FP|5>50R=Zn-g:pI,OytxE66C 1N;wq2LcWHmچ@OkF<hc٪Je}5JFYd(0Ç,JFhi=ujdoU1DFxw 2Tx halhU~Cţy4r"]IUNl51l :Zc#p(⪙? !3eU_Ed;WXа".-:de| F:;N:*[lcV[hs<Ƙz$<c=H*:rG̶%9bL'DR%$M~ fq|0q&Y~TT6+ Y-t&ZG0FQ^1k2NK6zq5 r-?R>UMy7A4j3xblu/LWgb$3mp` xM޴(4XqBEbCM=l!CAq_Pv/&dk:Cy:G?h#RPZId J/3PP-P [ EHd8 瑴@ p(H+]dFYl`@W*(.”P4:czPUa; WrA8e,N'xÎm>vK{-VEV^2C2c-'&`=,nз J|)v]{Ro(^xC`XΩz(Du!êTWMImIC"s󥔓L/L~^sQ\i\,^M;yw!G4wlόB&o AU|s!6R9T(ي(/Y6eVs>BY|3*(:pɎkB6*m26]&LZ8Dusz#2pTiob zc\/zP+хVHS*:w4P 7[>~^,_-uKQ2c" waC @*7g M~GGNQA3{:f"OHke.q dǷRteh x8gxvd:QgfE_TI@?߯;4agoQ\RlYy)6\I<@L&Sd-?!$B:hmrE L;XiVВwZ %T{ڊ~kfe`'vd5c!8Q|ݪ*,1o>Dj i'f*"3%ޑu쮾\UUG z8F|^6uC}.(bMaϣRMww?ڀ(^UEomVzgЭOR k18:\*zO/a4œiqZdMZX;HӅ_LE_5Ζ.ӭzG?Ȅ1tI+|Qa[Fy& 撆7dnJNx]/t&"eoV~&fZ(sRhnTuMDl64 vVTt׵F/&FvPʖ7s@n, TbFfr;rBxʛFWὩ} j/BH]yPGS#F菅KK ŧw^],=1rzpHOдUh筦PklZ9%Zf(8J-;-љBa2ÜA )ܦbɊ?Νjuϩ>hw@\>X;vBiNHw%zNCW-;]lUM¼Vi2Bwˁ%v$ B3MGd ϵZDt'U;`"Z6lJZ`o}hʱ n(d}wsP!1-OX;,g5ThWnvG"l42a3t`)`yYtCvRXGQ gŒ0Zxf}F=}]mjJϹФDIFs b=}_B ^0[ۿ o cPk}rS!%Z]iFyt&kLyPp} ^ sۆv놌I"*W@9ܭ6JI%/O}Jf9 $Ii[>bj9Rx1+!XFETʊƪH8gˊ]N% !iI!27 @,TiGř ca2 ?rrX)\[(m]a0GU]/޼E"4-C@cG`(ppxEמ֬CJ}֮b%.U]Xf8 ,WdD7oՇ"pS*b $" |(Ȁ#Csp&,m ?COU(5%|Wmuӎxfm>&yeuAO456\*&˦x&;iVTR$F^"'k3 UdV: ْvLc$ HrUмA!!e H)!]_Vve*!Ad!['66zEk8pĐ׏[26+8mppccFE#DCaw-:Ѝ7ʡ^`$xi_z,fR)|FGn?VGo!s$5,nnl$x qnL>ҡP¹=jvJ ƚZH=6Gm}hw͗pDU jWZ6PBG!jI8{#Fg3F3`AQoskviq .#V-a Q _"PY*@q{nQm&j(|x= R_NwNO:ABp'x(J+{#_XdRPe BK*vy ҃7OWwk @ b>C0P"Q?My$;k~2E=U4UÇP|+.HacQdk퀀0i})fr#Bl x9H }7Cd\(/&\[ 4:B% 0m۩R^V= u3!X)%7bŖP;ίHhW"h+XlCv>$h 8Nv3|ޞB%[Y^2(0f? 0i ?|׃$EHDh4Ū)ZK M|L O؜EPu/|䭚qTtɷy 4b3'θ^Z._vAphx/1axfקyh@J(Il#Tq!ƈCJS+$nGo|L\W3}>Æh)8KQ1`+ULPcI2DJ82l(X:HԔ(it?޸@sХ B+@R56i(WNO X>R8#@q굴I/Znڸ /0/l%#ctTIpf%<&cNln;7.mϪY%s D GVONGM1BɁ^HbO\aN Bŵ`吡 tx VRU1S_Q欈}PyERYL n|[GBn*Ij7;!B*TEU]EY2U*D9$>B{b]5rYBt8=z= MCP-{|EuTXZbH8kBH#_JN@9 %>ĐFP>!_kh;ޫG6}2S2ƒF@ZD/?2k`#mGUCu/ʡ(SR#x'4p(AeB_$ Js+1Kf~]Z*e}O/mJӧNocά爲& 2wK4wy?3[9^(W2Tg:5bS@,A>voF:gq\R=<3&w+ˆ!"W;SF\jFi'W(VC"ƍ{.Wmd/=W[H1t RsHu;WwTDZW<;HKXJ6jw6 `HSJ&x%l("x,R L MtrjV 7,:/AplaKFhCt'xur[3*L۱z}asnD1jĤM- WKbF._3 ]\1+2].M ~8͝c_l[֏_ހRVgSnc O#({Bb<{'g%9-h[9Jc^ɻZx۟E̷D\"TFAq$ (;U[7%da5Ei@^4t6:F 3Ǭ;'VQ\/6vRVg+@VyBv>(9s{+KDOX~.WF& J#BfOhGl 6N TQdY5Ѓ(O!rZҌ_c>&8A\nP|1_wz⫄_:=20b*7V I vF<ˤC}V059qa(0 IvֻEn" Q;5وs&F$;}p$f+2[v];'82BZ.TkӴAC ѕ WRkÏ)1I4降 UȡT@XyD+VWF‚:<ޤUN#> Jb"!i8rQ-Ka75OaoG^cl Wm-+`d"ǮNe˱,.浴#T<0C?:N`YvdYK>ĸ??Y9 t L #'VxIUG72$|Cɮ^Wk29p@YɈ%QAògf\XmL:”עUBUHxHEN`4ac% ݟY<] Wje6PCAs/Vj ]ty&5*lErS@QDe|0B }נ =wQY8x7?oA]6"D;jKq<|,Q&be$0`VlW'#<'5}n .x_F;I6/_bjcRLlUJ:8Gǥ]1:|ϝÔ/4DMקy?9/ ~7'yC[6~{R杀U۱[&6u}NpOXc訸T0c}A9z}P'78>6cfH>U¢;Tؼ~(rӁ9:6A P#1kOSN!!B_Yfȟջl N7Jӗռozpfk]|V!̽Z`F?Za(,vKB?o׹{$!>BT*z߿RN1b d<!.WYai/:65 ʸ18<6czÝ?%N/!=v `Z}6F`yx`/wج9sy$w̖;uBf=.2˒Ҏ_S.3 bW qچd:fkߔݮmKe"S+SY:Q> %"&TԒxQ##żh?z`9XF~A)%[nYRM6]aCEU-+.M^2N3F|A5\_[a6{(o+* n!TnvsFIv] چz51,)]&MPpK}RmZbpԉʿ-Pב0khY`{tݬ[8:}4 iŪBSaFo: MqM@ߛ,FܓcDc2"ngtJD@9|C^M"*k7 qTgT+wׅN|l|wp[2e(9ђf2\.DJr\2j9) Sm/ZEU㮌zj'YOE4:g"^V{] >n9ǨH9XLE&&HW 3/Grߤ~Fxh#Y-z[\$l)-l~N6xTu-K~>od Q_H| -?Rܬq)iy: ~؆6N{chd+왦ekxc\ˆ'Y?->ԟ'K|vĒG*adcX{tW`$ Ub,W#.scv!E< 2b3~?KvR|n+y 7/j֍"oFnP[R zGg(enŏ7 hjtYS;qeNd"RG+'U5s;6-DLv{)P{Kvs_MĝA)UĬ*9U,(E*џ]G9\p@ρq-P"?a⺆b!BR}QW|g~woR!A /u?*'bopǩ`)l_ 9]J9"ljbE$ Dh}` #)7$'c%*㔦\S8;)JږCtZ'yK4zģΟ #iŃ,݈C(ӧ逶d{N)߇k LLccٙg˻($_]͖:Sa*3G+2ڶxTMuVbQm3%l>}]T2Hh"Tl\w壘(CDkUBt/3\zr#N%sW'nbƮt'Po:iBp!;}U@p7cь e;?1fh1,UB? G #R=Da9A@L ֭ O.g`jXe< _&c$oF䜉 q~ΑѨW:X'+=@V#"? Xtj'^QW q4,i5 {.+S$Փݤy©zC;`;wQ|'7 :~H[-=;V#߈ifn3QmW5밉_+ZgkJ>@m? R mhKo_j=&V4(2Y~ya˻ y?x|72C̪vF;X5H0܁{֨/jzeXvw{.yR+CdUPUX1lyo+kഓuxxCo>^-mN[ԭ@0!6ǭJ tT,6bɕ~Ns&5:0@ X9kY%]h(g<0.t5:k|pz^Oxq3wsBAg5dSjj$\v| 7''p-f`:x&Vm‡S2zyqN9z ] ۟A=p{%j4'1c*9"5*.ο'.ot).W;!. %/J:A%vksOq M):SK3N3)2V.? qP^o=p6LQ_} o. ' e4Q+3f ?∸Z'bU j6bX#00 Ad@h틄T(W+X75T$<MPIYj0q;H}P- `T{WO9ٺ&R nw,7Hү cG>95Kfy֧7 \&>g  $0).\=(j wNn]5Y{Oq?hn0ܻIf"mǘee?^p'T/bO t3dvEqsӌI@WFuyțրU1xMOnvoDXDŏ~tswˀ~we(`0swICM9hXfek&=Ď%ȬO ]7cm'c7!Es6ve`9-}L`B Rv$l׊OIɩ"htfZ5ՌoTfv@YR؂oSOTuܬE]yYR?]f{vr ˒*RxxnX9sgWҰsWkL*8JM R0#BTiwkqƔC|#0]jrwZZ}3pahB0U`!D-&viսŦ.+rBy J Y}8ϥ'2:jErfz F O+$w|~SRGx,4G0{樐}p3ʐCTsxUG?}E ~$[y/l|RҹHџ+8!rO;|*@N}G-S|vWKZ/ܵ,a,9%7 &Sf =8󜙔sWFc+{N` MXIڲLJ;bQN{&=Jc kRf(ytYd!o1LAVVsI #J 5֬jܩTxQg h)KL Vet*r0HÚvK]vs Gt2m$ Aׅ.S0J?*Smw̏*Ң4tQ yFL0T2VrX{B [{ӋwʍKabF) y}y b,<:Ƣ@Hxv &03p,K"9ށ:Ao>a#mfTXIPGd]JwVCwtN"q[WSeY% 3[秾ˬ0{]dhqD[W,#-.m@%)f?^Z7nOI͵sYfxhmd=ѓ8N:%O#(#={"VŅW4T3=sfΥyvТNˏG^\Bf|j¢ }$ެqZZ%cCCpCι,1!kB(R_~>%)% V ?Ji![\ϵBBti㈓dLn{z6p($dhuZ026sOZn;cidz4lL tDybUHZr{d G]9Fb^y3WLp/1$niK#A>ZOv4!0(.윩1I&x7י0B~)@ҡ|*1.0L NUTa&i'v{Х?DWϙHY4 Ɣx8WrS~6;?α㸺?Ȳg/rǨ3p~*TkxԔzߊJLw Y+tikѢyH.5NuadδkϣϬ ZΪc#MR*@=x'G[T(>Ti\͆tf#If'wjAL!['b6/tZOOx|~;1$RBqʵ ,*)H)nr2 Qd2BXKXQw3C&dZɊUY]cgy'WhvP4 +;ܔ]5ËA1En,7Ի UlYP6Fgu\<k>Aa\1ʍ}}=w/@11BYu q<)s5m=SЖKg^Q֜\X-KoBcS[y ,,dp $z\6۬Q\}Ix1Mi'8riPT~q:HWJLq4,$EfOrBb[OaiLe'2_0їv'-S2[d:Ҏ3fd5 4~q 9 B;le,T=+RڨN}%Ns5fwz+D:CgâNj$Dp2!~C; Jt@mwWy xu̡E7v# s8oDׁj[)\ȼ N _Td=fS 40 PikKSx"|ɻ_BlܓwR mep3d iɠ?2NHЃgjI}x8f"=Qo0>E' u@. ũ}$JF frP1F. e^NoRl>noOҐc\M)q~gW`P䟉,{ ~>ӣF7fE%@/]:.tkQ6MßIs% UF{DR0Kq! Ԍ=lIOo346 s):ҵC@aP4O 8ϜȪx7tߎm(TUa@} ~If>HŮp%XBɏN @]o..IIJߎ__953sQ/%| %=/Eq9f ˯/&s8|UD>ǫ</En?D9GJ2Q`ٰBiz>(Q{-ܢ(>k-b$Z*Ȼ?]̓.ޚ,2S6 u׌`u݀I%Qh~G>Vx*bI;>}^JrsomR/#/QףK.잼|##߷P#LaϵH5x/.d> j wXMZ'4Xj֬2C d,Ѽߛ~} =QOjs N_a;.'9B:Q66Q1NF[KɕO%)(r[?c1?#~26vȅʢ.THaŮ Pѻ $1fQGDBny%-56[Q@n^a9mVLP.Ij0b/+LCEc^"P}h6\]T KDU>ֹ62V..3S4+Hh2cB ɡEa͋_g$XM]ΗS*gjSP4"V|h2gO;L:8/sɀ?M`<1QyŽ;-5UkqsU7L`e"Gk8_gkH7~E#!)|ژ Sۢ(r`IC.ƪ9Syl Sү'yG `>1+CLwXm\zqCz*rDpQ^P &);sa^NWqd=ҡVàprY z A^jkZ-3[kvOj.ZbZ2Nh.QݽwK}#QӗLJ4"_"{?@~٣?[!MB7)0Jkl śv5?'1މ7_6Uf8O&v{utcK/t;DWr3|/Ƕ` !t`PbRDT2{gTUjrs5G?[r082Owž+8sLo `*O\--9rZ2(EIO<5d Yvd1KŎ upBp' ,I:6;<&6 @$ /HKnh^ v,I+hH5gL<-%&Op5%/Dl{h&s&$[V (e 7ʯY[\㻇2k gRa|0-D $S{ >91\cr_Dl#c-dޓe)̢إ 6Y(XhwAiI!8L] kJ5OA]b AלP )e|iڶ>B{mJ"˒7#盃EԄ$S$f \vJYAZ;y*0<-Ā8F(dݿ„%;Jkp#&d1ބU>uCR.1݊m;'gjs~&y$ 7;峴{ R ;F҃wU]NS1wMD4nB Du)T93aYl0SݮZ+(J!wOg8[y3kHRP>WMOrpn |g9B+\f RC/=۠H:Ii.sGo )/<ݓ=L >s~:5K"'g@|foǷ7j96rQA$$bj xqYAVڧm(VkHa#XZ0  ~| )fP_p#zSL DgŻ2031'j.dHӼBeC(5 &{=B`9h];@8e%7gsW:'o4Ũ>ޟ3t kxzHj(;Z@"O.= 9=xj5o qiaic#OBB64TT+TUl 5;M!*]us!?I>fɧe86cbTe$擄rŽa %DB-ǣh?;M[" l=) ;em OE> 7Ri&ZՑa\u*xHp{j!IALX뾐US@5fr_^M*/w7WhA#R& L!T3'Oޱ`NOH9ep=$~٣#* &&boffNjPv°d$~C|ulm|wgqL.FR Av$x~SLfzbԤ, #}7/l8)hYxCT臶|Ͽ#Zڐ/ga(MJM\ ҭíN爻*۴,ɦA^}5i\/N);ʖ/Ug+]|eϑsrD A+7 U:ZŦP+}cكAEq@AkM/8f>A5'A ³TAW\\m H_dnCx^%N1s1˓Ũ!ER;*"=TiC* zɞ&|`h[_{b(.CcəHnCաB2R_V`IYIv`>A\ځGKprvRx[uAk! }u%"`%7s9AO-ky }1bASg}dC 5铑F-S21v!g #OԴt\ UH -R&z5e0i@測,bբSu zCIϢjfa5坲~0"ndg30Y2cnnpNrpF|&)ʰ9ҷr!{^+FE#ueмW-]ѯh^wIeK!a&%! xzR(4F}<0:Ř)Sǫo֮sx)8D+܈cƳ(DԦُ'mbFs! TFy Ewt0ݺ,x؄ڠV(6\2 ~Ma=Ŀ ` ?l` ]U8<Z+OI}'Ԏ8ÿhs̝KfusDyMu;],-ogո_c[Eq7/MJXrwAʷ6s*Bj F#*ifVbPv]`O8 +: OFIg+PKhS0.LLs,vj1ܖb$`}ϯc2YI{1O*C2N:}M(3%3c[5vۋ$>~v.Y8le @a?6XٽU-鸰i[h+%;G|&aMq߆ hP)$ Io t/VZqZ T bMk$Q#^5MKCml,2;|R %͊Ǟr&>Wk10lT0}* &a=ڮ޶k6x|_ E [BXR+׳͜5zO&ıRҜk;F&=>-܇*HX^Ȼ+[jf+ÚO΍Vn."}յik>ׇ_{hnSYۡ0ՏH!}wݝЍ'Oڿ {L/$1,-s($\Zٍ%hWR3 aF`1v[( od~1^p%k5ŇU/WP.sֹv_uQin:KRbԎ)őqhI/|~9 ,AUWeHWDA ljT_VS"nC3@x!iud=hhESɊ{ÓHf{>P ? B"0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019044l.pfm000066400000000000000000000111161404163720200221030ustar00rootroot00000000000000NCopyright 1999 URW Software. See file COPYING for license.op ,,4 u,K2uHH#2PostScriptNimbusSanLConNimbusSanL-BoldCondP? PPPP#~PPP~#~P#P###?~??44#444#\/\H+PPPPPP4P####PP~~~~~~PPPP##1,7,A,F,N, P,T,U,V,W,Y,k,r,v,w,y,,,,,,,,,,A-F-K-L-P-R-T-V-W-X-Y-k-r-v-w-y----1.7.A.F.N. P.T.U.V.W.Y.k.r.v.w.y..........10,1.1011121314151617181911272137304 14243444 5464 7484 94 15751676071727374757677787971878197:T:V:W:Y:r:t:v:w:y:T;V;W;Y;r;t;v;w;y;-ABACADAFAGAJALANAOAPASATAUAVAWAYAAAAAAAAAAAAAAAAACKCLCNCRCTCVCWCXCYCCCCCCCAGKGLGNGRGTGVGWGYGGGGGGGCHDJFJPJTJCKAOBOCOFOKOLONOROTOVOWOXOYOOOOOOOAQXQQQQQQQKSLSTSVSWSYStS-TATDTGTKTLTOTRTSTVTWTYTiTnToTTTTTTTTTTTTTTTTTTAULURUUUUUUU-VAVBVDVGVLVOVRVSVTVVVV VVVVVVVVVVVVVV-WAWBWDWGWLWOWRWSWTWWW WW WWWWWWWWWWDXOXX-YAYBYDYGYLYOYRYSYTYYYYYYYYYYYYYYYYYYAaFaKaNaPaRaTaVaWaXaYafagakaratavawaxayaaaaAbbbbbAcTcqcrcvcwcxcyccccAdrdddddAeFeKeNe PeReTeVeWeXeYefege keretevewexeyeeeffrfAgTgVgWgYgkgrgvgwgyggggchrhthFiTiViWiYifiriFjTjajfjijrjckrkflglrlvlwlylUmrmmmUnrnnnAoFoKoNoPoRoToVoWoXoYofokorotovowoxoyoooooUpYpmpnprpppAqrqxqqqqFrTrUrVrWrgrrrrrrTsfsksrsvswsyssAtStetftotptrtstttttttAuFuKuLuNuRuTuVuWuXuYukuquruuuuAvTvYvZvavbvevlvmvnvovrvvvvvvvvvvvvvvvAwTwawbwewmwnwowrwwwwwwwwwwwwwwwexoxrx xAyKyLyRyTyVyWyXyZyaybyeyhylymynyoypyryyyyyyyyyyyyyyyrzATVWYċŋBKRT,.ALaef hnor stuĒŒ,.ALĔŔFPRfrATVWYīūDFGTVWY-BCDFGLNOPSTUVWYBDFGTUVWY½BDFGTUVWYý-BCDFGJLNOPSTUVWYĽ-BCDFGJLNOPSTUVWYŽ- BCGJLNOPSTUVWYALNRBLTVWYBCKLNRTVWYBLTVWYLTVWYABCFKLNRTVWXYBTVWYAAAALRrvwyFNPRfkrtvwyrvwyvwyFKNPRfgkrtvwyFKNPRfgkrtvwyFKNPRTVWYfgkrtvwyArrvwyFN PRfg krtvwxyrvwyrvwyFKNPRfgkrtvwyrFKNPRfgkrtvwyFNPTVWYfrvwyRKLNRkgnustep-back-0.29.0/Fonts/Helvetica.nfont/n019063l.afm000066400000000000000000000762341404163720200221010ustar00rootroot00000000000000StartFontMetrics 3.0 Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development Comment Creation Date: 12/22/1999 Comment See the file COPYING (GNU General Public License) for license conditions. FontName NimbusSanL-ReguCondItal FullName Nimbus Sans L Regular Condensed Italic FamilyName Nimbus Sans L Weight Regular ItalicAngle -9.0 IsFixedPitch false UnderlinePosition -100 UnderlineThickness 50 Version 1.05 Notice (URW)++,Copyright 1999 by (URW)++ Design & Development EncodingScheme AdobeStandardEncoding FontBBox -139 -286 915 951 CapHeight 718 XHeight 523 Descender -207 Ascender 718 StartCharMetrics 316 C 32 ; WX 228 ; N space ; B 21 0 21 0 ; C 33 ; WX 228 ; N exclam ; B 74 0 278 718 ; C 34 ; WX 291 ; N quotedbl ; B 138 463 359 718 ; C 35 ; WX 456 ; N numbersign ; B 60 0 517 688 ; C 36 ; WX 456 ; N dollar ; B 57 -115 506 775 ; C 37 ; WX 729 ; N percent ; B 120 -19 729 703 ; C 38 ; WX 547 ; N ampersand ; B 63 -15 530 718 ; C 39 ; WX 182 ; N quoteright ; B 124 463 254 718 ; C 40 ; WX 273 ; N parenleft ; B 89 -207 372 733 ; C 41 ; WX 273 ; N parenright ; B -7 -207 276 733 ; C 42 ; WX 319 ; N asterisk ; B 135 431 389 718 ; C 43 ; WX 479 ; N plus ; B 70 0 497 505 ; C 44 ; WX 228 ; N comma ; B 46 -147 175 106 ; C 45 ; WX 273 ; N hyphen ; B 77 232 293 322 ; C 46 ; WX 228 ; N period ; B 71 0 175 106 ; C 47 ; WX 228 ; N slash ; B -17 -19 370 737 ; C 48 ; WX 456 ; N zero ; B 77 -19 499 703 ; C 49 ; WX 456 ; N one ; B 170 0 417 703 ; C 50 ; WX 456 ; N two ; B 21 0 506 703 ; C 51 ; WX 456 ; N three ; B 61 -19 500 703 ; C 52 ; WX 456 ; N four ; B 50 0 472 703 ; C 53 ; WX 456 ; N five ; B 55 -19 509 688 ; C 54 ; WX 456 ; N six ; B 74 -19 504 703 ; C 55 ; WX 456 ; N seven ; B 112 0 549 688 ; C 56 ; WX 456 ; N eight ; B 60 -19 497 703 ; C 57 ; WX 456 ; N nine ; B 67 -19 499 703 ; C 58 ; WX 228 ; N colon ; B 71 0 247 516 ; C 59 ; WX 228 ; N semicolon ; B 46 -147 247 516 ; C 60 ; WX 479 ; N less ; B 77 10 526 496 ; C 61 ; WX 479 ; N equal ; B 52 115 515 390 ; C 62 ; WX 479 ; N greater ; B 41 10 490 496 ; C 63 ; WX 456 ; N question ; B 132 0 500 727 ; C 64 ; WX 832 ; N at ; B 176 -19 791 737 ; C 65 ; WX 547 ; N A ; B 11 0 536 718 ; C 66 ; WX 547 ; N B ; B 61 0 583 718 ; C 67 ; WX 592 ; N C ; B 88 -19 640 737 ; C 68 ; WX 592 ; N D ; B 66 0 626 718 ; C 69 ; WX 547 ; N E ; B 71 0 625 718 ; C 70 ; WX 501 ; N F ; B 71 0 603 718 ; C 71 ; WX 638 ; N G ; B 91 -19 655 737 ; C 72 ; WX 592 ; N H ; B 63 0 655 718 ; C 73 ; WX 228 ; N I ; B 75 0 279 718 ; C 74 ; WX 410 ; N J ; B 39 -19 476 718 ; C 75 ; WX 547 ; N K ; B 62 0 662 718 ; C 76 ; WX 456 ; N L ; B 62 0 455 718 ; C 77 ; WX 683 ; N M ; B 60 0 749 718 ; C 78 ; WX 592 ; N N ; B 62 0 655 718 ; C 79 ; WX 638 ; N O ; B 86 -19 677 737 ; C 80 ; WX 547 ; N P ; B 71 0 604 718 ; C 81 ; WX 638 ; N Q ; B 86 -56 677 737 ; C 82 ; WX 592 ; N R ; B 72 0 634 718 ; C 83 ; WX 547 ; N S ; B 74 -19 584 737 ; C 84 ; WX 501 ; N T ; B 122 0 615 718 ; C 85 ; WX 592 ; N U ; B 101 -19 653 718 ; C 86 ; WX 547 ; N V ; B 142 0 656 718 ; C 87 ; WX 774 ; N W ; B 138 0 886 718 ; C 88 ; WX 547 ; N X ; B 16 0 647 718 ; C 89 ; WX 547 ; N Y ; B 137 0 661 718 ; C 90 ; WX 501 ; N Z ; B 19 0 607 718 ; C 91 ; WX 228 ; N bracketleft ; B 17 -196 331 722 ; C 92 ; WX 228 ; N backslash ; B 115 -19 239 737 ; C 93 ; WX 228 ; N bracketright ; B -11 -196 302 722 ; C 94 ; WX 385 ; N asciicircum ; B 35 264 442 688 ; C 95 ; WX 456 ; N underscore ; B -22 -125 443 -75 ; C 96 ; WX 182 ; N quoteleft ; B 135 470 265 725 ; C 97 ; WX 456 ; N a ; B 50 -15 458 538 ; C 98 ; WX 456 ; N b ; B 48 -15 479 718 ; C 99 ; WX 410 ; N c ; B 61 -15 454 538 ; C 100 ; WX 456 ; N d ; B 69 -15 534 718 ; C 101 ; WX 456 ; N e ; B 69 -15 474 538 ; C 102 ; WX 228 ; N f ; B 71 0 341 728 ; C 103 ; WX 456 ; N g ; B 34 -220 500 538 ; C 104 ; WX 456 ; N h ; B 53 0 470 718 ; C 105 ; WX 182 ; N i ; B 55 0 252 718 ; C 106 ; WX 182 ; N j ; B -49 -210 252 718 ; C 107 ; WX 410 ; N k ; B 55 0 492 718 ; C 108 ; WX 182 ; N l ; B 55 0 252 718 ; C 109 ; WX 683 ; N m ; B 53 0 699 538 ; C 110 ; WX 456 ; N n ; B 53 0 470 538 ; C 111 ; WX 456 ; N o ; B 68 -14 479 538 ; C 112 ; WX 456 ; N p ; B 11 -207 479 538 ; C 113 ; WX 456 ; N q ; B 69 -207 496 538 ; C 114 ; WX 273 ; N r ; B 63 0 365 538 ; C 115 ; WX 410 ; N s ; B 52 -15 434 538 ; C 116 ; WX 228 ; N t ; B 84 -7 302 669 ; C 117 ; WX 456 ; N u ; B 77 -15 492 523 ; C 118 ; WX 410 ; N v ; B 98 0 495 523 ; C 119 ; WX 592 ; N w ; B 103 0 673 523 ; C 120 ; WX 410 ; N x ; B 9 0 487 523 ; C 121 ; WX 410 ; N y ; B 12 -214 492 523 ; C 122 ; WX 410 ; N z ; B 25 0 468 523 ; C 123 ; WX 274 ; N braceleft ; B 75 -196 365 722 ; C 124 ; WX 213 ; N bar ; B 74 -19 265 737 ; C 125 ; WX 274 ; N braceright ; B 0 -196 291 722 ; C 126 ; WX 479 ; N asciitilde ; B 91 181 476 322 ; C 161 ; WX 273 ; N exclamdown ; B 63 -195 267 523 ; C 162 ; WX 456 ; N cent ; B 78 -115 479 623 ; C 163 ; WX 456 ; N sterling ; B 40 -16 520 718 ; C 164 ; WX 137 ; N fraction ; B -139 -19 396 703 ; C 165 ; WX 456 ; N yen ; B 67 0 573 688 ; C 166 ; WX 456 ; N florin ; B -43 -207 537 737 ; C 167 ; WX 456 ; N section ; B 63 -191 479 737 ; C 168 ; WX 456 ; N currency ; B 49 99 530 603 ; C 169 ; WX 157 ; N quotesingle ; B 129 463 233 718 ; C 170 ; WX 273 ; N quotedblleft ; B 113 470 378 725 ; C 171 ; WX 456 ; N guillemotleft ; B 120 108 454 446 ; C 172 ; WX 273 ; N guilsinglleft ; B 112 108 279 446 ; C 173 ; WX 273 ; N guilsinglright ; B 91 108 257 446 ; C 174 ; WX 410 ; N fi ; B 71 0 481 728 ; C 175 ; WX 410 ; N fl ; B 71 0 479 728 ; C 177 ; WX 456 ; N endash ; B 42 240 510 313 ; C 178 ; WX 456 ; N dagger ; B 110 -159 510 718 ; C 179 ; WX 456 ; N daggerdbl ; B 43 -159 511 718 ; C 180 ; WX 228 ; N periodcentered ; B 106 190 211 315 ; C 182 ; WX 440 ; N paragraph ; B 103 -173 533 718 ; C 183 ; WX 287 ; N bullet ; B 74 202 339 517 ; C 184 ; WX 182 ; N quotesinglbase ; B 17 -149 147 106 ; C 185 ; WX 273 ; N quotedblbase ; B -5 -149 260 106 ; C 186 ; WX 273 ; N quotedblright ; B 102 463 367 718 ; C 187 ; WX 456 ; N guillemotright ; B 98 108 433 446 ; C 188 ; WX 820 ; N ellipsis ; B 94 0 744 106 ; C 189 ; WX 820 ; N perthousand ; B 72 -19 844 703 ; C 191 ; WX 501 ; N questiondown ; B 70 -201 438 525 ; C 193 ; WX 273 ; N grave ; B 139 593 276 734 ; C 194 ; WX 273 ; N acute ; B 203 593 390 734 ; C 195 ; WX 273 ; N circumflex ; B 121 593 359 734 ; C 196 ; WX 273 ; N tilde ; B 102 606 402 722 ; C 197 ; WX 273 ; N macron ; B 117 627 384 684 ; C 198 ; WX 273 ; N breve ; B 137 595 391 731 ; C 199 ; WX 273 ; N dotaccent ; B 204 604 297 706 ; C 200 ; WX 273 ; N dieresis ; B 138 604 363 706 ; C 202 ; WX 273 ; N ring ; B 175 572 330 756 ; C 203 ; WX 273 ; N cedilla ; B 2 -225 191 0 ; C 205 ; WX 273 ; N hungarumlaut ; B 129 593 463 734 ; C 206 ; WX 273 ; N ogonek ; B 35 -225 204 0 ; C 207 ; WX 273 ; N caron ; B 145 593 384 734 ; C 208 ; WX 820 ; N emdash ; B 42 240 875 313 ; C 225 ; WX 820 ; N AE ; B 7 0 899 718 ; C 227 ; WX 303 ; N ordfeminine ; B 82 304 368 737 ; C 232 ; WX 456 ; N Lslash ; B 34 0 455 718 ; C 233 ; WX 638 ; N Oslash ; B 35 -19 730 737 ; C 234 ; WX 820 ; N OE ; B 80 -19 915 737 ; C 235 ; WX 299 ; N ordmasculine ; B 82 304 384 737 ; C 241 ; WX 729 ; N ae ; B 50 -15 746 538 ; C 245 ; WX 228 ; N dotlessi ; B 78 0 241 523 ; C 248 ; WX 182 ; N lslash ; B 34 0 284 718 ; C 249 ; WX 501 ; N oslash ; B 24 -22 531 545 ; C 250 ; WX 774 ; N oe ; B 68 -15 791 538 ; C 251 ; WX 501 ; N germandbls ; B 55 -15 539 728 ; C -1 ; WX 592 ; N Udieresis ; B 101 -19 653 901 ; C -1 ; WX 592 ; N Uacute ; B 101 -19 653 929 ; C -1 ; WX 547 ; N Scedilla ; B 74 -225 584 737 ; C -1 ; WX 501 ; N Tcaron ; B 122 0 615 929 ; C -1 ; WX 547 ; N Scaron ; B 74 -19 584 929 ; C -1 ; WX 592 ; N Rcaron ; B 72 0 634 929 ; C -1 ; WX 592 ; N Racute ; B 72 0 634 929 ; C -1 ; WX 547 ; N Sacute ; B 74 -19 584 929 ; C -1 ; WX 638 ; N Otilde ; B 86 -19 677 917 ; C -1 ; WX 456 ; N ucircumflex ; B 77 -15 492 734 ; C -1 ; WX 638 ; N Ohungarumlaut ; B 86 -19 679 929 ; C -1 ; WX 592 ; N Uhungarumlaut ; B 101 -19 656 929 ; C -1 ; WX 547 ; N Yacute ; B 137 0 661 929 ; C -1 ; WX 592 ; N Eth ; B 57 0 626 718 ; C -1 ; WX 592 ; N Dcroat ; B 57 0 626 718 ; C -1 ; WX 501 ; N Zacute ; B 19 0 607 929 ; C -1 ; WX 592 ; N Uring ; B 101 -19 653 951 ; C -1 ; WX 456 ; N gbreve ; B 34 -220 500 731 ; C -1 ; WX 456 ; N eogonek ; B 69 -225 474 538 ; C -1 ; WX 456 ; N edotaccent ; B 69 -15 474 706 ; C -1 ; WX 456 ; N ecaron ; B 69 -15 476 734 ; C -1 ; WX 592 ; N Ugrave ; B 101 -19 653 929 ; C -1 ; WX 547 ; N Thorn ; B 71 0 584 718 ; C -1 ; WX 456 ; N eacute ; B 69 -15 482 734 ; C -1 ; WX 456 ; N edieresis ; B 69 -15 474 706 ; C -1 ; WX 503 ; N dcaron ; B 69 -15 643 718 ; C -1 ; WX 410 ; N ccedilla ; B 61 -225 454 538 ; C -1 ; WX 410 ; N ccaron ; B 61 -15 484 734 ; C -1 ; WX 410 ; N cacute ; B 61 -15 480 734 ; C -1 ; WX 456 ; N aogonek ; B 50 -225 458 538 ; C -1 ; WX 456 ; N aring ; B 50 -15 458 769 ; C -1 ; WX 456 ; N atilde ; B 50 -15 486 722 ; C -1 ; WX 456 ; N abreve ; B 50 -15 482 731 ; C -1 ; WX 456 ; N egrave ; B 69 -15 474 734 ; C -1 ; WX 456 ; N agrave ; B 50 -15 458 734 ; C -1 ; WX 456 ; N aacute ; B 50 -15 482 734 ; C -1 ; WX 456 ; N adieresis ; B 50 -15 458 706 ; C -1 ; WX 592 ; N Uogonek ; B 101 -225 653 718 ; C -1 ; WX 456 ; N ugrave ; B 77 -15 492 734 ; C -1 ; WX 456 ; N uacute ; B 77 -15 492 734 ; C -1 ; WX 456 ; N udieresis ; B 77 -15 492 706 ; C -1 ; WX 254 ; N tcaron ; B 84 -7 394 718 ; C -1 ; WX 410 ; N scommaaccent ; B 52 -286 434 538 ; C -1 ; WX 501 ; N Zcaron ; B 19 0 607 929 ; C -1 ; WX 456 ; N ecircumflex ; B 69 -15 474 734 ; C -1 ; WX 592 ; N Ucircumflex ; B 101 -19 653 929 ; C -1 ; WX 456 ; N acircumflex ; B 50 -15 458 734 ; C -1 ; WX 501 ; N Zdotaccent ; B 19 0 607 901 ; C -1 ; WX 410 ; N scaron ; B 52 -15 453 734 ; C -1 ; WX 547 ; N Amacron ; B 11 0 555 879 ; C -1 ; WX 410 ; N sacute ; B 52 -15 459 734 ; C -1 ; WX 501 ; N Tcommaaccent ; B 122 -286 615 718 ; C -1 ; WX 547 ; N Ydieresis ; B 137 0 661 901 ; C -1 ; WX 456 ; N thorn ; B 11 -207 479 718 ; C -1 ; WX 547 ; N Emacron ; B 71 0 625 879 ; C -1 ; WX 638 ; N Ograve ; B 86 -19 677 929 ; C -1 ; WX 638 ; N Oacute ; B 86 -19 677 929 ; C -1 ; WX 638 ; N Odieresis ; B 86 -19 677 901 ; C -1 ; WX 592 ; N Ntilde ; B 62 0 655 917 ; C -1 ; WX 592 ; N Ncaron ; B 62 0 655 929 ; C -1 ; WX 592 ; N Nacute ; B 62 0 655 929 ; C -1 ; WX 456 ; N Lcaron ; B 62 0 536 718 ; C -1 ; WX 456 ; N Lacute ; B 62 0 455 929 ; C -1 ; WX 228 ; N Idotaccent ; B 75 0 308 901 ; C -1 ; WX 273 ; N racute ; B 63 0 390 734 ; C -1 ; WX 228 ; N Icircumflex ; B 75 0 370 929 ; C -1 ; WX 456 ; N ohungarumlaut ; B 68 -14 555 734 ; C -1 ; WX 456 ; N otilde ; B 68 -14 494 722 ; C -1 ; WX 481 ; N Euro ; B 0 -13 535 670 ; C -1 ; WX 456 ; N ocircumflex ; B 68 -14 479 734 ; C -1 ; WX 273 ; N onesuperior ; B 136 281 305 703 ; C -1 ; WX 273 ; N twosuperior ; B 52 281 368 714 ; C -1 ; WX 273 ; N threesuperior ; B 74 270 358 714 ; C -1 ; WX 228 ; N Igrave ; B 75 0 288 929 ; C -1 ; WX 228 ; N Iacute ; B 75 0 401 929 ; C -1 ; WX 228 ; N Imacron ; B 75 0 395 879 ; C -1 ; WX 228 ; N Iogonek ; B -15 -225 279 718 ; C -1 ; WX 228 ; N Idieresis ; B 75 0 375 901 ; C -1 ; WX 638 ; N Gbreve ; B 91 -19 655 926 ; C -1 ; WX 592 ; N Umacron ; B 101 -19 653 879 ; C -1 ; WX 547 ; N Kcommaaccent ; B 62 -286 662 718 ; C -1 ; WX 456 ; N ograve ; B 68 -14 479 734 ; C -1 ; WX 547 ; N Scommaaccent ; B 74 -286 584 737 ; C -1 ; WX 547 ; N Eogonek ; B 71 -225 625 718 ; C -1 ; WX 456 ; N oacute ; B 68 -14 482 734 ; C -1 ; WX 547 ; N Edotaccent ; B 71 0 625 901 ; C -1 ; WX 182 ; N iogonek ; B -42 -225 252 718 ; C -1 ; WX 456 ; N gcommaaccent ; B 34 -220 500 818 ; C -1 ; WX 456 ; N odieresis ; B 68 -14 479 706 ; C -1 ; WX 456 ; N ntilde ; B 53 0 486 722 ; C -1 ; WX 456 ; N ncaron ; B 53 0 476 734 ; C -1 ; WX 547 ; N Ecaron ; B 71 0 625 929 ; C -1 ; WX 547 ; N Ecircumflex ; B 71 0 625 929 ; C -1 ; WX 410 ; N scedilla ; B 52 -225 434 538 ; C -1 ; WX 273 ; N rcaron ; B 63 0 384 734 ; C -1 ; WX 547 ; N Egrave ; B 71 0 625 929 ; C -1 ; WX 547 ; N Eacute ; B 71 0 625 929 ; C -1 ; WX 638 ; N Gcommaaccent ; B 91 -286 655 737 ; C -1 ; WX 592 ; N Rcommaaccent ; B 72 -286 634 718 ; C -1 ; WX 547 ; N Edieresis ; B 71 0 625 901 ; C -1 ; WX 456 ; N nacute ; B 53 0 482 734 ; C -1 ; WX 456 ; N uogonek ; B 77 -225 492 523 ; C -1 ; WX 456 ; N umacron ; B 77 -15 492 684 ; C -1 ; WX 592 ; N Dcaron ; B 66 0 626 929 ; C -1 ; WX 217 ; N lcaron ; B 55 0 357 718 ; C -1 ; WX 592 ; N Ccaron ; B 88 -19 640 929 ; C -1 ; WX 592 ; N Cacute ; B 88 -19 640 929 ; C -1 ; WX 592 ; N Ccedilla ; B 88 -225 640 737 ; C -1 ; WX 328 ; N degree ; B 138 411 384 703 ; C -1 ; WX 547 ; N Aogonek ; B 11 -225 536 718 ; C -1 ; WX 479 ; N minus ; B 70 216 497 289 ; C -1 ; WX 479 ; N multiply ; B 41 0 526 506 ; C -1 ; WX 479 ; N divide ; B 70 -19 497 524 ; C -1 ; WX 547 ; N Aring ; B 11 0 536 944 ; C -1 ; WX 820 ; N trademark ; B 152 306 866 718 ; C -1 ; WX 273 ; N rcommaaccent ; B 8 -286 365 538 ; C -1 ; WX 182 ; N lacute ; B 55 0 378 929 ; C -1 ; WX 456 ; N omacron ; B 68 -14 479 684 ; C -1 ; WX 547 ; N Atilde ; B 11 0 573 917 ; C -1 ; WX 228 ; N icircumflex ; B 78 0 336 734 ; C -1 ; WX 228 ; N igrave ; B 78 0 254 734 ; C -1 ; WX 456 ; N ncommaaccent ; B 53 -286 470 538 ; C -1 ; WX 182 ; N lcommaaccent ; B 2 -286 252 718 ; C -1 ; WX 479 ; N plusminus ; B 32 0 507 561 ; C -1 ; WX 684 ; N onehalf ; B 93 -19 688 703 ; C -1 ; WX 684 ; N onequarter ; B 123 -19 658 703 ; C -1 ; WX 684 ; N threequarters ; B 106 -19 706 714 ; C -1 ; WX 228 ; N iacute ; B 78 0 368 734 ; C -1 ; WX 547 ; N Abreve ; B 11 0 562 926 ; C -1 ; WX 410 ; N kcommaaccent ; B 55 -286 492 718 ; C -1 ; WX 638 ; N Omacron ; B 86 -19 677 879 ; C -1 ; WX 228 ; N imacron ; B 78 0 362 684 ; C -1 ; WX 456 ; N emacron ; B 69 -15 476 684 ; C -1 ; WX 456 ; N amacron ; B 50 -15 476 684 ; C -1 ; WX 228 ; N tcommaaccent ; B 25 -286 302 669 ; C -1 ; WX 410 ; N ydieresis ; B 12 -214 492 706 ; C -1 ; WX 410 ; N zdotaccent ; B 25 0 468 706 ; C -1 ; WX 410 ; N zcaron ; B 25 0 468 734 ; C -1 ; WX 410 ; N zacute ; B 25 0 468 734 ; C -1 ; WX 410 ; N yacute ; B 12 -214 492 734 ; C -1 ; WX 456 ; N uhungarumlaut ; B 77 -15 555 734 ; C -1 ; WX 456 ; N eth ; B 67 -15 506 737 ; C -1 ; WX 456 ; N uring ; B 77 -15 492 756 ; C -1 ; WX 638 ; N Ocircumflex ; B 86 -19 677 929 ; C -1 ; WX 273 ; N commaaccent ; B 47 -286 163 -60 ; C -1 ; WX 604 ; N copyright ; B 44 -19 687 737 ; C -1 ; WX 604 ; N registered ; B 44 -19 687 737 ; C -1 ; WX 547 ; N Acircumflex ; B 11 0 536 929 ; C -1 ; WX 228 ; N idieresis ; B 78 0 341 706 ; C -1 ; WX 405 ; N lozenge ; B 80 0 447 740 ; C -1 ; WX 502 ; N Delta ; B 5 0 499 688 ; C -1 ; WX 479 ; N notequal ; B 52 10 515 495 ; C -1 ; WX 450 ; N radical ; B 74 -74 593 927 ; C -1 ; WX 547 ; N Agrave ; B 11 0 536 929 ; C -1 ; WX 547 ; N Aacute ; B 11 0 561 929 ; C -1 ; WX 479 ; N lessequal ; B 39 0 543 594 ; C -1 ; WX 479 ; N greaterequal ; B 39 0 507 594 ; C -1 ; WX 479 ; N logicalnot ; B 87 108 515 390 ; C -1 ; WX 585 ; N summation ; B 12 -123 570 752 ; C -1 ; WX 405 ; N partialdiff ; B 21 -10 379 753 ; C -1 ; WX 592 ; N Ncommaaccent ; B 62 -286 655 718 ; C -1 ; WX 456 ; N dcroat ; B 69 -15 573 718 ; C -1 ; WX 213 ; N brokenbar ; B 74 -19 265 737 ; C -1 ; WX 456 ; N Lcommaaccent ; B 62 -286 455 718 ; C -1 ; WX 547 ; N Adieresis ; B 11 0 536 901 ; C -1 ; WX 456 ; N mu ; B 20 -207 492 523 ; C -1 ; WX 228 ; N .notdef ; B 21 0 21 0 ; EndCharMetrics StartKernData StartKernPairs 998 KPX A C -29 KPX A Ccedilla -29 KPX A G -33 KPX A O -30 KPX A Odieresis -30 KPX A Q -30 KPX A T -81 KPX A U -32 KPX A Uacute -32 KPX A Ucircumflex -32 KPX A Udieresis -32 KPX A Ugrave -32 KPX A V -61 KPX A W -43 KPX A Y -82 KPX A a -11 KPX A b -6 KPX A c -11 KPX A ccedilla -11 KPX A comma 0 KPX A d -13 KPX A e -15 KPX A g -16 KPX A guillemotleft -43 KPX A guilsinglleft -39 KPX A hyphen -6 KPX A o -16 KPX A period 1 KPX A q -13 KPX A quotedblright -40 KPX A quoteright -51 KPX A t -17 KPX A u -15 KPX A v -30 KPX A w -25 KPX A y -31 KPX Aacute C -31 KPX Aacute G -34 KPX Aacute O -31 KPX Aacute Q -31 KPX Aacute T -81 KPX Aacute U -33 KPX Aacute V -61 KPX Aacute W -43 KPX Aacute Y -82 KPX Aacute a -12 KPX Aacute b -6 KPX Aacute c -12 KPX Aacute comma 0 KPX Aacute d -14 KPX Aacute e -16 KPX Aacute g -16 KPX Aacute guillemotleft -44 KPX Aacute guilsinglleft -40 KPX Aacute hyphen -6 KPX Aacute o -17 KPX Aacute period 0 KPX Aacute q -14 KPX Aacute quoteright -51 KPX Aacute t -18 KPX Aacute u -16 KPX Aacute v -30 KPX Aacute w -25 KPX Aacute y -31 KPX Acircumflex C -29 KPX Acircumflex G -33 KPX Acircumflex O -30 KPX Acircumflex Q -30 KPX Acircumflex T -81 KPX Acircumflex U -32 KPX Acircumflex V -61 KPX Acircumflex W -43 KPX Acircumflex Y -82 KPX Acircumflex comma 0 KPX Acircumflex period 1 KPX Adieresis C -29 KPX Adieresis G -33 KPX Adieresis O -30 KPX Adieresis Q -30 KPX Adieresis T -81 KPX Adieresis U -32 KPX Adieresis V -61 KPX Adieresis W -43 KPX Adieresis Y -82 KPX Adieresis a -11 KPX Adieresis b -6 KPX Adieresis c -11 KPX Adieresis comma 0 KPX Adieresis d -13 KPX Adieresis g -16 KPX Adieresis guillemotleft -43 KPX Adieresis guilsinglleft -39 KPX Adieresis hyphen -6 KPX Adieresis o -16 KPX Adieresis period 1 KPX Adieresis q -13 KPX Adieresis quotedblright -40 KPX Adieresis quoteright -51 KPX Adieresis t -17 KPX Adieresis u -15 KPX Adieresis v -30 KPX Adieresis w -25 KPX Adieresis y -31 KPX Agrave C -29 KPX Agrave G -33 KPX Agrave O -30 KPX Agrave Q -30 KPX Agrave T -81 KPX Agrave U -32 KPX Agrave V -61 KPX Agrave W -43 KPX Agrave Y -82 KPX Agrave comma 0 KPX Agrave period 1 KPX Aring C -29 KPX Aring G -33 KPX Aring O -30 KPX Aring Q -30 KPX Aring T -81 KPX Aring U -32 KPX Aring V -61 KPX Aring W -43 KPX Aring Y -82 KPX Aring a -11 KPX Aring b -6 KPX Aring c -11 KPX Aring comma 0 KPX Aring d -13 KPX Aring e -15 KPX Aring g -16 KPX Aring guillemotleft -43 KPX Aring guilsinglleft -39 KPX Aring hyphen -6 KPX Aring o -16 KPX Aring period 1 KPX Aring q -13 KPX Aring quotedblright -40 KPX Aring quoteright -51 KPX Aring t -17 KPX Aring u -15 KPX Aring v -30 KPX Aring w -25 KPX Aring y -31 KPX Atilde C -31 KPX Atilde G -35 KPX Atilde O -31 KPX Atilde Q -31 KPX Atilde T -81 KPX Atilde U -34 KPX Atilde V -61 KPX Atilde W -43 KPX Atilde Y -82 KPX Atilde comma 0 KPX Atilde period 0 KPX B A -22 KPX B AE -21 KPX B Aacute -22 KPX B Acircumflex -22 KPX B Adieresis -22 KPX B Aring -22 KPX B Atilde -22 KPX B O -9 KPX B OE -5 KPX B Oacute -9 KPX B Ocircumflex -9 KPX B Odieresis -9 KPX B Ograve -9 KPX B Oslash -7 KPX B V -34 KPX B W -17 KPX B Y -42 KPX C A -32 KPX C AE -31 KPX C Aacute -32 KPX C Adieresis -32 KPX C Aring -32 KPX C H -13 KPX C K -13 KPX C O -13 KPX C Oacute -13 KPX C Odieresis -13 KPX Ccedilla A -37 KPX D A -39 KPX D Aacute -39 KPX D Acircumflex -39 KPX D Adieresis -39 KPX D Agrave -39 KPX D Aring -39 KPX D Atilde -39 KPX D J -9 KPX D T -36 KPX D V -37 KPX D W -19 KPX D X -42 KPX D Y -55 KPX F A -64 KPX F Aacute -64 KPX F Acircumflex -64 KPX F Adieresis -64 KPX F Agrave -64 KPX F Aring -64 KPX F Atilde -64 KPX F J -59 KPX F O -22 KPX F Odieresis -22 KPX F a -32 KPX F aacute -32 KPX F adieresis -32 KPX F ae -32 KPX F aring -32 KPX F comma -107 KPX F e -26 KPX F eacute -26 KPX F hyphen -18 KPX F i -15 KPX F j -15 KPX F o -26 KPX F oacute -26 KPX F odieresis -26 KPX F oe -24 KPX F oslash -24 KPX F period -107 KPX F r -38 KPX F u -34 KPX G A -11 KPX G AE -9 KPX G Aacute -11 KPX G Acircumflex -11 KPX G Adieresis -11 KPX G Agrave -11 KPX G Aring -11 KPX G Atilde -11 KPX G T -38 KPX G V -40 KPX G W -23 KPX G Y -58 KPX J A -30 KPX J AE -29 KPX J Adieresis -30 KPX J Aring -30 KPX K C -41 KPX K G -45 KPX K O -42 KPX K OE -37 KPX K Oacute -42 KPX K Odieresis -42 KPX K S -38 KPX K T 15 KPX K a -15 KPX K adieresis -15 KPX K ae -15 KPX K aring -15 KPX K e -35 KPX K hyphen -43 KPX K o -36 KPX K oacute -36 KPX K odieresis -36 KPX K u -29 KPX K udieresis -29 KPX K y -59 KPX L A 10 KPX L AE 12 KPX L Aacute 10 KPX L Adieresis 10 KPX L Aring 10 KPX L C -36 KPX L Ccedilla -39 KPX L G -40 KPX L O -38 KPX L Oacute -38 KPX L Ocircumflex -38 KPX L Odieresis -38 KPX L Ograve -38 KPX L Otilde -38 KPX L S -20 KPX L T -87 KPX L U -34 KPX L Udieresis -34 KPX L V -87 KPX L W -58 KPX L Y -99 KPX L hyphen -114 KPX L quotedblright -108 KPX L quoteright -120 KPX L u -16 KPX L udieresis -16 KPX L y -53 KPX N A -12 KPX N AE -10 KPX N Aacute -12 KPX N Adieresis -12 KPX N Aring -12 KPX N C -6 KPX N Ccedilla -5 KPX N G -10 KPX N O -6 KPX N Oacute -6 KPX N Odieresis -6 KPX N a -8 KPX N aacute -8 KPX N adieresis -8 KPX N ae -8 KPX N aring -8 KPX N comma -10 KPX N e -5 KPX N eacute -5 KPX N o -6 KPX N oacute -6 KPX N odieresis -6 KPX N oslash -1 KPX N period -9 KPX N u -4 KPX N udieresis -5 KPX O A -36 KPX O AE -37 KPX O Aacute -36 KPX O Adieresis -36 KPX O Aring -36 KPX O T -34 KPX O V -34 KPX O W -16 KPX O X -39 KPX O Y -53 KPX Oacute A -36 KPX Oacute T -34 KPX Oacute V -34 KPX Oacute W -16 KPX Oacute Y -53 KPX Ocircumflex T -34 KPX Ocircumflex V -34 KPX Ocircumflex Y -53 KPX Odieresis A -36 KPX Odieresis T -34 KPX Odieresis V -34 KPX Odieresis W -16 KPX Odieresis X -39 KPX Odieresis Y -53 KPX Ograve T -34 KPX Ograve V -34 KPX Ograve Y -53 KPX Oslash A -33 KPX Otilde T -34 KPX Otilde V -34 KPX Otilde Y -53 KPX P A -71 KPX P AE -72 KPX P Aacute -71 KPX P Adieresis -71 KPX P Aring -71 KPX P J -78 KPX P a -27 KPX P aacute -27 KPX P adieresis -27 KPX P ae -27 KPX P aring -27 KPX P comma -126 KPX P e -31 KPX P eacute -31 KPX P hyphen -36 KPX P o -31 KPX P oacute -31 KPX P odieresis -31 KPX P oe -28 KPX P oslash -29 KPX P period -126 KPX R C -11 KPX R Ccedilla -10 KPX R G -14 KPX R O -11 KPX R OE -7 KPX R Oacute -11 KPX R Odieresis -11 KPX R T -19 KPX R U -13 KPX R Udieresis -13 KPX R V -33 KPX R W -17 KPX R Y -39 KPX R a -11 KPX R aacute -11 KPX R adieresis -11 KPX R ae -11 KPX R aring -11 KPX R e -9 KPX R eacute -9 KPX R hyphen 0 KPX R o -10 KPX R oacute -10 KPX R odieresis -10 KPX R oe -9 KPX R u -8 KPX R uacute -8 KPX R udieresis -8 KPX R y -10 KPX S A -22 KPX S AE -21 KPX S Aacute -22 KPX S Adieresis -22 KPX S Aring -22 KPX S T -22 KPX S V -36 KPX S W -20 KPX S Y -42 KPX S t -10 KPX T A -86 KPX T AE -84 KPX T Aacute -86 KPX T Acircumflex -86 KPX T Adieresis -86 KPX T Agrave -86 KPX T Aring -86 KPX T Atilde -86 KPX T C -34 KPX T G -39 KPX T J -88 KPX T O -34 KPX T OE -28 KPX T Oacute -34 KPX T Ocircumflex -34 KPX T Odieresis -34 KPX T Ograve -34 KPX T Oslash -36 KPX T Otilde -34 KPX T S -23 KPX T V 7 KPX T W 10 KPX T Y 9 KPX T a -83 KPX T ae -83 KPX T c -76 KPX T colon -106 KPX T comma -84 KPX T e -80 KPX T g -78 KPX T guillemotleft -104 KPX T guilsinglleft -100 KPX T hyphen -65 KPX T i -9 KPX T j -9 KPX T o -81 KPX T oslash -76 KPX T period -84 KPX T r -81 KPX T s -78 KPX T semicolon -102 KPX T u -79 KPX T v -87 KPX T w -85 KPX T y -88 KPX U A -37 KPX U AE -38 KPX U Aacute -37 KPX U Acircumflex -37 KPX U Adieresis -37 KPX U Aring -37 KPX U Atilde -37 KPX U comma -30 KPX U m -9 KPX U n -9 KPX U p -7 KPX U period -27 KPX U r -14 KPX Uacute A -37 KPX Uacute comma -30 KPX Uacute m -9 KPX Uacute n -9 KPX Uacute p -7 KPX Uacute period -27 KPX Uacute r -14 KPX Ucircumflex A -37 KPX Udieresis A -37 KPX Udieresis b -7 KPX Udieresis comma -30 KPX Udieresis m -9 KPX Udieresis n -9 KPX Udieresis p -7 KPX Udieresis period -27 KPX Udieresis r -14 KPX Ugrave A -37 KPX V A -63 KPX V AE -64 KPX V Aacute -63 KPX V Acircumflex -63 KPX V Adieresis -63 KPX V Agrave -63 KPX V Aring -63 KPX V Atilde -63 KPX V C -36 KPX V G -39 KPX V O -36 KPX V Oacute -36 KPX V Ocircumflex -36 KPX V Odieresis -36 KPX V Ograve -36 KPX V Oslash -33 KPX V Otilde -36 KPX V S -33 KPX V T 12 KPX V a -52 KPX V ae -52 KPX V colon -48 KPX V comma -77 KPX V e -50 KPX V g -47 KPX V guillemotleft -72 KPX V guilsinglleft -68 KPX V hyphen -33 KPX V i -10 KPX V o -51 KPX V oslash -45 KPX V period -77 KPX V r -43 KPX V semicolon -48 KPX V u -40 KPX V y -19 KPX W A -46 KPX W AE -47 KPX W Aacute -46 KPX W Acircumflex -46 KPX W Adieresis -46 KPX W Agrave -46 KPX W Aring -46 KPX W Atilde -46 KPX W C -20 KPX W G -23 KPX W O -20 KPX W Oacute -20 KPX W Ocircumflex -20 KPX W Odieresis -20 KPX W Ograve -20 KPX W Oslash -17 KPX W Otilde -20 KPX W S -25 KPX W T 13 KPX W a -32 KPX W ae -32 KPX W colon -38 KPX W comma -50 KPX W e -29 KPX W g -27 KPX W guillemotleft -52 KPX W guilsinglleft -48 KPX W hyphen -14 KPX W i -9 KPX W o -30 KPX W oslash -25 KPX W period -50 KPX W r -30 KPX W semicolon -38 KPX W u -28 KPX W y -10 KPX X C -37 KPX X O -37 KPX X Odieresis -37 KPX X Q -37 KPX X a -20 KPX X e -40 KPX X hyphen -45 KPX X o -41 KPX X u -35 KPX X y -50 KPX Y A -84 KPX Y AE -85 KPX Y Aacute -84 KPX Y Acircumflex -84 KPX Y Adieresis -84 KPX Y Agrave -84 KPX Y Aring -84 KPX Y Atilde -84 KPX Y C -48 KPX Y G -53 KPX Y O -49 KPX Y Oacute -49 KPX Y Ocircumflex -49 KPX Y Odieresis -49 KPX Y Ograve -49 KPX Y Oslash -50 KPX Y Otilde -49 KPX Y S -39 KPX Y T 14 KPX Y a -79 KPX Y ae -79 KPX Y colon -67 KPX Y comma -95 KPX Y e -77 KPX Y g -75 KPX Y guillemotleft -106 KPX Y guilsinglleft -102 KPX Y hyphen -72 KPX Y i -8 KPX Y o -78 KPX Y oslash -72 KPX Y p -53 KPX Y period -95 KPX Y semicolon -67 KPX Y u -60 KPX Y v -38 KPX Z v -32 KPX Z y -33 KPX a j -9 KPX a quoteright -13 KPX a v -21 KPX a w -16 KPX a y -24 KPX aacute v -22 KPX aacute w -17 KPX aacute y -24 KPX adieresis v -21 KPX adieresis w -16 KPX adieresis y -24 KPX ae v -18 KPX ae w -13 KPX ae y -23 KPX agrave v -21 KPX agrave w -16 KPX agrave y -24 KPX aring v -21 KPX aring w -16 KPX aring y -24 KPX b v -15 KPX b w -9 KPX b y -19 KPX c h -3 KPX c k -4 KPX comma one -88 KPX comma quotedblright -27 KPX comma quoteright -38 KPX e quoteright -8 KPX e t -12 KPX e v -18 KPX e w -12 KPX e x -22 KPX e y -22 KPX eacute v -18 KPX eacute w -13 KPX eacute y -22 KPX ecircumflex v -18 KPX ecircumflex w -12 KPX ecircumflex y -22 KPX eight four -1 KPX eight one -43 KPX eight seven -24 KPX f a -14 KPX f aacute -14 KPX f adieresis -14 KPX f ae -14 KPX f aring -14 KPX f e -16 KPX f eacute -16 KPX f f 11 KPX f i -10 KPX f j -10 KPX f l -10 KPX f o -17 KPX f oacute -17 KPX f odieresis -17 KPX f oe -16 KPX f oslash -11 KPX f quoteright 1 KPX f s -10 KPX f t 11 KPX five four -3 KPX five one -63 KPX five seven -23 KPX four four 1 KPX four one -72 KPX four seven -47 KPX g a -5 KPX g adieresis -5 KPX g ae -5 KPX g aring -5 KPX g e -3 KPX g eacute -3 KPX g l 0 KPX g oacute -3 KPX g odieresis -3 KPX g r -3 KPX guillemotright A -47 KPX guillemotright AE -47 KPX guillemotright Aacute -47 KPX guillemotright Adieresis -47 KPX guillemotright Aring -47 KPX guillemotright T -104 KPX guillemotright V -72 KPX guillemotright W -50 KPX guillemotright Y -106 KPX guilsinglright A -43 KPX guilsinglright AE -44 KPX guilsinglright Aacute -43 KPX guilsinglright Adieresis -43 KPX guilsinglright Aring -43 KPX guilsinglright T -100 KPX guilsinglright V -68 KPX guilsinglright W -46 KPX guilsinglright Y -103 KPX h quoteright -6 KPX h y -18 KPX hyphen A -8 KPX hyphen AE -8 KPX hyphen Aacute -8 KPX hyphen Adieresis -8 KPX hyphen Aring -8 KPX hyphen T -65 KPX hyphen V -34 KPX hyphen W -13 KPX hyphen Y -72 KPX i T -9 KPX i j -3 KPX k a -12 KPX k aacute -12 KPX k adieresis -12 KPX k ae -13 KPX k aring -12 KPX k comma -5 KPX k e -22 KPX k eacute -22 KPX k g -20 KPX k hyphen -35 KPX k o -23 KPX k oacute -23 KPX k odieresis -23 KPX k period -4 KPX k s -16 KPX k u -8 KPX k udieresis -8 KPX l v -9 KPX l y -10 KPX m p 0 KPX m v -15 KPX m w -10 KPX m y -18 KPX n T -79 KPX n p -1 KPX n quoteright -6 KPX n v -16 KPX n w -11 KPX n y -18 KPX nine four -6 KPX nine one -40 KPX nine seven -27 KPX o T -80 KPX o quoteright -10 KPX o t -10 KPX o v -16 KPX o w -10 KPX o x -20 KPX o y -20 KPX oacute v -16 KPX oacute w -10 KPX oacute y -20 KPX ocircumflex t -10 KPX odieresis t -10 KPX odieresis v -16 KPX odieresis w -10 KPX odieresis x -20 KPX odieresis y -20 KPX ograve v -16 KPX ograve w -10 KPX ograve y -20 KPX one comma -59 KPX one eight -53 KPX one five -53 KPX one four -65 KPX one nine -53 KPX one one -96 KPX one period -59 KPX one seven -71 KPX one six -51 KPX one three -57 KPX one two -57 KPX one zero -50 KPX p t -9 KPX p y -19 KPX period one -88 KPX period quotedblright -28 KPX period quoteright -39 KPX q c 0 KPX q u -3 KPX quotedblbase A 18 KPX quotedblbase AE 19 KPX quotedblbase T -64 KPX quotedblbase V -57 KPX quotedblbase W -30 KPX quotedblbase Y -76 KPX quotedblleft A -46 KPX quotedblleft AE -49 KPX quotedblleft Aacute -46 KPX quotedblleft Adieresis -46 KPX quotedblleft Aring -46 KPX quotedblleft T 9 KPX quotedblleft V 19 KPX quotedblleft W 26 KPX quotedblleft Y 7 KPX quotedblright A -54 KPX quotedblright AE -56 KPX quotedblright Aacute -54 KPX quotedblright Adieresis -54 KPX quotedblright Aring -54 KPX quotedblright T 3 KPX quotedblright V 11 KPX quotedblright W 19 KPX quotedblright Y 0 KPX quoteleft A -57 KPX quoteleft AE -60 KPX quoteleft Aacute -57 KPX quoteleft Adieresis -57 KPX quoteleft Aring -57 KPX quoteleft T -2 KPX quoteleft V 7 KPX quoteleft W 15 KPX quoteleft Y -4 KPX quoteright A -65 KPX quoteright AE -67 KPX quoteright Aacute -65 KPX quoteright Adieresis -65 KPX quoteright Aring -65 KPX quoteright comma -52 KPX quoteright d -20 KPX quoteright o -29 KPX quoteright period -52 KPX quoteright r -19 KPX quoteright s -17 KPX quoteright t -9 KPX quoteright v -3 KPX quoteright w -3 KPX quoteright y -4 KPX r a -9 KPX r aacute -9 KPX r acircumflex -9 KPX r adieresis -9 KPX r ae -9 KPX r agrave -9 KPX r aring -9 KPX r c -11 KPX r ccedilla -8 KPX r colon -12 KPX r comma -52 KPX r d -9 KPX r e -16 KPX r eacute -16 KPX r ecircumflex -16 KPX r egrave -16 KPX r f 17 KPX r g -8 KPX r h -4 KPX r hyphen -34 KPX r i -5 KPX r j -5 KPX r k -5 KPX r l -5 KPX r m -4 KPX r n -4 KPX r o -18 KPX r oacute -18 KPX r ocircumflex -18 KPX r odieresis -18 KPX r oe -15 KPX r ograve -18 KPX r oslash -15 KPX r p -1 KPX r period -52 KPX r q -9 KPX r quoteright 3 KPX r r -9 KPX r s -4 KPX r semicolon -12 KPX r t 17 KPX r u -5 KPX r v 17 KPX r w 15 KPX r x 12 KPX r y 16 KPX r z 0 KPX s quoteright -6 KPX s t -11 KPX seven colon -55 KPX seven comma -99 KPX seven eight -24 KPX seven five -30 KPX seven four -76 KPX seven one -42 KPX seven period -99 KPX seven seven -3 KPX seven six -32 KPX seven three -22 KPX seven two -22 KPX six four -1 KPX six one -39 KPX six seven -21 KPX t S -14 KPX t a -5 KPX t aacute -5 KPX t adieresis -5 KPX t ae -5 KPX t aring -5 KPX t colon -19 KPX t e -12 KPX t eacute -12 KPX t h -6 KPX t o -13 KPX t oacute -13 KPX t odieresis -13 KPX t quoteright 2 KPX t semicolon -19 KPX three four 0 KPX three one -41 KPX three seven -23 KPX two four -46 KPX two one -37 KPX two seven -21 KPX u quoteright 0 KPX v a -20 KPX v aacute -20 KPX v acircumflex -20 KPX v adieresis -20 KPX v ae -20 KPX v agrave -20 KPX v aring -20 KPX v atilde -20 KPX v c -15 KPX v colon -14 KPX v comma -54 KPX v e -19 KPX v eacute -19 KPX v ecircumflex -19 KPX v egrave -19 KPX v g -17 KPX v hyphen -7 KPX v l -7 KPX v o -20 KPX v oacute -20 KPX v odieresis -20 KPX v ograve -20 KPX v oslash -16 KPX v period -54 KPX v s -15 KPX v semicolon -14 KPX w a -16 KPX w aacute -16 KPX w acircumflex -16 KPX w adieresis -16 KPX w ae -16 KPX w agrave -16 KPX w aring -16 KPX w atilde -16 KPX w c -8 KPX w colon -16 KPX w comma -40 KPX w e -12 KPX w eacute -12 KPX w ecircumflex -12 KPX w egrave -12 KPX w g -11 KPX w hyphen 0 KPX w l -9 KPX w o -13 KPX w oacute -13 KPX w odieresis -13 KPX w ograve -13 KPX w oslash -8 KPX w period -40 KPX w s -11 KPX w semicolon -16 KPX x a -17 KPX x c -16 KPX x e -20 KPX x eacute -20 KPX x o -21 KPX x q -17 KPX y a -21 KPX y aacute -21 KPX y acircumflex -21 KPX y adieresis -21 KPX y ae -21 KPX y agrave -21 KPX y aring -21 KPX y atilde -21 KPX y c -16 KPX y colon -15 KPX y comma -54 KPX y e -20 KPX y eacute -20 KPX y ecircumflex -20 KPX y egrave -20 KPX y g -19 KPX y hyphen -6 KPX y l -8 KPX y o -21 KPX y oacute -21 KPX y odieresis -21 KPX y ograve -21 KPX y oslash -16 KPX y period -53 KPX y s -16 KPX y semicolon -15 KPX zero four -2 KPX zero one -40 KPX zero seven -28 EndKernPairs EndKernData EndFontMetrics gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019063l.pfb000066400000000000000000001105771404163720200221040ustar00rootroot00000000000000~%!PS-AdobeFont-1.0: NimbusSanL-ReguCondItal 1.05 %%CreationDate: Wed Dec 22 1999 % Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development % (URW)++,Copyright 1999 by (URW)++ Design & Development % See the file COPYING (GNU General Public License) for license conditions. % As a special exception, permission is granted to include this font % program in a Postscript or PDF file that consists of a document that % contains text to be displayed or printed using this font, regardless % of the conditions or license applying to the document itself. 12 dict begin /FontInfo 10 dict dup begin /version (1.05) readonly def /Notice ((URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General Public License) for license conditions. As a special exception, permission is granted to include this font program in a Postscript or PDF file that consists of a document that contains text to be displayed or printed using this font, regardless of the conditions or license applying to the document itself.) readonly def /Copyright (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development) readonly def /FullName (Nimbus Sans L Regular Condensed Italic) readonly def /FamilyName (Nimbus Sans L) readonly def /Weight (Regular) readonly def /ItalicAngle -9.9 def /isFixedPitch false def /UnderlinePosition -100 def /UnderlineThickness 50 def end readonly def /FontName /NimbusSanL-ReguCondItal def /PaintType 0 def /WMode 0 def /FontBBox {-139 -286 915 951} readonly def /FontType 1 def /FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def /Encoding StandardEncoding def /UniqueID 5020915 def currentdict end currentfile eexec و `,i"[[5j5mTʻ^+݄fKitrޟm%9۩*++`[&NfA-O!J"|UY+; <Ԟ2?.P2QhnDtw=y0)n*[ Y]~ ΁RzYi[AXm>o*z+zZ]{DEI,cOU8%;<:k(p~d9ebЗ;0@.P҄8j~^&9#ȕtD3t$=5L#m3g^G.Wk ;y*5Pkg*>' Lȶ\T]_}LMaYUc }M@L\{jl[_D}ЬmaPGW/fo8'yG3wK!̚x'<8SISM#p~1F>h Mm^ZZo\X(R_j^'uWIBw\8bŶcz""6^Hm$4>*`=~%±y.娉C޺X*Nj?w}t$s&D Uj[]{n`מ 0&Ӫ_NP]U)RHkgf"5ڄJ=- vr K5nV/-DREW$- RD>QIU|Ol0 UKr:ۆwq3.- {&}5@P.ˬ:#3r!\yl3zs8kp#eZPm>/5=|tE9@7qEG$$dZ?Z>\ ¢! e0ɛA%*J~KGƒ&v Uks߻ǐpܑp xwwŻA ̵)7Ħп>n J9KBZ]e< *z'dVGTf)^2޹T Ob+|7 {}` r&i\$GsDˠM TE=n$;E\% ]R_ðgD* sB,@A0U55Y )$ $˴(dm6AGf=(w(oKBVJB/r3?r^vRcRb 7#ko<^QƜZ䞵@{ХÀ7>p+R6~N_]aC|$+[qgѥ#tVәUWM0E@ OzR߯OEƶZ~E7sp#?f ׸yGN2@u ,Q3O 7mc 5vh@rIeY8XEh۰>TFqBaR[7 hDcM"4|$$7VkKǸ}z6:+(F5vߔ2)pa1BsiNQW18?9=j)c+%tSv5 jnjOmNS۸y2O3(Ч'b ȕ"bdvREl 1%F-b޹ .\KjtӲSGd氱u¦p֡aEr&>oɬr.34Bomj{3%6ᎎc +e?GR Jx_#/:%qFCÈg]l:imLuzrݼ6b(RN0s:ǏG0rad6%+ygBe jkD|t:/4+{F7sX)PtlCT7\C&a"J*}iFAɗB|a}nb/h jl޻ER-ӎ+ပ274 3cxGjZU?ΉWƭ`p8Eh_gJ@`}-gUч[9,Ϥ?JVoU`LFOjCQ|5?V6YXP]UW`tl%"h&(͆k靷7\e;)ss]ZXCb!xeʂr%rթɚԧ^eGIӟPq~Fpᩙ%]O}{Uh o#_ݙIw_5.\*%bxt:A )u;K ɻ% YT8i.~jX5~|U>g is Gaլ"Ui_ Ó6ݵ i8 Uy{-&7;f&yvpy,'G0I"B_#j߆a1O,o[X)M$Hћ#{?E x[۱1&!p;jf^^5ata݈W^df}R $pcQГ ߬:~ק/`l4NI8NEbgf1/ۉ$;6?f)kN7|BYpzO%j7Eգ&%X-ݳ\e[m@GF? ťʶYnD7\|S$o| :bKL>-Jc|:'2[^{I2xq_z Kݭ#ȩ&x|X0H*G F R cSz: [H=wAgc!_cjs A wH"eqԀwrP^ɍn6SF̓ FHN-kU2igTr對u=5H[k3in"W>肜^줩w_ }$9q S_}7 SkMpE:ȶƩB$29lwtQ?Q+g,ON)b7ؗnr\N52qnlۮh1K.^z rf` ]#Kz ^/.1 cO|Vة" "HYE;(X D\*ayJX} -JYՄV@Kytd `$HGA܉tgF$<͠:{0J,֧iT[ĭ戰4_`J$ٍ5@J]9o*CN9]-W>Fa{DET]|~}74Sl.Kgoz!rVPzrqUg*HL'LeX 0 !l_2|.X 6[< BsJ9bm,e~_>߾+N@whXApx X0.&xN!C 1.V^@"ԫtc;1iW jנ0-v8Y/C``*k9[GI{ӌK0+̑_awj@պ'dSye]s .mR̳Jܙ=~ܻ Ĥ\$ʊ_-X- ?Z{)l+x^ۛqd-عl~Ӓ> 31 Cd<OJrW\?/ }I]^lMh_ʜHƠI gTS(T;0J xDJ@LYŇלT@"t_TXBo?qکWZqH ߽IZP*뭧 4K Kj#xTf|Qh Zv M1w $c;(n`a;2A D ' t9Kbthynr!Uqĺ7pej9kف:#9,򟤅s|:K{F؞VUcATN"U'<Jŏe/(@"-brglxֵOɧ˸ Dv}2JPݯ$z #b\Iũj>I!Ȭ Ɠ7+e/_kB|ZhSӆrj0ZIz` 4%{e4fnI |+4&ˎ-ggU7hx= vǁ-3la\w[/<J{ )ْF!EMZ\I\P^ζUՌf(L^{z0E%;](^`#%y -fYwK!V׽n^jo4 u";Ȼo*{(Dc]ՎShgA͸sIBpÔ6W_8ɨ:Ok9؆P&;yQwMwBhN{+ w&z <EǨY>RmPk#jg}Zi(IY*K aoT.`R$Ntp0RwvXAy_[r:2Hbd%a73I]Nd%ELr' +r+[7mvsUY@'(k`'vVaINg4ϰ)̢FqtRZd'ʓ;.sC5zD%m6Y :R'.?ƀ1{\{>4ܫ_*6 RČGk,M~AX 9 j޿CѐPX:mG_=  tqN<; le%8sKӊ$:A-25wL"T-gmO%b \3u k` R)0&"Z#x,]sb;-P2hs8iDR7Nz;MKrua1vչzcyﴧ` M?z<^f/.x3l0=v- ^m52{rLȳ"NLḪμ"%N ,u2ʿL+܊qFHL5dtMNьi%E7 *{jhg00p$(C:3Q2[ŕu䢀tRǀooE2Ǩ/M(18]@⌥I~ Ɗ/eT⿏4uӿv>l-\ ;'ƨ}%}^R3w΍G0wB|-bwmNPZ3OE B-TU"FRZWJ9U!0aD u_4'D¸IȨ7'rAҗ{+@ *!zneisKG| ZuKT<9Q2r8 l=m9<9Ʌt>@0,t C)ph_j!p?Ng1l[غakwsbɨI ztJȜ"ǟ^]bu(nJ(WMj.'{.G'%k}6|߂FB{ wo_܊E/wõ!C\ne~+>E#s@>d{ف .Η)aKaǫ%=ƆѶoBvD=S6oNTQQLOP%Ps3!I@seA?.Vˍ?[nCt( 5gJk~kk|}koSPBvM՟7Ŋd,)p $t?{BAIٗ⟾0a6χ.@vs}[&1hp\4"z>XAY/u0VMd}4&Զr`lb[7EYtr ܴf%T-CH bumk7Ge@TE|=$`)t Jt8ߍG6 R2;`p< 8GCxFHE69!w:%wq82D-Zǡv,;Q,.kN(1r0͕eUŷ BL=BW):%jF4/d`6Izyg m)U8FG=;e# 0'fQLUM'u@5Fh$l ,HTniI\WwΖA8S-}v[OѼCte/PHtDya.G~4󷒡%{w8ן/7d|Ffk2=́rޭ|\$jTԶ!p6S#٠=^d{h=5 x[ƜM&.:Zj bVh3=rJNsj%āwV ' dQ?_uy2alMrh Dǿ'\<>u'6>-(@ ׇ}{ǚwua(im?G Χ84i¶;߉Na^*`1^Ut =˭̺Ľ:,qJ/%fS/ߩŢN}/jbtוOuMmϨ&jN,O0W _GNER 256$ԫEb91an$: |p˱95Ip4?'R/ԏo80D7;iWXrV[SV䐲.V#6zWb:y-ݼ +U|G8h';rEla.5vq#sGU#_IAj 5r8ZaG@Yj+sgerkN:[3ܦԐsv/Y$lf LSc0h-k"qD *Ȋ~TqLK9'-DdPu d2NwP goӌ2IH *iViSъW34lZHv\DGk%է>di\EV1NkOgaӹK%K<1}Jgx- 7ejjR\(61(Z&h ڣQjVL, #s?Y4SqCWr3,|9ۅ b& SC>YA*>O@->/&|EH@Sks2j߿LoN'o - E!\ 42oXמ%2Z-i5BMv$EtgJ11l^Fa|Sϑdl ft^fT!sLSGLK$w/gS-EQN 4Vc[ Zit2"ˣ̨,Cn;9S.σ@C="fwДXg~!rl6ˇ0D<#,Vfע8>9'7fuV@Pw5YkWh'nDirش{PL]WCJX=ۉJ7a ]x23~u{ZDԶ#\ 6RUHH^WjBVB %wDjFSSˍnnHûx:eI1U2(%e N"qY^79A8ޜ/u&MӠgEwdn{]%$P 9=Io%c,>(D~NS:堨źv)# ^ΙZ; 6_22l9YeAA0Qk!-΍r=K&;ݯJ+9 b];%1+ 6cGv9/ǧލW_D*C#+d0V5 Ѿ 517%rAU? ?P)etDbQX$ ݏ,ڻɝ돐yqM7Avy W/^W Կ2lVFD̖-gEQpǎp/Qő5=zGJ5gQ dHlm`g_U :EoGpnnX-S۽B׾M?1)2P1Ntzt/ScWaV4XoqPp?-ƨ|rxt_'JTa!&Z[Y R(`OBsDڃB 缻AK^.Qu/XUKA9M Nur)]ٸm+[/m.7yMF$la bFS+ t̥KJ%EQ]N;NTy᭧/Xtf[Vi/sR&NLN*iJ5sIWW">|&3OۦES=`iOmc!ώ-1Mø(߿mިV"bSbj:>zD;Gz^wc) #α%ETTSQyX^0~\E"?Ebr\=Q0- ћFoIiUfc߅Ju++NWJ刽AJ?֔VՈp>c*S?o}Xh~-v2FLٙ&L$07g}e^ּ80I鹰U֦b *gL=q"}9AL|T@ r*ugE [NO8z, ATWA$ >'x.bgѹL}ڧ>|r9{Q&УŬ˄u(k}Mj')Gn`ss9C?lMN Xyo~}I vA v/ܣM/VZ:kfdWFG M]z(E{SkXU\E|t|;8E r-*>rJ@:"r C(VT}nJz",4?Z4Ɓ#WGt6so`w<{mzoO8ZhL̐g &';w98*;GG0 ~Dђ*o*; 8تQPj{Xsd-CoaC}ԶCVe8 ]ԅ_DU,+Rv4s"'O5itWg鿄FJС")7SA75x*EܮЧ~ %4zj<~:^M ۂYZa&SK঳F𹩚Q' Nbnn0\t 3%JEDaǍl=~hV#zD> &1 mzd{I5@{+T5;RVGo] q\݂kʹغ6-\)DZ9gCVTs /h㍡t];9EL3fF%Y/Y]qe}7iYd`|E_vuTWW:CpUi'xR%p`5NEUnd9t? ~µ\UX7c*kWÀoQs[Hq~*_zS;!rˬ{Z 񳀐~C/(C?'OAqo#?S21-Զd5:Fkv-w$FogGCF32(2ħHM <?]8Bh7~2A 杔ڜ%3mIjX~Eg ?!Hfr!č_dQQZfjvE_ 9O `V)d4̪ |VPf]{#RshRP ):YF~E_!]}B r$*?5ڸr*->Wq@EiI hq'vɨ2M8t!JVdм؎R\NkCkĜ!>@[m cLޡIw+#J}nÜd>%?agykqWَ6nEIe8H8)E.sʜI,|éWP;NkS*U1wW5;p..;N0vh(e33Soeȹi2Dx.tH>7..;~ҘIf~+;TE7M܆iHɯs Q >0< tW-, Ū6oe/7בֿ$=P5̰J/e[USC7+3Ukm>_)yd]F Ǚ;EO1D&mVBEVQ [TF|xyFg2G;](<6R]Y0]QٙvWZ~+:T;7;-/DnЪ(B{ 0wTd+ qiT:1Ἒ_.p-Ȳԑ( ʔtGj8TR38e> y JZHBa[gI*l?uykBLA!u>>pNpt3M‰7F+eAmX:Du(oA Hką.7Uڄ'n%PI4Dτƴ׊z,v8B4p>7.3._TdÈ5L7vu{fivI+kK5j5޷JoRY&e.j"3QV͗1*26]b$))^9/Aɹ~;&T^SPWnrhk X]9ݤtnG@H_.I1 0Y> wb,!zfn{oiHM M`6Ykhs(sLq%E^ 2/4H `\Uni8Sz*X> -\Lh<36k2#gQ^TQ++ݻhs'ɭwfF&$"o wG*ZsMXnlhWMuG`hꠢד([׬?2y(/Wf*Y|θᅆd87c!m[?jzjJKƂX<:BJZ62ˠNӨ .yx5C̣18єebՂLߓm@Rz ) cTg{V*4zTXt07 EFYEmRd|L'OqIXTz M:AW&z+Qz!-j\jiX3CUvU-FƷNqlf($[eov$K~^vI/*C|;^:u a=6W[ x2c-=-diH VMJXC YH;F¾,ttxJřa# BSy0hl-fWM" biHL>ЧfgȻɯCd =WUgf^סK(D> &_yRVܜ&K tr-ز#6hMQ̣6{Ney<l0R Ohگ=cR ,\ 2e)skPЦwFчj}j ?^XA΂QPB#jVI{Bo@"z S-o`&jW#)}؅Ox4J\GT9E5rIO#l<ܹ _c?>B_ 8W_}FI}walG__\udc_i 1AӃ)4R<XֳY:O*]"Ô@¸ jpbdDPO+/sH~Cl@h&|1(³h1Kf ۉ.{||CG001/ ;wI $.]&8kcΡuDG_[vN[`y1Of OW kY2f-pQ|30兒j,K;{U2&lNY7VbWj P6'Gz.)i,Kֹ`a,C%$Ú׉Ұ "wEܶ?F^gcjR>nf 08vگl ~pEZ Qy$$VT҈1*Jj}BD' u˹ X9jA,U@#fx}" 4v?BMnqPɎ2lפe;2\,iED{s_s  k,Qd t嘑 $dÂUM}Lf=R4.sYI~@-`ds{kѽ3nQi]j_)U a\hg$_AKKBٜUx3i#I/j@CH'_xwȸNiP4c F 7ja2 6߾ 3T"nDUMT!ڈRel,"}mY鈌\Dh~^үAQ;eLuFʑ:YeftS#s&5$w4A$؈j5r}G~૗h?D5°K8q!Wr;X iM-#Pr* -S8*&Jry1FF'FDbk\vM+k'K .UjsYS[οsce5~Les]/.zz_D<#?k%p7Fjixc9K]QF(1l؋>Ng sb&$ē.llӛ1W$T YA3eQO)< @aRAKtFtzT.̅Ҳ<@qoZnP c-z,ɪ.v)&JRnE"Af]@i#ugj> *ISr>j$_o+;HM\ .*9>%_8WM+a$$5߾R܏:ErxKKU'] %ߚ1iYN,{^#,=GTPi`+Nz `Q}riL v`qq3Q2MoLBD+*$=2JYKb8m;%`I|0EJQb`6[ʥ T,ClikZj*]<=oa!=LHaZC6.jgA SW6w܉x)Mtn?~jdgCMK_سe˼1Uv*q6T_lkL.g {oa*!yI1Nb (4??_7zʫv 8tXH茶·Kσ h+[$E 0f3>}qcb7q 6 {s  ;ߟrZgKe]3Y% 8ʖ iVxk][21DsBjs]iz6o6IjG`K$9cZf_ҕbʛ m$_Y@,]'f6hC}AsQOǷY1oVѧX`>攒T WvÂ`hӨķ~O| INlzh8}Qaq*b-H=}12k:aR?~fO襬ψl1A3 Dub.S.M]!RkCn`YtP#)Iè_hDڕ 2+ .=gP45??)=\ٝ:az{LVW-eZxr9+ŗ83dZ@`L6FI?$LS/mDKJڇBWQ!g=uvYb"_?(3Ƽ>J˴xjI^dc U+ڸB ٿO64FNܵ {9 /3y& V3\%mGHx-Ew3h,n@r8~d D^g8JG^3'joe^$Ϻwej?UɶdvT]IËr4E-&5 YqnvH!rSU#7l'O p^[EaVpݚYED?<H3MnRJv#!ɦm/"^`\,  ~lפ9 Nۘ0=Ar=Vgu yI43)+08z*_u}yE}+'N02^"F4dN}Z7VX=iC˹џ'{fZ>>}|U,fWaE,ʨFel"gELlAh(sX&mYT xcW0^Gb Tu!8ѱjCVRZmkZ$Gɨb u&%'d$ȼ6 [IYRt9؁x`fΞYC}˫k#ի㋉] (Af965%Ln:R|E,hA3df@tu`LhN̴^'|#8[Oaԙ"k ¼1#o` kVCv3A(kzqxB%KJma~ӚM(dCwYxz{Wj9=3`"8Dऎ:RfVAz2fGi-WmSx%(xc>Gr0?d&԰*#;#?ICLkSwЯN.VD?3]PH#:uJC1֘LMGIMN}GKEqG$ؼ9s:"f.boFkA cN=@.M+pyi=hkY7:e- K8Xs2{6`*/*˷} 5<$] @0AVuo0J}}!9!]>Ko01*XЮ6X Xf-KkQmrx/ s.6tn| XBMRvu Ml3vEwnr'&X@qd4 lC*Z̓tLX,9 0&G }.]RK-o윷PJ 3RfQF2TC.}&>|"_y@wIAf[ZLin(Lߍ,YJt2peD5Ʋ0s[dr+Fh?EvQŔv(J tf.{D3 /9Je9s,ct$\QN>˿LTH;߶L/,BX+kNqlBGQ)d y&䔄*WẈ )~L+i^ұ|KFDe؉'S\ƱG]^ULPc[rpVʶqqcq~cM0 G!?n3LC~}L!5ƳC/PȆK:kD̈́[S,@Cz0LC"xa 2Q&<$Z^¨y.5yy:'2[pAyAc\h%[Z)~h`0*`c9u3);#dLa3v|DH_aI:^lOTx% >8v. u,D]R0M_x{AY"ڶI8> ! ͉q$гQ,ӿf-bQ1 ZxY D1mr3z"XuY\hy%&h _ybbmbT ?xOt]a?SIaS5Z^:\* ?cz ܙ\lXwFPl=ˁՂ$>}Ƀl(!.λ#gbٶPttJ`_\,0ax ot}x`l*sBt 7;EOť ,@RtMC4 UiVVHg7PXx<W,q?Лj8][LW$C{[wX|apU/{ 1ӱs4ٶ#tl4Q[z[LO5|cEk7+4ԮnQыyX"bVx=-5NWY7ƌMcHI'.Nh_=hF/6')Ͷ~FBIB'nhӋ> ]5Ebb>ۆۂ $$ w/EWVnj``4TZEdyD2,S}#8Jdi;>' &JoSrzz4O0FL|5γj{|c*~/tCnF/?#[NY^47E#r;@wgZt.(l͊X6ɯQT! :@vW4geIfڮoHs >- s:SE=PAfb <9iIĚ;l\& %hx3=PllҦBHV@Zk~oq^!Tڣv`jʒ/oO bOSTē'5HdZ:s_3u<UaiIRm>7z>6jdd~z~4%`W y)S *AOYku950٫CG|IS~{rQNUh9_M`R Y3\d+Д(tc 2kj7X`B?+*xC2IOSSB{CjD_NߩB /EJ*j7b >8JT_t6X'Ou3#ueZOjz䡯~A%MSƂi=m7;#rLU-yvڭ1L>*& +g bnkM 5H|ˊPw~ΎQ>ŭ7%J'enȿ$G mjm,%Bbp:J==6wͤ\Qo)P?<7标dBڠ5 Q]Cɾ<{^ZKu%, ݼߞ A\9L}~83xi&0OvY$:Su13/nePoz z;1~¨1f,fAWX#U1SRRVpPDm"0~ l~Byj#VT0lܗւh,ٸ,P1iGPs\8ܡޑRqP6}w'N)\ $y:pU4spdH10[&vsCo*@ TQ}(>:>Sem_JG'~%-5 ynׄ9#0]2Q a;sgcd#PuΓ{d;?XU,@ZAFg.XV2 py=,duY15f&@ 72BCQʷ"%hyuQҘ}S Z<ߜ2vUnVCɃm}t=_3RbI{~rxl w1!RW؈SUN;V3C >Dz{tkdLJ "\2(%~``AVP$(w!v^iҪ͔ 8NT{-5#뎶rr~""da⟇kʶ'GTc*#,R ^ޕ`HV0_KPMM@ ~ikU$92-nW6SԷaCKZ9H4sdt\Yz}j2 [Gy T&>( NPʍ,g>y)vMeuJq2we2;xba""ncp2zLws1v?i{>^F קlr$.P `I'cXK<}ERG% :Ű{텹|sAg8`M^?Q W{oꗷa$zp# 豈m*};C)_aЬ|S -J{v.L2cZKԦ8CITEhqbxH$YU_u}""Q%0 uWGޕ,XM#uNB,-4}IzM!xRvi [Bk ]b{)2钔hӼ<򇚚$f ؒ4MKY}xoEs(2BaoF?4˓Xk` EgFb'{sR@G,S=vY:%&N`8KFӴvtT4׳6\ФӧDk1Z?\o;sW^ ʃ`Td"lNhƕ|+{62ڗ%1" ֚g>9R#,&P 38d%#@vmf%vmDTFTjО0`qu֩=iHo8.K=5F~,I&-Pz6Z QeiHTo&.8Gid)Xa9k7.DHěQIeh&τYp_B(@GV2X,JM̉s ]JRg`izp_:-Yuw5OAkp-wW7_֖Ġ CW`!Lch@~!_#Ŧ2ˇi7s'ئ7w$%cZ(1p:a4Dez3ɦA4u ⨼_*t^$(l=r@QZB{H3Ѩ4Fun:EĂ.Fh%+wN<-n (+wEya8NDcob5ޡoIEIYYJ<ʍ8"QX{T EjZqT _u e!֘qmOsbvb4#!/N*c꓂\$L?=rʣ~[n% ZL&ق$Sm# 6dq^9Zi$ v&l3dz8|aJ qӜ^ZJAsž͝QeeryM9e=E`hL'pl%CXi?T} +2E _^{s<4@^()Fr~0oq}:y<䢏{~}%}(&RQUM4G372mZUI)϶m !r'>ɒ/gkԞN搠\òm:`xz ĈK}l4WB1CP un q r;,bi-3$hNڈ:f;pɒid$@CcbRC8 R_B<ۊoe5gJ^Ar^jbk|Wi`d_ (2 %N\u沋Hv-B-WH:Rf7PjiSB1_\Zkokd=axUB쒚0ba* m=}9MŵNE Uw{_D#^" H~s<] Y:2'p̑:݃lL~[y9@8yqZbϿTؤL'L8kwgKX+}8 }?p0M\s-T]}}to'.$hxEOO@L8|n=s($8iX0/qI1ɹډUr– WAO0#n/Y[c43?wr/EvŇLVq`h0;Q>/z4.!< x^%;Zs1#B5gXlF KPm9]}]Rvl9%5m)EţMZސa> Sy!6afȔ_M )\iӳA񶊕xx)L-68i蓍\1;ebx$:#d~YYƥe|_XgOgng[c p,8MYpwEɣ]f͢j"q z?i’#1oz$-B?Tm]m(:Xl3dbk~ gmXA, `a-wt#e(q|Q9*Nwfh3K&8m(_9 Off^ՖD&y\dRx`k_߽of=I{7L9AXLWqI;ӇZi %x}f`;dqt0yCt+('v_"65Tተݚh%l3}=tnk;:j^"ڝQi#) 4ml:u0pr!ɜ6H',AH8r=k~[D>D0?'K^~x*=~9QeK5=ːY)'XŹ%tHnj,,Eg)%054J7^}90`x0y3H?)&) A U_+7WmmM:QpDFtT .C6~V&Î÷Aɏʗ[y$wIvt*.6k= UEzs 5.K.dh20'Y]3}ggQY4 C'ooxIGlMgF$A 0EӘ#j0Lﴷߨ:svI;4y`1(Nd7cO[T-a<dr0yl)WjC[G)ue/`._o'rnF\ZNX%;}=p&|l6q$V̺UFS*ѽOU&v!+<sm3.{y\K/l"-zAmɀ[Vؤ [ڃ7'O!HbzVY˫givD~zzGZ˔P69?+ H) Ýu, YC .t:rpEH%h* SJ}9 d r@y#OF=µċ<{AA )hYn40Zu`uMpl`Z|b:M Lq(:vmúp [;3B.Kfߗ ̯ RmZί??/=Qy&V}Ƕ<2E)/Y^kzmy,<˘RƣCp^eݏɮ$>YeQxqcZݵ-`N  PϺA:Ár&HrR04rh+Bp-i>삲'6ok 8\`MZٖ4ӽ=k&b״=rdLv(D/s׈? 8(4QMh4 .rBTQm1`9BzK|wM˳M. TAq4; aPߕc֍$eqlsRS5 n97M KTs6W.(<8܀z,ւKYwE1K =5.r!f7fWg#t,geѱ@"0hSMD_6 tCEP DovNtT/ Ǯ헮ꐎ(1&#@uGe+U/En=qrDPt)0;":1v)z ;Y6 ),KDZ !͍ܿe3tg4iqX} \ s`@*CM6>ӑ6JzMٌllh=ǻ'](43wtUA5=)?Lۥlװط|7laePĥ%z's0{x)x-8eJ'#ŝ)|M{5 lz׶)>tM7Q'K`= 'u >>iB)\Rsv8JGp4ZvBrk4NxrC7,:} fڽM9*ackㆴl٬րˎمdNtRIy؄Ԑ ~ qzA_)PMe/ y?u&8GTc"eV]Ga(w`g%]B;:VF[\xô-pX@R֪&Co t׻/:X,F$}=`j[rdi05jxIgG󎖯NyZRb0aU}.&8 u2 ƥ,1;G7@I'`i{7ƳD 1sd[vJdD\gC-ȇ1]=Gj%)}OQ2F:vhY 2M[Eȍw-9X}^*#:}3>mG6 zpFtQ)ldRPw:F۶n`yz5_?"|VdY:N{zXhVob5|aoG*)5kj8zZhU;HeZN6 3[~G|O@~"z@ }F ZZQɸp`!VoMBȥ'攇|U?#+Ro:!9s=oƈ P&N<vF0#qAچ#XSWҍ+Txu,\',Į0j%s_] Qc*Ft9/儩giԵx~q5 VK2| ,j}}jYyTԔŘ ְҳ$tm 4R1ʦD`n;*ױ_!;I# 2?t1~7=mO.XB%&x@HC.qdVہZ/OD9֣|UӡepBqIrd}.ͱFTbE\ h cLbZM=Y4XFul} O?}H|?1Wt]U9\HZ_,ܼpb?7"QWP4v?[}謹8 F oݲq zيrДv*pn 햇$y@0݊"W(ԄqS6c+Dmo٩[B^aM>~ kTH1F#[ĢCy2d&v}ERIh(?q/K~Nr."-!r_DzV?@G 77G5 `!e,%o96+%]DO@k= 8;Cݱ_i#=B#+1%*Bώ6ZK Qiz/ji.9<ھh4)CxMoAIv'(dG<Ps/qʆ ?/o/U{6zek~f<S2˰RN&ڊ}ÒNܸ;O]yYPqE5?9pp~ĘXT殒0t1ަ-_M0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019063l.pfm000066400000000000000000000111221404163720200221010ustar00rootroot00000000000000RCopyright 1999 URW Software. See file COPYING for license.op ,,@ u, ZK2H222PostScriptNimbusSanLConNimbusSanL-ReguCondItal##?@##PP#~P#P~#~P#P###P44#444#\/\H+######4P####PP~~~~~~PPPP##1,7,A,F,N,P,T,U,V,W,Y,k,r,v,w,y,,,,,,,,,,A-F-K-L-P-R-T-V-W-X-Y-k-r-v-w-y----1.7.A.F.N.P.T.U.V.W.Y.k.r.v.w.y..........10,1.101112131415161718191127213730414243444546474849415751676071727374757677787971878197:T:V:W:Y:r:t:v:w:y:T;V;W;Y;r;t;v;w;y;-ABACADAFAGAJALA NAOAPASATAUAVAWAYAAAAAAAAAAAAAAAAACKCLCNCRCTCVCWCXCYCCCCCCCAGKGLGNGRGTGVGWGYGGGGGGGCHDJFJPJTJCKAOBOCOFOKOLONOROTOVOWOXOYOOOOOOOAQXQQQQQQQKSLSTSVSWSYStS-TATDTGTKTLTOTRTSTVT WT YTiTnToTTTT TTTTTTTTTTTTTTAULURUUUUUUU-VAVBVDVGVLVOVRVSVTVVVVV VVVVVVVVVVVVV-WAWBWDWGWLWOWRWSWTW WWWWWWWWWWWWWWDXOXX-YAYBYDYGYLYOYRYSYTY YYYYYYYYYYYYYYYYYAaFaKaNaPaRaTaVaWaXaYafagakaratavawaxayaaaaAbbbbbAcTcqcrcvcwcxcyccccAdrdddddAeFeKeNePeReTeVeWeXeYefegekeretevewexeyeeeff rfAgTgVgWgYgkgrgvgwgyggggchrhthFiTiViWiYifiriFjTjajfjijrjckrkflglrlvlwlylUmrmmmUnrnnnAoFoKoNoPoRoToVoWoXoYofokorotovowoxoyoooooUpYpmpnprpppAqrqxqqqqFrTrUrVrWrgrrrrrrTsfsksrsvswsyssAtStetft otptrtstttttttAuFuKuLuNuRuTuVuWuXuYukuquruuuuAvTvYvZvavbvevlvmvnvovrvvvvvvvvvvvvvvvAwTwawbwewmwnwowrwwwwwwwwwwwwwwwexoxrx xAyKyLyRyTyVyWyXyZyaybyeyhylymynyoypyryyyyyyyyyyyyyyyrzATVWYċŋBKRT,.ALaefhnorstuĒŒ,.ALĔŔFPRfrATVWYīūDFGTVWY-BCDFGL NOPSTUVWYBDFGTªUVWY¬BDFGTêUVWYì-BCDFGJL NOPĹSTĪUVWYĬĿ-BCDFGJL NOPŹSTŪUVWYŬſ-BCGJL NOPƸSTƬUVWYƫƽALNRBLTVWYBCKLNRTVWYBLTVWYLTVWYABCFKLNRTVWXYBTVWYAAAALRrvwyFNPRfkrtvwyrvwyvwyFKNPRfgkrtvwyFKNPRfgkrtvwyFKNPRTVWYfgkrtvwyArrvwyFNPRfgkrtvwxyrvwyrvwyFKNPRfgkrtvwyrFKNPRfgkrtvwyFNPTVWYfrvwyRKLNRkgnustep-back-0.29.0/Fonts/Helvetica.nfont/n019064l.afm000066400000000000000000000760771404163720200221070ustar00rootroot00000000000000StartFontMetrics 3.0 Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development Comment Creation Date: 12/22/1999 Comment See the file COPYING (GNU General Public License) for license conditions. FontName NimbusSanL-BoldCondItal FullName Nimbus Sans L Bold Condensed Italic FamilyName Nimbus Sans L Weight Bold ItalicAngle -9.0 IsFixedPitch false UnderlinePosition -100 UnderlineThickness 50 Version 1.05 Notice (URW)++,Copyright 1999 by (URW)++ Design & Development EncodingScheme AdobeStandardEncoding FontBBox -143 -298 913 989 CapHeight 718 XHeight 532 Descender -207 Ascender 718 StartCharMetrics 316 C 32 ; WX 228 ; N space ; B 21 0 21 0 ; C 33 ; WX 273 ; N exclam ; B 77 0 325 718 ; C 34 ; WX 389 ; N quotedbl ; B 158 447 433 718 ; C 35 ; WX 456 ; N numbersign ; B 49 0 528 698 ; C 36 ; WX 456 ; N dollar ; B 55 -115 510 775 ; C 37 ; WX 729 ; N percent ; B 112 -19 739 710 ; C 38 ; WX 592 ; N ampersand ; B 73 -19 600 718 ; C 39 ; WX 228 ; N quoteright ; B 137 445 297 718 ; C 40 ; WX 273 ; N parenleft ; B 62 -207 385 734 ; C 41 ; WX 273 ; N parenright ; B -21 -207 302 734 ; C 42 ; WX 319 ; N asterisk ; B 120 387 394 718 ; C 43 ; WX 479 ; N plus ; B 67 0 500 506 ; C 44 ; WX 228 ; N comma ; B 23 -168 201 146 ; C 45 ; WX 273 ; N hyphen ; B 60 215 311 345 ; C 46 ; WX 228 ; N period ; B 52 0 201 146 ; C 47 ; WX 228 ; N slash ; B -30 -19 383 737 ; C 48 ; WX 456 ; N zero ; B 71 -19 506 710 ; C 49 ; WX 456 ; N one ; B 142 0 434 710 ; C 50 ; WX 456 ; N two ; B 21 0 508 710 ; C 51 ; WX 456 ; N three ; B 54 -19 499 710 ; C 52 ; WX 456 ; N four ; B 50 0 490 710 ; C 53 ; WX 456 ; N five ; B 53 -19 522 698 ; C 54 ; WX 456 ; N six ; B 70 -19 507 710 ; C 55 ; WX 456 ; N seven ; B 102 0 555 698 ; C 56 ; WX 456 ; N eight ; B 57 -19 505 710 ; C 57 ; WX 456 ; N nine ; B 64 -19 504 710 ; C 58 ; WX 273 ; N colon ; B 75 0 288 512 ; C 59 ; WX 273 ; N semicolon ; B 46 -168 288 512 ; C 60 ; WX 479 ; N less ; B 67 -15 537 521 ; C 61 ; WX 479 ; N equal ; B 48 87 519 419 ; C 62 ; WX 479 ; N greater ; B 30 -15 500 521 ; C 63 ; WX 501 ; N question ; B 135 0 550 727 ; C 64 ; WX 800 ; N at ; B 152 -19 782 737 ; C 65 ; WX 592 ; N A ; B 16 0 576 718 ; C 66 ; WX 592 ; N B ; B 62 0 626 718 ; C 67 ; WX 592 ; N C ; B 88 -19 647 737 ; C 68 ; WX 592 ; N D ; B 62 0 637 718 ; C 69 ; WX 547 ; N E ; B 62 0 620 718 ; C 70 ; WX 501 ; N F ; B 62 0 606 718 ; C 71 ; WX 638 ; N G ; B 89 -19 670 737 ; C 72 ; WX 592 ; N H ; B 58 0 659 718 ; C 73 ; WX 228 ; N I ; B 52 0 301 718 ; C 74 ; WX 456 ; N J ; B 49 -18 522 718 ; C 75 ; WX 592 ; N K ; B 71 0 703 718 ; C 76 ; WX 501 ; N L ; B 62 0 501 718 ; C 77 ; WX 683 ; N M ; B 57 0 752 718 ; C 78 ; WX 592 ; N N ; B 57 0 661 718 ; C 79 ; WX 638 ; N O ; B 88 -19 675 737 ; C 80 ; WX 547 ; N P ; B 62 0 605 718 ; C 81 ; WX 638 ; N Q ; B 88 -52 675 737 ; C 82 ; WX 592 ; N R ; B 62 0 638 718 ; C 83 ; WX 547 ; N S ; B 66 -19 588 737 ; C 84 ; WX 501 ; N T ; B 114 0 615 718 ; C 85 ; WX 592 ; N U ; B 96 -19 659 718 ; C 86 ; WX 547 ; N V ; B 141 0 656 718 ; C 87 ; WX 774 ; N W ; B 138 0 887 718 ; C 88 ; WX 547 ; N X ; B 11 0 648 718 ; C 89 ; WX 547 ; N Y ; B 137 0 661 718 ; C 90 ; WX 501 ; N Z ; B 20 0 604 718 ; C 91 ; WX 273 ; N bracketleft ; B 17 -196 379 722 ; C 92 ; WX 228 ; N backslash ; B 101 -19 252 737 ; C 93 ; WX 273 ; N bracketright ; B -14 -196 347 722 ; C 94 ; WX 479 ; N asciicircum ; B 107 323 484 698 ; C 95 ; WX 456 ; N underscore ; B -22 -125 443 -75 ; C 96 ; WX 228 ; N quoteleft ; B 136 454 296 727 ; C 97 ; WX 456 ; N a ; B 45 -14 478 546 ; C 98 ; WX 501 ; N b ; B 50 -14 529 718 ; C 99 ; WX 456 ; N c ; B 65 -14 491 546 ; C 100 ; WX 501 ; N d ; B 67 -14 577 718 ; C 101 ; WX 456 ; N e ; B 58 -14 486 546 ; C 102 ; WX 273 ; N f ; B 71 0 385 727 ; C 103 ; WX 501 ; N g ; B 31 -217 546 546 ; C 104 ; WX 501 ; N h ; B 53 0 516 718 ; C 105 ; WX 228 ; N i ; B 57 0 298 725 ; C 106 ; WX 228 ; N j ; B -35 -214 298 725 ; C 107 ; WX 456 ; N k ; B 57 0 549 718 ; C 108 ; WX 228 ; N l ; B 57 0 297 718 ; C 109 ; WX 729 ; N m ; B 52 0 746 546 ; C 110 ; WX 501 ; N n ; B 53 0 516 546 ; C 111 ; WX 501 ; N o ; B 67 -14 527 546 ; C 112 ; WX 501 ; N p ; B 15 -207 529 546 ; C 113 ; WX 501 ; N q ; B 66 -207 545 546 ; C 114 ; WX 319 ; N r ; B 52 0 401 546 ; C 115 ; WX 456 ; N s ; B 52 -14 479 546 ; C 116 ; WX 273 ; N t ; B 82 -6 346 676 ; C 117 ; WX 501 ; N u ; B 80 -14 540 532 ; C 118 ; WX 456 ; N v ; B 103 0 538 532 ; C 119 ; WX 638 ; N w ; B 101 0 723 532 ; C 120 ; WX 456 ; N x ; B 12 0 531 532 ; C 121 ; WX 456 ; N y ; B 34 -214 535 532 ; C 122 ; WX 410 ; N z ; B 16 0 478 532 ; C 123 ; WX 319 ; N braceleft ; B 77 -196 425 722 ; C 124 ; WX 230 ; N bar ; B 66 -19 289 737 ; C 125 ; WX 319 ; N braceright ; B -14 -196 333 722 ; C 126 ; WX 479 ; N asciitilde ; B 94 173 473 336 ; C 161 ; WX 273 ; N exclamdown ; B 41 -186 290 532 ; C 162 ; WX 456 ; N cent ; B 65 -118 491 628 ; C 163 ; WX 456 ; N sterling ; B 41 -16 520 718 ; C 164 ; WX 137 ; N fraction ; B -143 -19 399 710 ; C 165 ; WX 456 ; N yen ; B 49 0 585 698 ; C 166 ; WX 456 ; N florin ; B -41 -210 548 737 ; C 167 ; WX 456 ; N section ; B 50 -184 491 727 ; C 168 ; WX 456 ; N currency ; B 22 76 558 636 ; C 169 ; WX 195 ; N quotesingle ; B 135 447 263 718 ; C 170 ; WX 410 ; N quotedblleft ; B 132 454 482 727 ; C 171 ; WX 456 ; N guillemotleft ; B 111 76 468 484 ; C 172 ; WX 273 ; N guilsinglleft ; B 106 76 289 484 ; C 173 ; WX 273 ; N guilsinglright ; B 81 76 264 484 ; C 174 ; WX 501 ; N fi ; B 71 0 571 727 ; C 175 ; WX 501 ; N fl ; B 71 0 570 727 ; C 177 ; WX 456 ; N endash ; B 40 227 514 333 ; C 178 ; WX 456 ; N dagger ; B 97 -171 513 718 ; C 179 ; WX 456 ; N daggerdbl ; B 38 -171 515 718 ; C 180 ; WX 228 ; N periodcentered ; B 90 172 226 334 ; C 182 ; WX 456 ; N paragraph ; B 80 -191 564 700 ; C 183 ; WX 287 ; N bullet ; B 68 194 345 524 ; C 184 ; WX 228 ; N quotesinglbase ; B 34 -146 194 127 ; C 185 ; WX 410 ; N quotedblbase ; B 29 -146 380 127 ; C 186 ; WX 410 ; N quotedblright ; B 132 445 483 718 ; C 187 ; WX 456 ; N guillemotright ; B 85 76 443 484 ; C 188 ; WX 820 ; N ellipsis ; B 75 0 770 146 ; C 189 ; WX 820 ; N perthousand ; B 62 -19 851 710 ; C 191 ; WX 501 ; N questiondown ; B 44 -195 459 532 ; C 193 ; WX 273 ; N grave ; B 112 604 290 750 ; C 194 ; WX 273 ; N acute ; B 194 604 423 750 ; C 195 ; WX 273 ; N circumflex ; B 97 604 387 750 ; C 196 ; WX 273 ; N tilde ; B 92 610 415 737 ; C 197 ; WX 273 ; N macron ; B 100 604 396 678 ; C 198 ; WX 273 ; N breve ; B 128 604 405 750 ; C 199 ; WX 273 ; N dotaccent ; B 192 614 316 729 ; C 200 ; WX 273 ; N dieresis ; B 112 614 395 729 ; C 202 ; WX 273 ; N ring ; B 164 568 344 776 ; C 203 ; WX 273 ; N cedilla ; B -30 -228 180 0 ; C 205 ; WX 273 ; N hungarumlaut ; B 113 604 529 750 ; C 206 ; WX 273 ; N ogonek ; B 33 -228 216 0 ; C 207 ; WX 273 ; N caron ; B 123 604 412 750 ; C 208 ; WX 820 ; N emdash ; B 40 227 878 333 ; C 225 ; WX 820 ; N AE ; B 4 0 902 718 ; C 227 ; WX 303 ; N ordfeminine ; B 75 276 381 737 ; C 232 ; WX 501 ; N Lslash ; B 28 0 501 718 ; C 233 ; WX 638 ; N Oslash ; B 29 -27 733 745 ; C 234 ; WX 820 ; N OE ; B 81 -19 913 737 ; C 235 ; WX 299 ; N ordmasculine ; B 75 276 398 737 ; C 241 ; WX 729 ; N ae ; B 46 -14 757 546 ; C 245 ; WX 228 ; N dotlessi ; B 57 0 264 532 ; C 248 ; WX 228 ; N lslash ; B 33 0 334 718 ; C 249 ; WX 501 ; N oslash ; B 18 -29 575 560 ; C 250 ; WX 774 ; N oe ; B 67 -14 801 546 ; C 251 ; WX 501 ; N germandbls ; B 57 -14 539 731 ; C -1 ; WX 592 ; N Udieresis ; B 96 -19 659 915 ; C -1 ; WX 592 ; N Uacute ; B 96 -19 659 936 ; C -1 ; WX 547 ; N Scedilla ; B 66 -228 588 737 ; C -1 ; WX 501 ; N Tcaron ; B 114 0 615 936 ; C -1 ; WX 547 ; N Scaron ; B 66 -19 588 936 ; C -1 ; WX 592 ; N Rcaron ; B 62 0 638 936 ; C -1 ; WX 592 ; N Racute ; B 62 0 638 936 ; C -1 ; WX 547 ; N Sacute ; B 66 -19 592 936 ; C -1 ; WX 638 ; N Otilde ; B 88 -19 675 923 ; C -1 ; WX 501 ; N ucircumflex ; B 80 -14 540 750 ; C -1 ; WX 638 ; N Ohungarumlaut ; B 88 -19 744 936 ; C -1 ; WX 592 ; N Uhungarumlaut ; B 96 -19 721 936 ; C -1 ; WX 547 ; N Yacute ; B 137 0 661 936 ; C -1 ; WX 592 ; N Eth ; B 51 0 637 718 ; C -1 ; WX 592 ; N Dcroat ; B 51 0 637 718 ; C -1 ; WX 501 ; N Zacute ; B 20 0 604 936 ; C -1 ; WX 592 ; N Uring ; B 96 -19 659 962 ; C -1 ; WX 501 ; N gbreve ; B 31 -217 546 750 ; C -1 ; WX 456 ; N eogonek ; B 58 -228 486 546 ; C -1 ; WX 456 ; N edotaccent ; B 58 -14 486 729 ; C -1 ; WX 456 ; N ecaron ; B 58 -14 504 750 ; C -1 ; WX 592 ; N Ugrave ; B 96 -19 659 936 ; C -1 ; WX 547 ; N Thorn ; B 62 0 588 718 ; C -1 ; WX 456 ; N eacute ; B 58 -14 515 750 ; C -1 ; WX 456 ; N edieresis ; B 58 -14 488 729 ; C -1 ; WX 561 ; N dcaron ; B 67 -14 701 718 ; C -1 ; WX 456 ; N ccedilla ; B 65 -228 491 546 ; C -1 ; WX 456 ; N ccaron ; B 65 -14 504 750 ; C -1 ; WX 456 ; N cacute ; B 65 -14 515 750 ; C -1 ; WX 456 ; N aogonek ; B 45 -228 478 546 ; C -1 ; WX 456 ; N aring ; B 45 -14 478 803 ; C -1 ; WX 456 ; N atilde ; B 45 -14 507 737 ; C -1 ; WX 456 ; N abreve ; B 45 -14 496 750 ; C -1 ; WX 456 ; N egrave ; B 58 -14 486 750 ; C -1 ; WX 456 ; N agrave ; B 45 -14 478 750 ; C -1 ; WX 456 ; N aacute ; B 45 -14 514 750 ; C -1 ; WX 456 ; N adieresis ; B 45 -14 487 729 ; C -1 ; WX 592 ; N Uogonek ; B 96 -228 659 718 ; C -1 ; WX 501 ; N ugrave ; B 80 -14 540 750 ; C -1 ; WX 501 ; N uacute ; B 80 -14 540 750 ; C -1 ; WX 501 ; N udieresis ; B 80 -14 540 729 ; C -1 ; WX 312 ; N tcaron ; B 82 -6 452 718 ; C -1 ; WX 456 ; N scommaaccent ; B 52 -298 479 546 ; C -1 ; WX 501 ; N Zcaron ; B 20 0 604 936 ; C -1 ; WX 456 ; N ecircumflex ; B 58 -14 486 750 ; C -1 ; WX 592 ; N Ucircumflex ; B 96 -19 659 936 ; C -1 ; WX 456 ; N acircumflex ; B 45 -14 478 750 ; C -1 ; WX 501 ; N Zdotaccent ; B 20 0 604 915 ; C -1 ; WX 456 ; N scaron ; B 52 -14 503 750 ; C -1 ; WX 592 ; N Amacron ; B 16 0 588 864 ; C -1 ; WX 456 ; N sacute ; B 52 -14 515 750 ; C -1 ; WX 501 ; N Tcommaaccent ; B 114 -298 615 718 ; C -1 ; WX 547 ; N Ydieresis ; B 137 0 661 915 ; C -1 ; WX 501 ; N thorn ; B 15 -207 529 718 ; C -1 ; WX 547 ; N Emacron ; B 62 0 620 864 ; C -1 ; WX 638 ; N Ograve ; B 88 -19 675 936 ; C -1 ; WX 638 ; N Oacute ; B 88 -19 675 936 ; C -1 ; WX 638 ; N Odieresis ; B 88 -19 675 915 ; C -1 ; WX 592 ; N Ntilde ; B 57 0 661 923 ; C -1 ; WX 592 ; N Ncaron ; B 57 0 661 936 ; C -1 ; WX 592 ; N Nacute ; B 57 0 661 936 ; C -1 ; WX 501 ; N Lcaron ; B 62 0 573 718 ; C -1 ; WX 501 ; N Lacute ; B 62 0 501 936 ; C -1 ; WX 228 ; N Idotaccent ; B 52 0 326 915 ; C -1 ; WX 319 ; N racute ; B 52 0 446 750 ; C -1 ; WX 228 ; N Icircumflex ; B 52 0 397 936 ; C -1 ; WX 501 ; N ohungarumlaut ; B 67 -14 643 750 ; C -1 ; WX 501 ; N otilde ; B 67 -14 529 737 ; C -1 ; WX 467 ; N Euro ; B 0 -15 507 670 ; C -1 ; WX 501 ; N ocircumflex ; B 67 -14 527 750 ; C -1 ; WX 273 ; N onesuperior ; B 121 283 318 710 ; C -1 ; WX 273 ; N twosuperior ; B 57 283 368 722 ; C -1 ; WX 273 ; N threesuperior ; B 75 271 361 722 ; C -1 ; WX 228 ; N Igrave ; B 52 0 301 936 ; C -1 ; WX 228 ; N Iacute ; B 52 0 433 936 ; C -1 ; WX 228 ; N Imacron ; B 52 0 406 864 ; C -1 ; WX 228 ; N Iogonek ; B -8 -228 301 718 ; C -1 ; WX 228 ; N Idieresis ; B 52 0 405 915 ; C -1 ; WX 638 ; N Gbreve ; B 89 -19 670 936 ; C -1 ; WX 592 ; N Umacron ; B 96 -19 659 864 ; C -1 ; WX 592 ; N Kcommaaccent ; B 71 -298 703 718 ; C -1 ; WX 501 ; N ograve ; B 67 -14 527 750 ; C -1 ; WX 547 ; N Scommaaccent ; B 66 -298 588 737 ; C -1 ; WX 547 ; N Eogonek ; B 62 -228 620 718 ; C -1 ; WX 501 ; N oacute ; B 67 -14 537 750 ; C -1 ; WX 547 ; N Edotaccent ; B 62 0 620 915 ; C -1 ; WX 228 ; N iogonek ; B -11 -228 298 725 ; C -1 ; WX 501 ; N gcommaaccent ; B 31 -217 546 844 ; C -1 ; WX 501 ; N odieresis ; B 67 -14 527 729 ; C -1 ; WX 501 ; N ntilde ; B 53 0 529 737 ; C -1 ; WX 501 ; N ncaron ; B 53 0 526 750 ; C -1 ; WX 547 ; N Ecaron ; B 62 0 620 936 ; C -1 ; WX 547 ; N Ecircumflex ; B 62 0 620 936 ; C -1 ; WX 456 ; N scedilla ; B 52 -228 479 546 ; C -1 ; WX 319 ; N rcaron ; B 52 0 435 750 ; C -1 ; WX 547 ; N Egrave ; B 62 0 620 936 ; C -1 ; WX 547 ; N Eacute ; B 62 0 620 936 ; C -1 ; WX 638 ; N Gcommaaccent ; B 89 -298 670 737 ; C -1 ; WX 592 ; N Rcommaaccent ; B 62 -298 638 718 ; C -1 ; WX 547 ; N Edieresis ; B 62 0 620 915 ; C -1 ; WX 501 ; N nacute ; B 53 0 537 750 ; C -1 ; WX 501 ; N uogonek ; B 80 -228 540 532 ; C -1 ; WX 501 ; N umacron ; B 80 -14 540 678 ; C -1 ; WX 592 ; N Dcaron ; B 62 0 637 936 ; C -1 ; WX 283 ; N lcaron ; B 57 0 422 718 ; C -1 ; WX 592 ; N Ccaron ; B 88 -19 647 936 ; C -1 ; WX 592 ; N Cacute ; B 88 -19 647 936 ; C -1 ; WX 592 ; N Ccedilla ; B 88 -228 647 737 ; C -1 ; WX 328 ; N degree ; B 143 426 383 712 ; C -1 ; WX 592 ; N Aogonek ; B 16 -228 576 718 ; C -1 ; WX 479 ; N minus ; B 67 197 500 309 ; C -1 ; WX 479 ; N multiply ; B 47 1 520 505 ; C -1 ; WX 479 ; N divide ; B 67 -42 500 548 ; C -1 ; WX 592 ; N Aring ; B 16 0 576 989 ; C -1 ; WX 820 ; N trademark ; B 146 306 909 718 ; C -1 ; WX 319 ; N rcommaaccent ; B 5 -298 401 546 ; C -1 ; WX 228 ; N lacute ; B 57 0 433 936 ; C -1 ; WX 501 ; N omacron ; B 67 -14 527 678 ; C -1 ; WX 592 ; N Atilde ; B 16 0 607 923 ; C -1 ; WX 228 ; N icircumflex ; B 57 0 365 750 ; C -1 ; WX 228 ; N igrave ; B 57 0 268 750 ; C -1 ; WX 501 ; N ncommaaccent ; B 53 -298 516 546 ; C -1 ; WX 228 ; N lcommaaccent ; B 12 -298 297 718 ; C -1 ; WX 479 ; N plusminus ; B 33 0 512 578 ; C -1 ; WX 684 ; N onehalf ; B 108 -19 704 710 ; C -1 ; WX 684 ; N onequarter ; B 108 -19 661 710 ; C -1 ; WX 684 ; N threequarters ; B 82 -19 688 722 ; C -1 ; WX 228 ; N iacute ; B 57 0 401 750 ; C -1 ; WX 592 ; N Abreve ; B 16 0 597 936 ; C -1 ; WX 456 ; N kcommaaccent ; B 57 -298 549 718 ; C -1 ; WX 638 ; N Omacron ; B 88 -19 675 864 ; C -1 ; WX 228 ; N imacron ; B 57 0 374 678 ; C -1 ; WX 456 ; N emacron ; B 58 -14 488 678 ; C -1 ; WX 456 ; N amacron ; B 45 -14 488 678 ; C -1 ; WX 273 ; N tcommaaccent ; B 35 -298 346 676 ; C -1 ; WX 456 ; N ydieresis ; B 34 -214 535 729 ; C -1 ; WX 410 ; N zdotaccent ; B 16 0 478 729 ; C -1 ; WX 410 ; N zcaron ; B 16 0 480 750 ; C -1 ; WX 410 ; N zacute ; B 16 0 492 750 ; C -1 ; WX 456 ; N yacute ; B 34 -214 535 750 ; C -1 ; WX 501 ; N uhungarumlaut ; B 80 -14 643 750 ; C -1 ; WX 501 ; N eth ; B 67 -14 549 737 ; C -1 ; WX 501 ; N uring ; B 80 -14 540 776 ; C -1 ; WX 638 ; N Ocircumflex ; B 88 -19 675 936 ; C -1 ; WX 273 ; N commaaccent ; B 35 -298 175 -60 ; C -1 ; WX 604 ; N copyright ; B 46 -19 685 737 ; C -1 ; WX 604 ; N registered ; B 45 -19 684 737 ; C -1 ; WX 592 ; N Acircumflex ; B 16 0 579 936 ; C -1 ; WX 228 ; N idieresis ; B 57 0 373 729 ; C -1 ; WX 405 ; N lozenge ; B 80 0 447 740 ; C -1 ; WX 502 ; N Delta ; B 5 0 499 688 ; C -1 ; WX 479 ; N notequal ; B 48 -16 519 522 ; C -1 ; WX 450 ; N radical ; B 54 -35 605 918 ; C -1 ; WX 592 ; N Agrave ; B 16 0 576 936 ; C -1 ; WX 592 ; N Aacute ; B 16 0 615 936 ; C -1 ; WX 479 ; N lessequal ; B 34 0 565 672 ; C -1 ; WX 479 ; N greaterequal ; B 34 0 527 671 ; C -1 ; WX 479 ; N logicalnot ; B 86 108 519 419 ; C -1 ; WX 585 ; N summation ; B 12 -123 570 752 ; C -1 ; WX 405 ; N partialdiff ; B 39 -21 465 743 ; C -1 ; WX 592 ; N Ncommaaccent ; B 57 -298 661 718 ; C -1 ; WX 501 ; N dcroat ; B 67 -14 617 718 ; C -1 ; WX 230 ; N brokenbar ; B 66 -19 289 737 ; C -1 ; WX 501 ; N Lcommaaccent ; B 62 -298 501 718 ; C -1 ; WX 592 ; N Adieresis ; B 16 0 587 915 ; C -1 ; WX 501 ; N mu ; B 18 -207 540 532 ; C -1 ; WX 228 ; N .notdef ; B 21 0 21 0 ; EndCharMetrics StartKernData StartKernPairs 998 KPX A C -30 KPX A Ccedilla -30 KPX A G -31 KPX A O -31 KPX A Odieresis -31 KPX A Q -30 KPX A T -72 KPX A U -29 KPX A Uacute -29 KPX A Ucircumflex -29 KPX A Udieresis -29 KPX A Ugrave -29 KPX A V -56 KPX A W -46 KPX A Y -75 KPX A a -11 KPX A b -11 KPX A c -15 KPX A ccedilla -14 KPX A comma 9 KPX A d -14 KPX A e -11 KPX A g -19 KPX A guillemotleft -41 KPX A guilsinglleft -39 KPX A hyphen 1 KPX A o -17 KPX A period 11 KPX A q -14 KPX A quotedblright -54 KPX A quoteright -56 KPX A t -16 KPX A u -16 KPX A v -34 KPX A w -24 KPX A y -32 KPX Aacute C -31 KPX Aacute G -32 KPX Aacute O -32 KPX Aacute Q -32 KPX Aacute T -72 KPX Aacute U -30 KPX Aacute V -56 KPX Aacute W -46 KPX Aacute Y -74 KPX Aacute a -11 KPX Aacute b -11 KPX Aacute c -16 KPX Aacute comma 9 KPX Aacute d -16 KPX Aacute e -12 KPX Aacute g -19 KPX Aacute guillemotleft -42 KPX Aacute guilsinglleft -40 KPX Aacute hyphen 1 KPX Aacute o -18 KPX Aacute period 9 KPX Aacute q -15 KPX Aacute quoteright -56 KPX Aacute t -17 KPX Aacute u -17 KPX Aacute v -33 KPX Aacute w -24 KPX Aacute y -32 KPX Acircumflex C -30 KPX Acircumflex G -31 KPX Acircumflex O -31 KPX Acircumflex Q -30 KPX Acircumflex T -72 KPX Acircumflex U -29 KPX Acircumflex V -56 KPX Acircumflex W -46 KPX Acircumflex Y -74 KPX Acircumflex comma 10 KPX Acircumflex period 11 KPX Adieresis C -31 KPX Adieresis G -32 KPX Adieresis O -32 KPX Adieresis Q -31 KPX Adieresis T -72 KPX Adieresis U -30 KPX Adieresis V -56 KPX Adieresis W -46 KPX Adieresis Y -75 KPX Adieresis a -11 KPX Adieresis b -11 KPX Adieresis c -15 KPX Adieresis comma 9 KPX Adieresis d -15 KPX Adieresis g -19 KPX Adieresis guillemotleft -42 KPX Adieresis guilsinglleft -39 KPX Adieresis hyphen 0 KPX Adieresis o -18 KPX Adieresis period 10 KPX Adieresis q -15 KPX Adieresis quotedblright -54 KPX Adieresis quoteright -57 KPX Adieresis t -16 KPX Adieresis u -16 KPX Adieresis v -34 KPX Adieresis w -24 KPX Adieresis y -32 KPX Agrave C -30 KPX Agrave G -31 KPX Agrave O -31 KPX Agrave Q -30 KPX Agrave T -72 KPX Agrave U -29 KPX Agrave V -56 KPX Agrave W -46 KPX Agrave Y -75 KPX Agrave comma 9 KPX Agrave period 11 KPX Aring C -30 KPX Aring G -31 KPX Aring O -31 KPX Aring Q -30 KPX Aring T -72 KPX Aring U -29 KPX Aring V -56 KPX Aring W -46 KPX Aring Y -75 KPX Aring a -11 KPX Aring b -11 KPX Aring c -15 KPX Aring comma 9 KPX Aring d -14 KPX Aring e -11 KPX Aring g -19 KPX Aring guillemotleft -41 KPX Aring guilsinglleft -39 KPX Aring hyphen 1 KPX Aring o -17 KPX Aring period 11 KPX Aring q -14 KPX Aring quotedblright -54 KPX Aring quoteright -56 KPX Aring t -16 KPX Aring u -16 KPX Aring v -34 KPX Aring w -24 KPX Aring y -32 KPX Atilde C -32 KPX Atilde G -33 KPX Atilde O -33 KPX Atilde Q -32 KPX Atilde T -73 KPX Atilde U -31 KPX Atilde V -56 KPX Atilde W -47 KPX Atilde Y -75 KPX Atilde comma 9 KPX Atilde period 9 KPX B A -27 KPX B AE -21 KPX B Aacute -27 KPX B Acircumflex -27 KPX B Adieresis -27 KPX B Aring -27 KPX B Atilde -27 KPX B O -12 KPX B OE -6 KPX B Oacute -12 KPX B Ocircumflex -12 KPX B Odieresis -12 KPX B Ograve -12 KPX B Oslash -9 KPX B V -31 KPX B W -21 KPX B Y -40 KPX C A -29 KPX C AE -23 KPX C Aacute -29 KPX C Adieresis -29 KPX C Aring -29 KPX C H -7 KPX C K -13 KPX C O -12 KPX C Oacute -12 KPX C Odieresis -12 KPX Ccedilla A -31 KPX D A -31 KPX D Aacute -31 KPX D Acircumflex -31 KPX D Adieresis -31 KPX D Agrave -31 KPX D Aring -31 KPX D Atilde -31 KPX D J -1 KPX D T -14 KPX D V -25 KPX D W -16 KPX D X -28 KPX D Y -43 KPX F A -53 KPX F Aacute -53 KPX F Acircumflex -53 KPX F Adieresis -53 KPX F Agrave -53 KPX F Aring -53 KPX F Atilde -53 KPX F J -24 KPX F O -19 KPX F Odieresis -19 KPX F a -24 KPX F aacute -24 KPX F adieresis -24 KPX F ae -24 KPX F aring -24 KPX F comma -78 KPX F e -15 KPX F eacute -15 KPX F hyphen 0 KPX F i -14 KPX F j -13 KPX F o -19 KPX F oacute -19 KPX F odieresis -19 KPX F oe -19 KPX F oslash -20 KPX F period -77 KPX F r -30 KPX F u -31 KPX G A -8 KPX G AE -2 KPX G Aacute -8 KPX G Acircumflex -8 KPX G Adieresis -8 KPX G Agrave -8 KPX G Aring -8 KPX G Atilde -8 KPX G T -18 KPX G V -29 KPX G W -20 KPX G Y -47 KPX J A -30 KPX J AE -25 KPX J Adieresis -30 KPX J Aring -30 KPX K C -42 KPX K G -43 KPX K O -43 KPX K OE -37 KPX K Oacute -43 KPX K Odieresis -43 KPX K S -30 KPX K T 14 KPX K a -10 KPX K adieresis -10 KPX K ae -11 KPX K aring -10 KPX K e -27 KPX K hyphen -34 KPX K o -35 KPX K oacute -35 KPX K odieresis -35 KPX K u -30 KPX K udieresis -30 KPX K y -57 KPX L A 6 KPX L AE 12 KPX L Aacute 6 KPX L Adieresis 6 KPX L Aring 6 KPX L C -25 KPX L Ccedilla -26 KPX L G -27 KPX L O -26 KPX L Oacute -26 KPX L Ocircumflex -26 KPX L Odieresis -26 KPX L Ograve -26 KPX L Otilde -26 KPX L S -8 KPX L T -79 KPX L U -23 KPX L Udieresis -23 KPX L V -75 KPX L W -60 KPX L Y -92 KPX L hyphen -19 KPX L quotedblright -123 KPX L quoteright -125 KPX L u -17 KPX L udieresis -17 KPX L y -50 KPX N A -10 KPX N AE -4 KPX N Aacute -10 KPX N Adieresis -10 KPX N Aring -10 KPX N C -3 KPX N Ccedilla -2 KPX N G -4 KPX N O -4 KPX N Oacute -4 KPX N Odieresis -4 KPX N a -1 KPX N aacute -1 KPX N adieresis -1 KPX N ae -2 KPX N aring -1 KPX N comma 5 KPX N e 2 KPX N eacute 2 KPX N o -3 KPX N oacute -3 KPX N odieresis -3 KPX N oslash 0 KPX N period 5 KPX N u -1 KPX N udieresis -2 KPX O A -35 KPX O AE -30 KPX O Aacute -35 KPX O Adieresis -35 KPX O Aring -35 KPX O T -21 KPX O V -29 KPX O W -20 KPX O X -32 KPX O Y -50 KPX Oacute A -35 KPX Oacute T -21 KPX Oacute V -29 KPX Oacute W -20 KPX Oacute Y -50 KPX Ocircumflex T -21 KPX Ocircumflex V -29 KPX Ocircumflex Y -50 KPX Odieresis A -35 KPX Odieresis T -21 KPX Odieresis V -29 KPX Odieresis W -20 KPX Odieresis X -32 KPX Odieresis Y -50 KPX Ograve T -21 KPX Ograve V -29 KPX Ograve Y -50 KPX Oslash A -32 KPX Otilde T -21 KPX Otilde V -29 KPX Otilde Y -50 KPX P A -61 KPX P AE -56 KPX P Aacute -61 KPX P Adieresis -61 KPX P Aring -61 KPX P J -45 KPX P a -22 KPX P aacute -22 KPX P adieresis -22 KPX P ae -22 KPX P aring -22 KPX P comma -98 KPX P e -20 KPX P eacute -20 KPX P hyphen -13 KPX P o -24 KPX P oacute -24 KPX P odieresis -24 KPX P oe -25 KPX P oslash -25 KPX P period -98 KPX R C -10 KPX R Ccedilla -9 KPX R G -11 KPX R O -11 KPX R OE -5 KPX R Oacute -11 KPX R Odieresis -11 KPX R T -9 KPX R U -9 KPX R Udieresis -9 KPX R V -27 KPX R W -18 KPX R Y -36 KPX R a -7 KPX R aacute -7 KPX R adieresis -7 KPX R ae -7 KPX R aring -7 KPX R e -4 KPX R eacute -4 KPX R hyphen 7 KPX R o -10 KPX R oacute -10 KPX R odieresis -10 KPX R oe -10 KPX R u -7 KPX R uacute -8 KPX R udieresis -8 KPX R y -6 KPX S A -20 KPX S AE -14 KPX S Aacute -20 KPX S Adieresis -20 KPX S Aring -20 KPX S T -12 KPX S V -29 KPX S W -20 KPX S Y -39 KPX S t -5 KPX T A -72 KPX T AE -68 KPX T Aacute -72 KPX T Acircumflex -72 KPX T Adieresis -72 KPX T Agrave -72 KPX T Aring -72 KPX T Atilde -72 KPX T C -18 KPX T G -19 KPX T J -77 KPX T O -18 KPX T OE -12 KPX T Oacute -18 KPX T Ocircumflex -18 KPX T Odieresis -18 KPX T Ograve -18 KPX T Oslash -18 KPX T Otilde -18 KPX T S -3 KPX T V 11 KPX T W 13 KPX T Y 13 KPX T a -68 KPX T ae -69 KPX T c -68 KPX T colon -79 KPX T comma -61 KPX T e -64 KPX T g -69 KPX T guillemotleft -92 KPX T guilsinglleft -89 KPX T hyphen -46 KPX T i -9 KPX T j -9 KPX T o -70 KPX T oslash -67 KPX T period -61 KPX T r -64 KPX T s -69 KPX T semicolon -79 KPX T u -68 KPX T v -77 KPX T w -72 KPX T y -76 KPX U A -32 KPX U AE -27 KPX U Aacute -32 KPX U Acircumflex -32 KPX U Adieresis -32 KPX U Aring -32 KPX U Atilde -32 KPX U comma -14 KPX U m -5 KPX U n -5 KPX U p -5 KPX U period -11 KPX U r -5 KPX Uacute A -32 KPX Uacute comma -14 KPX Uacute m -5 KPX Uacute n -5 KPX Uacute p -5 KPX Uacute period -11 KPX Uacute r -5 KPX Ucircumflex A -32 KPX Udieresis A -32 KPX Udieresis b -5 KPX Udieresis comma -14 KPX Udieresis m -5 KPX Udieresis n -5 KPX Udieresis p -5 KPX Udieresis period -11 KPX Udieresis r -5 KPX Ugrave A -32 KPX V A -58 KPX V AE -53 KPX V Aacute -58 KPX V Acircumflex -58 KPX V Adieresis -58 KPX V Agrave -58 KPX V Aring -58 KPX V Atilde -58 KPX V C -33 KPX V G -34 KPX V O -34 KPX V Oacute -34 KPX V Ocircumflex -34 KPX V Odieresis -34 KPX V Ograve -34 KPX V Oslash -29 KPX V Otilde -34 KPX V S -23 KPX V T 13 KPX V a -45 KPX V ae -46 KPX V colon -47 KPX V comma -58 KPX V e -41 KPX V g -45 KPX V guillemotleft -68 KPX V guilsinglleft -65 KPX V hyphen -22 KPX V i -12 KPX V o -47 KPX V oslash -44 KPX V period -58 KPX V r -36 KPX V semicolon -47 KPX V u -40 KPX V y -17 KPX W A -47 KPX W AE -42 KPX W Aacute -47 KPX W Acircumflex -47 KPX W Adieresis -47 KPX W Agrave -47 KPX W Aring -47 KPX W Atilde -47 KPX W C -23 KPX W G -24 KPX W O -23 KPX W Oacute -23 KPX W Ocircumflex -23 KPX W Odieresis -23 KPX W Ograve -23 KPX W Oslash -19 KPX W Otilde -23 KPX W S -18 KPX W T 15 KPX W a -32 KPX W ae -33 KPX W colon -40 KPX W comma -42 KPX W e -28 KPX W g -32 KPX W guillemotleft -55 KPX W guilsinglleft -52 KPX W hyphen -9 KPX W i -10 KPX W o -34 KPX W oslash -31 KPX W period -42 KPX W r -27 KPX W semicolon -41 KPX W u -32 KPX W y -11 KPX X C -32 KPX X O -33 KPX X Odieresis -33 KPX X Q -33 KPX X a -15 KPX X e -31 KPX X hyphen -28 KPX X o -37 KPX X u -34 KPX X y -44 KPX Y A -73 KPX Y AE -68 KPX Y Aacute -73 KPX Y Acircumflex -73 KPX Y Adieresis -73 KPX Y Agrave -73 KPX Y Aring -73 KPX Y Atilde -73 KPX Y C -45 KPX Y G -46 KPX Y O -46 KPX Y Oacute -46 KPX Y Ocircumflex -46 KPX Y Odieresis -46 KPX Y Ograve -46 KPX Y Oslash -45 KPX Y Otilde -46 KPX Y S -28 KPX Y T 16 KPX Y a -64 KPX Y ae -65 KPX Y colon -61 KPX Y comma -71 KPX Y e -60 KPX Y g -64 KPX Y guillemotleft -91 KPX Y guilsinglleft -88 KPX Y hyphen -49 KPX Y i -9 KPX Y o -66 KPX Y oslash -63 KPX Y p -48 KPX Y period -71 KPX Y semicolon -61 KPX Y u -54 KPX Y v -31 KPX Z v -19 KPX Z y -18 KPX a j -2 KPX a quoteright -11 KPX a v -16 KPX a w -7 KPX a y -16 KPX aacute v -17 KPX aacute w -8 KPX aacute y -17 KPX adieresis v -16 KPX adieresis w -7 KPX adieresis y -16 KPX ae v -17 KPX ae w -7 KPX ae y -18 KPX agrave v -16 KPX agrave w -7 KPX agrave y -16 KPX aring v -16 KPX aring w -7 KPX aring y -16 KPX b v -15 KPX b w -6 KPX b y -17 KPX c h -6 KPX c k -8 KPX comma one -65 KPX comma quotedblright -27 KPX comma quoteright -29 KPX e quoteright -11 KPX e t -4 KPX e v -16 KPX e w -6 KPX e x -19 KPX e y -17 KPX eacute v -17 KPX eacute w -7 KPX eacute y -18 KPX ecircumflex v -16 KPX ecircumflex w -6 KPX ecircumflex y -17 KPX eight four 2 KPX eight one -24 KPX eight seven -10 KPX f a -12 KPX f aacute -12 KPX f adieresis -12 KPX f ae -13 KPX f aring -12 KPX f e -10 KPX f eacute -10 KPX f f 12 KPX f i -11 KPX f j -11 KPX f l -11 KPX f o -16 KPX f oacute -16 KPX f odieresis -16 KPX f oe -16 KPX f oslash -13 KPX f quoteright 0 KPX f s -13 KPX f t 12 KPX five four 0 KPX five one -30 KPX five seven -10 KPX four four 3 KPX four one -46 KPX four seven -27 KPX g a -2 KPX g adieresis -2 KPX g ae -3 KPX g aring -2 KPX g e 1 KPX g eacute 1 KPX g l 0 KPX g oacute -4 KPX g odieresis -4 KPX g r 1 KPX guillemotright A -42 KPX guillemotright AE -36 KPX guillemotright Aacute -42 KPX guillemotright Adieresis -42 KPX guillemotright Aring -42 KPX guillemotright T -89 KPX guillemotright V -63 KPX guillemotright W -51 KPX guillemotright Y -92 KPX guilsinglright A -40 KPX guilsinglright AE -35 KPX guilsinglright Aacute -40 KPX guilsinglright Adieresis -40 KPX guilsinglright Aring -40 KPX guilsinglright T -88 KPX guilsinglright V -61 KPX guilsinglright W -49 KPX guilsinglright Y -90 KPX h quoteright -13 KPX h y -18 KPX hyphen A 0 KPX hyphen AE 6 KPX hyphen Aacute 0 KPX hyphen Adieresis 0 KPX hyphen Aring 0 KPX hyphen T -46 KPX hyphen V -19 KPX hyphen W -8 KPX hyphen Y -52 KPX i T -9 KPX i j -3 KPX k a -9 KPX k aacute -9 KPX k adieresis -9 KPX k ae -9 KPX k aring -9 KPX k comma 7 KPX k e -11 KPX k eacute -11 KPX k g -16 KPX k hyphen -16 KPX k o -18 KPX k oacute -18 KPX k odieresis -18 KPX k period 7 KPX k s -15 KPX k u -12 KPX k udieresis -6 KPX l v -14 KPX l y -13 KPX m p -1 KPX m v -17 KPX m w -8 KPX m y -17 KPX n T -67 KPX n p -2 KPX n quoteright -12 KPX n v -18 KPX n w -9 KPX n y -18 KPX nine four 0 KPX nine one -21 KPX nine seven -14 KPX o T -68 KPX o quoteright -16 KPX o t -7 KPX o v -19 KPX o w -9 KPX o x -22 KPX o y -21 KPX oacute v -19 KPX oacute w -9 KPX oacute y -21 KPX ocircumflex t -7 KPX odieresis t -7 KPX odieresis v -19 KPX odieresis w -9 KPX odieresis x -22 KPX odieresis y -21 KPX ograve v -19 KPX ograve w -9 KPX ograve y -21 KPX one comma -39 KPX one eight -41 KPX one five -41 KPX one four -57 KPX one nine -42 KPX one one -74 KPX one period -39 KPX one seven -55 KPX one six -39 KPX one three -46 KPX one two -47 KPX one zero -39 KPX p t -4 KPX p y -18 KPX period one -65 KPX period quotedblright -27 KPX period quoteright -29 KPX q c -1 KPX q u -2 KPX quotedblbase A 9 KPX quotedblbase AE 15 KPX quotedblbase T -61 KPX quotedblbase V -58 KPX quotedblbase W -43 KPX quotedblbase Y -75 KPX quotedblleft A -55 KPX quotedblleft AE -51 KPX quotedblleft Aacute -55 KPX quotedblleft Adieresis -55 KPX quotedblleft Aring -55 KPX quotedblleft T -6 KPX quotedblleft V 4 KPX quotedblleft W 9 KPX quotedblleft Y -6 KPX quotedblright A -57 KPX quotedblright AE -53 KPX quotedblright Aacute -57 KPX quotedblright Adieresis -57 KPX quotedblright Aring -57 KPX quotedblright T -4 KPX quotedblright V 2 KPX quotedblright W 7 KPX quotedblright Y -8 KPX quoteleft A -57 KPX quoteleft AE -53 KPX quoteleft Aacute -57 KPX quoteleft Adieresis -57 KPX quoteleft Aring -57 KPX quoteleft T -8 KPX quoteleft V 2 KPX quoteleft W 7 KPX quoteleft Y -8 KPX quoteright A -59 KPX quoteright AE -55 KPX quoteright Aacute -59 KPX quoteright Adieresis -59 KPX quoteright Aring -59 KPX quoteright comma -35 KPX quoteright d -23 KPX quoteright o -28 KPX quoteright period -35 KPX quoteright r -11 KPX quoteright s -21 KPX quoteright t 0 KPX quoteright v -3 KPX quoteright w 0 KPX quoteright y -2 KPX r a -9 KPX r aacute -9 KPX r acircumflex -9 KPX r adieresis -9 KPX r ae -9 KPX r agrave -9 KPX r aring -9 KPX r c -11 KPX r ccedilla -7 KPX r colon -19 KPX r comma -47 KPX r d -9 KPX r e -8 KPX r eacute -8 KPX r ecircumflex -8 KPX r egrave -8 KPX r f 12 KPX r g -6 KPX r h -10 KPX r hyphen -30 KPX r i -13 KPX r j -12 KPX r k -12 KPX r l -12 KPX r m -10 KPX r n -11 KPX r o -12 KPX r oacute -12 KPX r ocircumflex -12 KPX r odieresis -12 KPX r oe -12 KPX r ograve -12 KPX r oslash -13 KPX r p -10 KPX r period -47 KPX r q -9 KPX r quoteright 4 KPX r r -10 KPX r s -8 KPX r semicolon -19 KPX r t 12 KPX r u -12 KPX r v 8 KPX r w 10 KPX r x 4 KPX r y 9 KPX r z 0 KPX s quoteright -12 KPX s t -7 KPX seven colon -48 KPX seven comma -77 KPX seven eight -11 KPX seven five -20 KPX seven four -59 KPX seven one -14 KPX seven period -77 KPX seven seven 5 KPX seven six -16 KPX seven three -9 KPX seven two -8 KPX six four 0 KPX six one -23 KPX six seven -9 KPX t S -5 KPX t a -3 KPX t aacute -3 KPX t adieresis -3 KPX t ae -3 KPX t aring -3 KPX t colon -19 KPX t e -6 KPX t eacute -6 KPX t h -4 KPX t o -12 KPX t oacute -12 KPX t odieresis -12 KPX t quoteright -1 KPX t semicolon -19 KPX three four -1 KPX three one -27 KPX three seven -13 KPX two four -21 KPX two one -21 KPX two seven -10 KPX u quoteright -4 KPX v a -21 KPX v aacute -21 KPX v acircumflex -21 KPX v adieresis -21 KPX v ae -22 KPX v agrave -21 KPX v aring -21 KPX v atilde -21 KPX v c -20 KPX v colon -20 KPX v comma -40 KPX v e -17 KPX v eacute -17 KPX v ecircumflex -17 KPX v egrave -17 KPX v g -20 KPX v hyphen 0 KPX v l -12 KPX v o -23 KPX v oacute -23 KPX v odieresis -23 KPX v ograve -23 KPX v oslash -20 KPX v period -39 KPX v s -21 KPX v semicolon -20 KPX w a -12 KPX w aacute -12 KPX w acircumflex -12 KPX w adieresis -12 KPX w ae -13 KPX w agrave -12 KPX w aring -12 KPX w atilde -12 KPX w c -11 KPX w colon -18 KPX w comma -25 KPX w e -7 KPX w eacute -7 KPX w ecircumflex -7 KPX w egrave -7 KPX w g -11 KPX w hyphen 9 KPX w l -9 KPX w o -13 KPX w oacute -13 KPX w odieresis -13 KPX w ograve -13 KPX w oslash -11 KPX w period -25 KPX w s -12 KPX w semicolon -18 KPX x a -19 KPX x c -22 KPX x e -18 KPX x eacute -18 KPX x o -24 KPX x q -20 KPX y a -23 KPX y aacute -23 KPX y acircumflex -23 KPX y adieresis -23 KPX y ae -23 KPX y agrave -23 KPX y aring -23 KPX y atilde -23 KPX y c -22 KPX y colon -21 KPX y comma -40 KPX y e -19 KPX y eacute -19 KPX y ecircumflex -19 KPX y egrave -19 KPX y g -23 KPX y hyphen 0 KPX y l -14 KPX y o -25 KPX y oacute -25 KPX y odieresis -25 KPX y ograve -25 KPX y oslash -21 KPX y period -40 KPX y s -23 KPX y semicolon -22 KPX zero four 2 KPX zero one -20 KPX zero seven -11 EndKernPairs EndKernData EndFontMetrics gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019064l.pfb000066400000000000000000001126461404163720200221040ustar00rootroot00000000000000x%!PS-AdobeFont-1.0: NimbusSanL-BoldCondItal 1.05 %%CreationDate: Wed Dec 22 1999 % Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development % (URW)++,Copyright 1999 by (URW)++ Design & Development % See the file COPYING (GNU General Public License) for license conditions. % As a special exception, permission is granted to include this font % program in a Postscript or PDF file that consists of a document that % contains text to be displayed or printed using this font, regardless % of the conditions or license applying to the document itself. 12 dict begin /FontInfo 10 dict dup begin /version (1.05) readonly def /Notice ((URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General Public License) for license conditions. As a special exception, permission is granted to include this font program in a Postscript or PDF file that consists of a document that contains text to be displayed or printed using this font, regardless of the conditions or license applying to the document itself.) readonly def /Copyright (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development) readonly def /FullName (Nimbus Sans L Bold Condensed Italic) readonly def /FamilyName (Nimbus Sans L) readonly def /Weight (Bold) readonly def /ItalicAngle -9.9 def /isFixedPitch false def /UnderlinePosition -100 def /UnderlineThickness 50 def end readonly def /FontName /NimbusSanL-BoldCondItal def /PaintType 0 def /WMode 0 def /FontBBox {-143 -298 913 989} readonly def /FontType 1 def /FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def /Encoding StandardEncoding def /UniqueID 5020916 def currentdict end currentfile eexec  `,i"[[5j5mTʻ^+݄fKitrޟm%9۩*++`[&NfA-O!J"|UY+; <Ԟ2?.P2QhnDtw=y0)n*[ Y]~ ΁RzYi[AXm>o)\ϸPs@K,8 HDj'$xBp|*dn*`sqiBK qwgFE e*i;cvJ12UP|-ye2(`? &&ձ( u!t1ah5@!0v- xxcו /N5!8}[&߮͝mݹaUB~eרX9X泴)ѩSD"ͯ8dܨZ\J3\:C- {ByX.xJvKA̐ZjO~ ŰOǻ8?ݿƮSҷ½?A3oltc`ެL<5e]۵ֺi]HQ{ÓD, g&y 0Io񵂢ǖyD"NăS+yͩ!DdL^ǃc`ńպt2#,XJk;!S9Fv|?QԻUb|DZ Ϳ0iWjr~`ߧXG.galyO !hO* :HIotPxgdž@ŚүˈU>vj &8\f뀂T\Q *%ŬMk^rhxfy' P>b=,2Sa4$.OS+9H%uv2X$G2:'bA`o@pr#ZP||:< ?hX.7cr_ߠ2CRu|Fm:.~IAy%UzN&lmBIr;Y[mUЄge%N-Jb51Ux^Tw5hF`|CD r,+ q7 aj${9h̡ K$maؼu(x F"Rr]"^s&/fXC1/Qx j4o~O&ԝȆ] :Y}!&jh M4-*) {r{bY\'IL={wJ?ml#)x{ưO4ӟ8jQ7ԥ0089q,C+:[QQn ΐg烣(깂^zϧ҈6i&;€iG XGRN#q 7Tza b> Gs`~Ccu:(bϐ[;4P(IF9LVLoE;0qb{z$j%ۗF/+Yr53dR#BKl kda9Âj/}@eԮYW0wׅ̍"@ xHo4T@ >D_Lj٘ѧ1r(<Q 5r3 G3N7g6?Y/ ^܆t=^?h_sl\=tO繆%K8*™$ %x2 6|-PÆi%dkz>MR{ay5L%/Ը+o:&&R-pֺFhoϘn㦜687$2G/݊)ݮyXqO/eŭdjeK( sTrmLkǒ| }Fd8ؠp7:t)Ȉ/J;' <2 {>za5B\Gi7,C42|Ƥ}&/PnFʊ;'$%Y6Ϟ4}I|z I  <0"$’_g4W$ ى7B3aMwG*PjRh98nw4':P1@bԪ_TI~@1bO>#,M;-^U;4z#7yoa@YuʆI9d@}Gi\4S6 RtZV10qE,:L+ՔN`$'83`upB͍ -Hv–m]O(lSU" \U~Ls2iX𾹣h'n0{ⴉg'a^4!M9ڥOzAƒ)ShN*T4mH,KB'kCOWV%yI@؋Mp -=8C 6xō &ι[y42ns.S[6SA`WY/~?|Vcp/YKNfZ~H]F \w9wGJqJ&\l{C%jTXqV}4y^"wowD !3Zq0Sk5 6"[?A_ 8 i~÷XQgœ|-q!e rry Xv}eR U~l+WKIJ* vK+r2Ԅo+9/av8>ztE@BC8f[@7+I:Drl_L ij? nތI/v?[e3M] GIi  ~N 11.M 0PϜۑՅY]B^}?85/WW\)' xX78tq{aӋHY X)S$ކMl dkb'8>b<7=3 YvCDꍥnh^.U̮Xy fLJ f6Ez<#`MI wX?\5?p%\aD/L V|ɾI7^9㱦ljH]d*@Zv5 C 5nh+T?a4j3E"f_g@̫G]z>`IcW%MXU)н@TFqPq0F6k߻0l4~׳:2,b;ko"xԱ|0dc97R U bCVp咩BrFcmڗQQ {t{?~6 & ւa̼Ej66'%dg(gɕIpLS<)K zg-gĽ>ԭSIfL2cjԿD6{ $``؈: BxU]!IԣSqO q7TًR[74`ѐkhC7wD[Sh}dT&V'Kmœs.w}M K}ˉoL-`4@%3PX^~N s>Hvj!9/=nB~gNDYƑkSHuh+uz:!4Mc˵Cxw/ݕnM35nmw͗pDU rxLF%Ցe[ |ۭls1P5LoRҟrYͷc/Sd0|.AQ2˧5 dz@Nq&3"auhBr([u~~ϺyYԝ+gZ$x5sҫY-Ooc2QE>~6TBvwiRv9g/UK{{&':!zn5h{Lzh{'UIpZڐe-X#u ~2wY.sEwN! x2ZF0,>0{}6m3NYN=:`\fĞts֞d`e{EVmЬ'-bEcܭNY$Hz0U-(7 CSjϵ%3 =U,4"'+9~tG2ǂDѴKE"]iLMB)3Nmfj4,xi-)1N}Rm9{|x^N{[A>M,%\vP@$r($>(=" yWrld_aޙ $ ޢ<;γƤOn޷O1N҅?3;2!cD5{'4uM@7,Lx_Y`h^[%1iDvy/|I+8sB6Χ_2PajQOǕךĸ{:{.AȽ1FN LkڈV՜5cn3 ]prUv+$'D 18<aazH1OKAE{;y}r]hC @j:ܕS|qE&4C &"*[DJfs\YU*%z 2|vM` c-8nU`\!R;zDŽZtxӓy"}0VꝠ ʪӸi׹p< :mI΃xXO؅=F\qxJ#OFKcajɳd"EW?㿡sW}gQKB{DhK4'W2뽜v!1V]dyH'( 9˭Q8'0%tBA[a71ϷQaF&M6D?H`m9bƪև'3"U' [$v 09yGC'!GY-\ӉcTzfdv!Bh.EZ{kĔӺwA$6 v3wi -}gm y4ET=u IGQ2s;IK ϕ~w@˵0&ETMVmVA.=%k0"m`oih6[[hi-z]B ,=#,d$ɑuA Z^84duׁ̪,3 :NaLJkxT.@ / j9[f'FEpfw6Χ4j7@?P(p $Ǧ73*ϳXAN k ZIZw-*˞Jo+5~ ]`Jdg)UHZjs!H6=@|͹]ɏJykHqx284iTH(p- eYF;{ɷH$+6fF&M?ٙ b{ 򶇐>J-"!Y@B$TI/bvV2[͘jt͖/k_ח_ehMlԮD&ˇ+;+ 7Sߋy7 |S|M.z . ztxZͭ6&=DwqWؚi/LƎ3 TCG%NnBs븹TurݲQs`<萦.[ "ZHdѻ (c#uzՓ[Lc㈗ɥWo H n×LĐVjRwek>eʼ< XUk5dEN*X_vz[rN:"ziFl^h&)M.*$ƚQ4#ֆKIvPP/אW22b ]JHV>i )M \H3>5$' 0k4`P;L} S]/5Mpmp< ({nSF};DT ?b~cMpk* I@C^}ȲK<2qqcv"ֶB_ ,Gr:V:y^SCD j2b曓3fd %QomT_###Tޥ_4I9(s5#U0'D "n}ͬ -sȁ_ W(c49bqۦV#:dlr#&a'1ϪjQf,NfHAY!̠6`4ĈAT=} ~X=}LOܬE$!I eBbrWllX'rIsf2ُd:H'[eR&&GĬ)U=U9~CeS,\=Ʀ +|zxllbz©4'NJ2ԑzwm"#1Kۣ喗F菬B@G(C1 1{l옛P=ܦu?p~{7 5=_+9x'nuڭP "o3])HuUreLڴLr_gl=+baدZTs9"͍dcWj v%3pCS/*Ibߧňh~ nϗ2cM5Hw"S~AJm {^UU ] $>٫HBF;$T dc$诏VPAe@D3Ld< Gw_-;qvTC&b7i(1!dց N.ILtgBzFO3\o0S,Taw9u , ]7;)H~R| ylkP eO;4pyvjܞ>rәX N{Bb:KZ1p j1|FxENZcۤ =Fw tC$Bd?6,{}(Ʒv#m_ؘ_,;G;q$8\b\w Xlo`\1Mqfr/57Q:rÉM"!+ Q )L{2pTc ʴ-6ai*,Cs$˴2R&jM@kN0ij@֯(H~Y:\Ŵ9hz뉳|b{YxiגjhIdŤ.|>r ?5:$2`M f@sNI'Ozv.y DW?DZ"1`T84+]npMDe'|\ ƾGXSfqʥ -A1qNJ3;N% , f*| )lhR =dOxy\]Q+$2%l@nUPa̙MAٷԌ~~v3x+9R$@NѺ .!CMT_q6È&?5a(mnХŤ&#gpÀdZNyH|g@;J-)c*)?S0Fz WiC T?f6%[G\ed3-78dû߀gXd1X.yRta%& KU9_bc{+S R m\}p_ҧ6 m|fCU5K(y@\_] ʳZ"?۸.ǭ>Fj "f23Ds>踽Aꍥm.틮ӶTYS}3W„8'm \A78tpMۿ R."pa&EAﴪ:Q}]^QI&$cʧ%^ƅϻVqWؖ퍯+`+\!(^W_x6]ӌ7ᣳLw"yv. W/D9Fiz=ullW2>$O@`ЀN;\糾(pr"5ߏy)k{G:-$9 r!#b7?DK><%s1\*p eGX4ɍ*!oPe ##5Nʪͧg )h'؟V$Yt$%-M 5%Ў]5{c'=@9+~3.:J<63Y=<ԓˌUxOV+/nIJz)ݍ "GV,qggHi2yPݏM$YIdhKwngyjq:!AeL0cI JWNG19;LW=.Mi {/|X6:#Y W|őy҈[.^wlݔD߀43|tm|/8BLK[=VuB+ FLS~}F0Zy5p)8`[XqVEt.F9VtHmVһ5M#N1hrh*Ѡ 7dEVUCgU5xI (O70½0젌V?mJ'QH}  *b},2l ~; !Srw>y\,MS>9 +*vtۻg[ / zߡQr0&}Fk4~UW}P]k!ZT^%O:Ro>*K0q SCT8!q']ˆ M><;Lç*/ JZpG,9 'Te uX| ϰR1m*<6لLjVAj~&ń\Ky84q^KB}[ BA+G,H;L+ݿ,w3ϵ| 2 >Wefdc'S2+|y]%C|A_xRa7pWOI9lޓ ).6Jn%.I;Yfz =po $11Y A0yWIy4P,8׍0N(^Ă='DF9 X\ ߭Vcozg> E}ԇ4 $Ǝer̮)lZd}yݡCԏPʛʀށR4|B{=|q!6.h-$ =d{:G='y%;Ӓ@ (-NX]~#a´߳es_%`to ֦g,?9~$[ݱؒ>N> s_qtRqNe~ׂbn M_@ĺLi܀ܽ f&P1wy|/wc{(xSa[!_y3$$:%LUJsQ旮NO.Pk@#e! o >eioU&և<y Z)v WRxC[[BWwnܹ֭N6]mcY֠<0w =*hU-R6 e}`w #AaOhԥG\q~eE)śSp*4ajiWnS#`vuC;1W/x-y<-F+g ޴B`).\qh-r v& ivw'y|kaޫY7B10EڲT Yw_ Ļ:7y0m/&o?b#b2S J]A g /EuXrM,N,4Aд_l uhYsBn),~@L|PV6{t#.j>2Ȭ1ZX(Q姣^/Ip!z 6؀Xֿx#,uO ȝԍ- VҮh`*go͠9>\ߓXahj/ʊcȴ!ӽG/o{F'knufn쁍k[W{Vl@'ʡ*=ZnZ1r|NC\[)Hlg Y1E*wlo \.?]QWs !Aв}|>KRKz+CYmelQ=QR؅L|Bjۏ{@hTBt£pi qJ~g7ExfOErC#b㴷'gS@2b^7G eYrGZSƬS*kxxKF( Y!j/vXmOݐ#qy  KRr3MxҟDX.2Kft!~Ce#ۙ4&'O+y !6]p (&<ތv:[лyYruY&J|!ӹ >ON{@*G#FQܝ ϑJ:9p0 Ϣd2Or$BCI#ҿrj\׾OuJFb2\v>|~mUF1[(&~eBm`VU-%t"8^2FV╿Ze`d!_˫v mu"~3I VL9pWӭX'/$*9|R^E}Vҵd&MJբiG;ďYQ['Awy"LGP6(ccJu*u໣1Hop,I,2җ4|A[8<_ł#*CLQ\xmw>wQrq/j1( 9GJ٩/QY 1h)A(}X`&)9C|YW<&sZrT={\Rppٲt[83榭tO,AYe1[v^M[ z6ՙz:>3"*Dq-%wAe &|Ղg зbDmʍdQZU5bїE1o4i 顢aicL!* uXLq?dqI!՝H"N¾[ !X\ W@uq**= HԜ`R^lM՜J *6:Svρ9ڋk3~2Bz; :3R|%]ӨpXx@%VN58-wӧǵWŔ .{B[Z%FzSzi9,"Kc& eu_N) V'llY:7OyϹ.cԞ[Ǫe)'ӘO'Rwz]pHqtMy`7X ,,G*VGͳ\Wp ]ވֹO*ϱ¤DE.̾瘦_Nɀʫ]ޭ t.:,38,~b -Zd?*@5Q(NGTH-6* YA5_m A8ZG/^NyBK{qSaHmM⚭𬟅1 0<$[!㒦>e ]Y^$^,n p(AEDExZDKNDpTȋ}ڬ&jѨ~3Kdelڜ\'RI\2 K_' ϿgM_Ges݃ҫk3xTUj @&cwyv8<.[k {):Sڮ[*>2i?—ڧ>*Tx|^b PQy uy lތ&%_;wyk6SGCYldze|y4\1 }w3pW^fi,}AgcӾ?=W@;CjDvdV<{GxIU22E6"~.HZp$)SH>׍?7RHZʿEG㫲dVҡ `;5@h}-z4>K1k/DTLƁ!?H"F'v"پ{ꂮE? q B8DOQ:߻0+LQr2BΪGR6ԫ);l*4iQinb7E"8}H.!M04XcXG|RRaZrƾ"= ID&ֆ{վG*?LK>44 C]Zq,z8sHU]hk GxlڬsS;$Iqf̫p CiIӧb t\^4ɋQN扬@VBqfЇ]~=FtAc)DGWpLinUg*,wLhO@NPZhl~L$j㰞J->pE)TH0,f=hEz[iWw^ ~< prdR:be7EDa%:8 r5R_rX?f"Tw|oF|!_)m1v+oIJg38i/}tL Qaޔ֩t &CSӴfj\ noEDyl<_o>J?E$hjSZZL Ug ^bOd9u!V2''h-l/i[ԏ\*eMAxc 4L4J+lkIWۅoZH?67o7PidEJ!q# @t!^{قUFnK`FV@NB{nG;اŽb4WZTj쪨 /}uE7,>Z{lǟH|yk@>so-g:pWQH皉%T,d|j#׏>Zb+B6ޒⳂg&mj4kf#2(j13͠"E(":Ȣ]FM^Fmqq<,Gh&'gv6Ta}ё"ZZBx6钺 : AhyS"v ]/Wi)"6Qt}!b6~ 9xK3aatR x٤׍`s0j`#$bBR d 9{0 M?#S-ORosy 2D3,F7P@eFy~l^їUSO2g/U"HNA`4sQ7A*8?#Vx\сGu;,`rh0CscSOBbBnQA RS2[(@EKS٤IK}ۀckqTFk\'5̎yBa=VUftt`/SC\VXzUszvbpܜ0 D*cU,oّ#yז Lu:g ďLGu]r,EgT^d{5rDbC;pf3E&?[~r$v%^$љ-z,3ť>p=#mOeNUĈ> BM//tu}6c^eD0 i=]lVːNy͔=C4>>̨d i}-.q gL`CTeN4=}(c`KH6\xgA2Pu|~1  UPOl٥lgBK2:J*fWϓԍm/+7|Wr\Pt7NQG4o׻$N_mʺ@R#C;rfe]OWD&kL#Ǔ[yىȻUN$ِ spv`XY&5W/ev,E s8~or7Ԡ$D;i6ſ`Ze{l8݄ l[_)/q5, R-Kfr_R!4w,RS# >}CkcM"VP-C>m1bJwU l;~"&WoF,Vgv-Vvu<qfMpUcղBQj-/ݕ!Au#nNn7c#7*}ސe ֗ܵ/Q9*/w**KIWqI l^5`YW? K,xy)KH®jg&x8ioX#/@u3cu>serË  8[\L=<:#d%}Ⱦ9n@VTKY#LWzRZ~j.ٓm$.+Jo-jeb.Ps.h^[SN$l=P8{/8&ۘϙq30wcѕpGC~3XigM.AlY?b"nX4 iPIf@2 Eott !,{N|27'3M8 5V=ĉi r"b&duGՓVP<6Lm,>Hm+L8#$R:>Ѿc[oTøz;E$ g7/*=gp`O뺪g1?էSgJOࣧPo~14U+s[~\W__4ai7 J}uOsQ(]q/gZrp溃{l {}d4g1:mvGZggH>a'58|Η€> GRRYy2Ռ}NwuѥNi ,Ikƙ)&2?v־2q-SPZ+IbL\f<`u~P%X]| 6eF)yQum5EƩ3_|deXKs6ՖMTfe8N<;P7ƥq뺪D?7 jbX=Ì9Wg^;(=;**DnAToxmxA0vmby P3_z`btT"ۏ'&F?ke4!yU:xw !f 2O cC>AqÌÅ83ySxd'^0*?5dwJzY ;v dKPn &皯8>) έ6CGð۲NVmȪ{2V0LSrW`X&:|=Pt`t(4\)-!*>)&ʹ ۔yx0̟B&:cQxKkErHI/ 3AʶʇUlH<}ɴ%Dګ4/0L]a8@h1J?Y,  0x-t "-=ZNRx08J/n i##n8Ť| &`pdܬ)841[eבhevãSDIh~P<5zLՃehs4f!gsX~á0-Ғ>G{tLqڝv|v2?E ĵ8]\9ٍQ$i֗p]BqfpC =7CQG˱Snto[SNϣ>VS8`,w=t͐!vѧ2;G7#aJt1GgS;LubM3^eN9K;b<*{E a,xuAZ3 gv33UXt*le9N6Qך䫰A1`;dRtB;?J7>X̙#:NK:~و`g,uYpGrudG{z>v$ŁHS)4)c!sL{V}갬г_·*4wxy*,=͕xA@WFe7o0"{ s~K4VLiJj~.ӒHTbh쨋 eB`յVv+훒_AXw84{pbsݼ\q C?8%lD;] OLeˌj0Xe36GԆН8(KL+M@NRSf$P/Q.rcoPF?)ʗSۀbvF(x'9 +v$'9r贈& V iP3:*(V5cd޶?pZVuYEQ RQiUI+!靆|cǮ%SAw[E==LՓ" (Y^%/ͫVOdNv_?-|pM $bS} ̆''c Ewfś< | \- "dfNE>`sӋ}"kV qY/PnrNb{Hh.8i%$ЯB~m)7E y՞uA޹/Eb^׹wmd8=,jMl}#O!\PъV=iv7T[`0IDԧz9VyEYP۹IBB. jnD>BY-` ?3| !u8(k'rdeuIuSZ7id!'֧}X`Oe&Tn}N"M*܀VauCkc)L0cIϬVfLj^P6h5`MV#\$4u~{d۸!B8E=&j#WqY]l CJ&y|JsL)pHD$Mܴǵ۸dځj;dvK3@;yP^[FEޯru@5pA.Ht_p'ڥCj2sAƱ nUi^y:q fNl!6BqkȠ{i62.g'jsw7/WkO{I|$C?-WtɴL&H聵9w3\N[ZN̹YR+v8yN!|ɖ 2#ӣQ}Pٳ"2Lf[6,XJ>J ZUDz_Hwkm˙?S\ ]Jsꌨgh)/EɎ4.Ec2oV>ШRjTE$_{!v?tȉ`)lD.0w/C~g N HOpFIz#K<|NtUFA+&͊>hb7ܸ2 VzTTSs,h7O) qn4 2Cw; VrԸk|. J?Eu;:XҏM[cA)n4]OKnĶ6O.{qjdY/ hGOW03G<J9AB˨>ڼ%ּ 'SÑ[h?T/=R0#4N9 ]bf|cF*6 :ϨEq:s GԿOaTiI4jIዞ7Sj#Ysv͞K0 2ZD1=A9~B5e8pZzL2e t*ނdߘJurg\=xt\ 롣iPc7aƫ5_}WMZ"X;̒R-ߪ[Z)E8Mxm/7SI#&ɍ@FҔ7˲F;J E{ [5DMNs!CV%X6K 3RlA?ܖ869JgftKUOpv%G6B$E7j^3LKW9MQOiy|Q,TJ3YL [+YC+F\2smTm͝)J>J(\PI$MT_ 'ϰ~ְTТ2),9Ї D:Jsm.V˟7o2[=:BzJ{-=Yrxf)v-eE +h&5H]q%T( 3D#0 $x7KX53\-q&*Irh,\F9-]8ta>vܚ*a( @a%!z&k۶B䯤&(:~zMQ$rNg{ߕP>*ب.Tcv07,z*ܯ?@@b)|UlY3g:bj N~%-r+G$vc[~f:N'@R mߗMް@yrl?|en\˷zXrb?h^8鬣vI{]3uskV<` 8f DCjfKn 27?#Cnq@)˅bGhw~P]ZBx$`X#$$\?oʿ5>2g/c2w%RkUݟӚ'V9,bm~.}pNT T""~]Z*e}Ofllt!v~Q3t\ZݹO^"]Җ+ C7`>Ɨ!,mN( Ryw9j"'mf=j6qI+c&HʃЈw'^faE7qZ.W2Ebd`at+&a4s皋4VHFB,B=݇Ј00sUҭXg'ԡ9S5A0ƉPRЕzO³HF H1\$v!Jл)g~|v^ 6KlDұXw1k5scc1c&UHaWo/}p qN ̇‚ jtCҏ[$gC0j8D/~@Vo lQFoMq!W%wDNe!ZGj۸Ьlڷ`&P8S*z;PCuFe61jDDQvs $9w˼'egZuyO3"TTz ^˳ۃtŲ[f`X"4ҏLWeۭr^3Zvʴj{HJ\ŨVxLhJ!|_Pj%'Ca8,2'2>gUu#XsNU5+KŴz2/[4 ٱ߮}~Ru`oـ Dut}Ǵ:qCzAQ!ƈP;%- й ct̒k0<䌵g ¡8Z~R.lc`$mI{$뼑PB7n])!:X/B؍ /OȤU( aͶXi6)7s#iThXv`Tc8<KVNS j#mb0/*͉N۱ڄLU~e&xm Wm<OjIl~K8oy_:[l_<(*℆PjwoXmL8Pii}oh F }B] X#%/{7}F˥D@y}ZD-k42L6/yɣ>ڜt$:Ԯ"dA6.DPy`owVs3bpQɓ/6&i{xyHd-Av&=eF L y[gzDNU^t` 0<6lr^JnBז'rWg43]f7^5ڷD@IgmS]O}x?3aG!L[ $&%ww?mZށDeYN@N/k<3kO Of?Qr .Bx+l\c ;#̗@Nm _s&>w_ⴎI ׎d˚=e9*hyB[ٿj2 @e!qeq?óTU1k|oBݎltNxA`>zQ>X`@}L_OiToX`]nӠ} rՔ,QvIZi;7w+{u? EZL^mjx;[W,7Z6aZQn#C l陋׶(\h?5 E9Ͷ?2L{OCۦse-rqeJ_D5h}iNM{ߕbRk5KFiE7xlFpDRxi{eD &UӔjl+ѩ.ͬTΥ{RĊxE`gi"A*Hoc :E"̭:F5& 2%oB5X"?!΃OP.P)>oT厲~jrPsΆޓ )G27/lEowN2 $XP5fNVL^2˟tqO6 ްpJdZd۬-*_U P\VHI6=h%:8U|s{.jބ#$|}a|b2Wm_A9VVCmJ-$F>:m;C2h`sԝ&4xbȨ({Ohig r##P,6vh7 Mz8q@Vb(++qv7*v{I Ŧh7d! %̵/*bA#2g,;絇6j+^D%seE.)f=vWϠ+f$[MG2 vXe^ N,Iֻf`ܾo3#\:/qq(sީxW6G5Mr{d4y|?>aYkF-姶ѣO+0;~hQ *a=nW]L{;`pRkrZ_j1]E2m#x}ҪԮlmH {~/̬^SZ1)f_o)XR'DU\>Cl7kru _Ƥ[< dp( Kqm E CF-,gOr'c);1IJCCд|9w2m; H[ҫʆSe# =a_f~nB!\ ٬0" }FKई,<7Qq!﫦sYuӅDBG^<ӓ˘@rv;h9C[FB^aQht/oVIJ8ja8p`rj ZvD1b!`8!Rr$)[[TD>~{V#+ TYwh BBb؛u'Blv8<ihzJPΉ^BUo?+ }:6}1@p+)Ӓ7Jz>Gsnj]  X}/߳Fyl3m6R:.3Wޥzffpi R$ꨬR_d]G0oX#pgaOZ6rƸW3ӸۑgT8AcC1٥怨s]nܨ%65;ϡg?U[2y#ZɾѼ6&/-GD;}Cr^e\-77rbz S%2m:Vr/n̐l{>;yP7.`TEv;jV|KJw؁x]\~5wH?C~@'m㵉'lNL[\"49g2°!xm ho]PTU/7mua\<PΗVG|sB` #Qu6}r,њCDq|K*x&դ|LZ3~g,dYc[>e@p 0DEeKҾ&g 0)nZՒM5G|1uz^q35bKeH wع =ߔ(bUGdބ4s IlE~ Am;{KfwP}R$!C` `0%kbY+vRLzF?0{ 1NP^<umm<h Fù9٪{5\?$#5c8D ,@-`".@j zx!3q=G6"l0y.UVrld_pY|^AKQ8QR4? X-'䥷` LV }Kx49g;b3 wV59į"k{N~JVW\gV`'Ҍs{8Q*} ΗS/?e{+[ /h_Pl{h&KJ謜‡HɏYADb(inkk3giAϨ Sg42W\2q nx#* &^'fۑ5)$jC?x܏0$ )ZLޏiϻl/d%jF?N]C%LBǕ:ݭ 7dJ᭍?pU$]BVo4 1iʼ;iQmQt$QmVcWKkYYASa"qZ)z:5. T,n`qbF\&4*3Ah S<Y{\Ry}3goX>,I ;JVlZ͟[D`̹BfucpˠGA 8]5(PdGl*]쨯͆4Zf)?b{goPAyP@2'~b<ub6S˱BnHUӷ,cS^Uݿ+ f.Ml-ecw7s6*J(JYIKR`:N(" KD-ԃ8JYqIɷA _yQ3UYSrBf*t.f7QGk:@莘 'S&+.ȐlD%kY#m%moL>'>XCV63KJnu {b^J/vx0`!Mq~Տ(1qhjsa ^ }in=2Yx?o;+Iv|ngUʉHA -"Z#Hs/PY?OK׼gFw +n#B)SMeb[<-3}tazk@njz|WzvzKʊX]_)KVToMd06q>ir%HKytk#f1ƞΡrom1Zl 6lZNFM!˂U^=ٙD )4t{P1 M~>OF&v׵=t?۳w?P^ۜ2b7λ4W/D#ШqA =ǜp; G Dyݎ.?jWx;ȓsqLf;1*06͛ -Q+u4u-+;d?[PRҦ!9o_m|-iO@6c+p]q l}<~{Qy @sG](B/EC oڙ ͏\&uApBvRlSX;>`AFp熾v&Hռ9D}@C6T1=Ӗv|q#5M?Fz\e)&_ŢalhʶL\\ZV 6Q>:ZNΰ9= :U( ʂ_jq㬀>T.vոmu KW@-HN~ 0AR\mDD 1Gpk)[V'f8yok P{%.]9H\ZX^NT$ "K@ f$5畢!ZxdǸh']P=> Y 6!F sxU>"^|(].jYs֌zw>nw?U(##]D.NZ!n4/6K^-G ֹc6/_+kh '%߇EihÛ`$Ai2f;WR}pǼ '1o ts0ZM bNJ ?J(`KPC+)J; B5. ֊ |.p?,k̮O:B&'rF7w@`̺efR0A|d nDiF .kAL>L0v}i)GqݺR%ȑPS JJ"$x ~X9J m-G:␫Z= f0^IZ1Az3ڐF>1.(Y"zl:HlE/>e2Э2 2.T:E;`<;Vˋ`cK} kh 308sjC%pKTa#Qشww{Ljֲ8qhq3(^HJx53V_;9Ǒ.ߵޘbwK7| G+ٝ\"Iz*zgs7wnG5DA q)d4m[oĈ"|NmmE|Js73 +`|c9ՙ[!q*A&ą 6VIHnEt\ ϼe7>h1XIIs=`M ցV#. ~&%UJͮb!9uphCpbp)R|*ٛRxiBn^˙2H31ܸKfF3@VZnR{/j];Y:P8LG.ȍȏeG|)E&oX[~kOrMpRH. 6d= f+kڭܺ``&)eCx:&ք,ˋmQ[ :}o/JQ9~t՝s$D$/L## #E1 c7PʨD`2%p۷${8 .Sv:e@A^窨@H>2e=SW {? <@ǀ G>述w"_0ht8XȚɷ+VAU (U{i !]nqǍ- dĖ9BbW^A[XzK!#43,͘/5,ѱwC<9*I#b A'M!!kl()#$dwN{xmMYnwqGdVdVHX|y7)l\XlM0DA{g -1B*I)چ̄n)j_ȖjS”nk- )˪~E,ږZ͋G4_Bx~P1]y{` T7`^Y]FO qOCbGS+5NZGaӓ;D$6vT+M.H`皛*ebrYqͳ1;5?cٵвyݙ"״RfLϟ*8*R<&S!%-(^o1ۥ|Ӑ9s$7QշZ+~q(Ҿ^dlg)SVL8YQ:v6ox\ʇ$-JPNDY7#Y"V47lާ"anއdIReN1E:ڏ%r<(ґEuyu/_з;CRz &p3JcHM/iPmUЁp(#{s"82,Icpo.,+GO%yz>ΛYpzJz 1?t0(P xӲxޒ'03MZaK~O ɐzCw%IfOق^AZf6쩃|QrQ3N7WG8?q=sk8pV7(Nt~W,уmoX풙' _6)Et+?Y虿DA>سGXDZ20 TO ҴTOaI ;||-T/n|/6_OΎȿ} ^6;ǽt9ɩS#JiI 5e.\Bi~R|b 090"ծnVU5"&XeWAOx$?}9"Rm?\mM!{ݷE[ bhh?cƍ9>sUq7H첅p O .^՜fk44%}4IH ^F%hs. eYF\6((mہ?4PMLSf>F2!uTf%vPg8KhdiJ2tf_z,.ZY@ .JW~^ȫN?'/T7ؔVij}n(B vVEkߔJEPf_'B1'ۥŒW;&ETiG`ߏHQ.C> wS?"x~K*$Z ed%oUGqIoMX-E t|)O}Gzik7 x:p7%- i.PN`^?DE;ĢX-ƓDPr!)tZX YDQr& ;iڈ궡5f䤵\?ko4VZ]7/xǻџ˙P\O-I}xHkVD'k6Y@7I#82M {8U 6h oXPkiEӬz pf% gLv?vtb*;0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark gnustep-back-0.29.0/Fonts/Helvetica.nfont/n019064l.pfm000066400000000000000000000111221404163720200221020ustar00rootroot00000000000000RCopyright 1999 URW Software. See file COPYING for license.op ,,4 u,ZK2;FF#2PostScriptNimbusSanLConNimbusSanL-BoldCondItalP? PPPP#~PPP~#~P#P###?~??44#444#\/\H+PPPPPP4P####PP~~~~~~PPPP##1,7,A, F,N,P,T,U,V,W,Y,k,r,v,w,y,,, , , , , , ,,A-F-K-L-P-R-T-V-W-X-Y-k-r-v-w- y----1.7.A. F.N.P.T.U.V.W.Y.k.r.v.w.y... . . . . . ..10,1.101112131415161718191127213730414243444546474849415751676071727374757677787971878197:T:V:W:Y:r:t:v:w:y:T;V;W;Y;r;t;v;w;y;-ABACADAFAGAJALANAOAPASATAUAVAWAYAA AAAAAAAAAAAAAAACKCLCNCRCTCVCWCXCYCCCCCCCAGKGLGNGRGTGVGWGYGGGGGGGCHDJFJPJTJCKAOBOCOFOKOLONOROTOVOWOXOYOOOOOOOAQXQQQQQQQKSLSTSVSWSYStS-TATDTGTKTLTOTRTSTVT WTYTiTnToTTTTTTTTTTTTTTTTTTAULURUUUUUUU-VAVBVDVGVLVOVRVSVTV VVVVVVVVVVVVVVVVV-WAWBWDWGWLWOWRWSWTW WWW WWWWWWWWWWWDXOXX-YAYBYDYGYLYOYRYSYTY YYYYYYYYYYYYYYYYYAaFaKaNaPaRaTaVaWaXaYafagakaratavawaxayaaaaAbbbbbAcTcqcrcvcwcxcyccccAdrdddddAeFeKeNePeReTeVeWeXeYefegekeretevewexeyeeeff rf AgTgVgWgYgkgrgvgwgyggggchrhthFiTiViWiYifiriFjTjajfjijrjckrkflglrlvlwlylUmrmmmUnrnnnAoFoKoNoPoRoToVoWoXoYofokorotovowoxoyoooooUpYpmpnprpppAqrqxqqqqFrTrUrVrWrgrrrrrrTsfsksrsvswsyssAtStetft otptrt stttttttAuFuKuLuNuRuTuVuWuXuYukuquruuuuAvTvYvZvavbvevlvmvnvovrvvvvvvvvvvvvvvvAwTwawbwewmwnwowrw wwwwwwwwwwwwwwexoxrxxAyKyLyRyTyVyWyXyZyaybyeyhylymynyoypyry yyyyyyyyyyyyyyrzATVWYċŋBKRT,.ALaefhnorstuĒŒ,.ALĔŔFPRfrATVWYīūDFGTVWY-BCDFGLNOPSTUVWYBDFGT¸UVWY·BDFGTøUVWY÷-BCDFGJLNOPSTĸUVWYķ-BCDFGJLNOPSTŸUVWYŷ-BCGJL NOPSTƼUVWYƼALNRBLTVWYBCKLNRTVWYBLTVWYLTVWYABCFKLNRTVWXYBTVWYAAAALRrvwyFNPRfkrtvwyrvwyvwyFKNPRfgkrtvwyFKNPRfgkrtvwyFKNPRTVWYfgkrtvwyArrvwyFNPRfgkrtvwxyrvwyrvwyFKNPRfgkrtvwyrFKNPRfgkrtvwyFNPTVWYfrvwyRKLNRkgnustep-back-0.29.0/GNUmakefile000066400000000000000000000033571404163720200162460ustar00rootroot00000000000000# # Top level makefile for GNUstep Backend # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif PACKAGE_NAME = gnustep-back export PACKAGE_NAME RPM_DISABLE_RELOCATABLE=YES PACKAGE_NEEDS_CONFIGURE = YES SVN_MODULE_NAME = back SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/libs GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=back.make include $(GNUSTEP_MAKEFILES)/common.make include ./Version # # The list of subproject directories # SUBPROJECTS = Source Tools ifneq ($(fonts), no) SUBPROJECTS += Fonts endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/Master/deb.make -include GNUmakefile.postamble gnustep-back-0.29.0/GNUmakefile.postamble000066400000000000000000000043101404163720200202210ustar00rootroot00000000000000# -*-makefile-*- # GNUmakefile.postamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional: $(MKDIRS) $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional # Things to do before installing ifeq ($(BACKEND_BUNDLE),) before-install:: $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional $(INSTALL_DATA) back.make \ $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional/back.make endif # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning after-distclean:: rm -f config.status config.log config.cache TAGS config.h config.make back.make back.make: back.make.in Version configure if [ -x config.status ]; then \ ./config.status --recheck && ./config.status; \ else \ ./configure; \ fi config.make: config.make.in configure if [ -x config.status ]; then \ ./config.status --recheck && ./config.status; \ else \ ./configure; \ fi # Things to do before checking # before-check:: # Things to do after checking # after-check:: gnustep-back-0.29.0/Headers/000077500000000000000000000000001404163720200155375ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/art/000077500000000000000000000000001404163720200163255ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/art/ARTContext.h000066400000000000000000000022531404163720200204730ustar00rootroot00000000000000/* ARTContext ART backend drawing context. Copyright (C) 2005 Free Software Foundation, Inc. Written By: Alexander Malmberg This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ARTContext_h #define ARTContext_h #include "gsc/GSContext.h" @interface ARTContext : GSContext @end #endif gnustep-back-0.29.0/Headers/cairo/000077500000000000000000000000001404163720200166345ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/cairo/CairoContext.h000066400000000000000000000021431404163720200214070ustar00rootroot00000000000000/* CairoContext.h Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CairoContext_h #define CairoContext_h #include "gsc/GSContext.h" @interface CairoContext : GSContext { } @end #endif gnustep-back-0.29.0/Headers/cairo/CairoFaceInfo.h000066400000000000000000000025241404163720200214400ustar00rootroot00000000000000/* CairoFaceInfo.h Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on code by Alexander Malmberg Rewrite: Fred Kiefer Date: Jan 2006 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CAIROFACEINFO_H #define CAIROFACEINFO_H #include "fontconfig/FCFaceInfo.h" #define id cairo_id #include #undef id @interface CairoFaceInfo : FCFaceInfo { cairo_font_face_t *_fontFace; } - (void *)fontFace; @end #endif gnustep-back-0.29.0/Headers/cairo/CairoFontEnumerator.h000066400000000000000000000024101404163720200227300ustar00rootroot00000000000000/* CairoFontEnumerator.h Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CairoFontEnumerator_h #define CairoFontEnumerator_h #include "fontconfig/FCFontEnumerator.h" #include @class CairoFaceInfo; @interface CairoFontEnumerator : FCFontEnumerator { } + (Class) faceInfoClass; + (CairoFaceInfo *) fontWithName: (NSString *)name; @end #endif gnustep-back-0.29.0/Headers/cairo/CairoFontInfo.h000066400000000000000000000024541404163720200215120ustar00rootroot00000000000000/* CairoFontInfo.h Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CairoFontInfo_h #define CairoFontInfo_h #include "fontconfig/FCFontInfo.h" #include "cairo/CairoFaceInfo.h" #include @interface CairoFontInfo : FCFontInfo { @public cairo_scaled_font_t *_scaled; } - (void) drawGlyphs: (const NSGlyph*)glyphs length: (int)length on: (cairo_t*)ct; @end #endif gnustep-back-0.29.0/Headers/cairo/CairoGState.h000066400000000000000000000024671404163720200211630ustar00rootroot00000000000000/* Copyright (C) 2004 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CairoGState_h #define CairoGState_h #include #include "gsc/GSGState.h" @class CairoSurface; @interface CairoGState : GSGState { @public cairo_t *_ct; CairoSurface *_surface; } - (void) GSCurrentSurface: (CairoSurface **)surface : (int *)x : (int *)y; - (void) GSSetSurface: (CairoSurface *)surface : (int)x : (int)y; - (void) showPage; @end #endif gnustep-back-0.29.0/Headers/cairo/CairoPDFSurface.h000066400000000000000000000022371404163720200217110ustar00rootroot00000000000000/* Copyright (C) 2007 Free Software Foundation, Inc. Author: Fred Kiefer This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XGCairoPDFSurface_h #define XGCairoPDFSurface_h #include "cairo/CairoSurface.h" @interface CairoPDFSurface : CairoSurface { NSSize size; } - (void)setSize: (NSSize)newSize; - (void)writeComment: (NSString *)comment; @end #endif gnustep-back-0.29.0/Headers/cairo/CairoPSSurface.h000066400000000000000000000022341404163720200216170ustar00rootroot00000000000000/* Copyright (C) 2007 Free Software Foundation, Inc. Author: Fred Kiefer This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XGCairoPSSurface_h #define XGCairoPSSurface_h #include "cairo/CairoSurface.h" @interface CairoPSSurface : CairoSurface { NSSize size; } - (void)setSize: (NSSize)newSize; - (void)writeComment: (NSString *)comment; @end #endif gnustep-back-0.29.0/Headers/cairo/CairoSurface.h000066400000000000000000000025161404163720200213570ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CairoSurface_h #define CairoSurface_h #include #include @interface CairoSurface : NSObject { @public void *gsDevice; cairo_surface_t *_surface; } - (id) initWithDevice: (void *)device; - (NSSize) size; - (void) setSize: (NSSize)newSize; - (cairo_surface_t *) surface; - (void) handleExposeRect: (NSRect)rect; - (BOOL) isDrawingToScreen; @end #endif gnustep-back-0.29.0/Headers/cairo/WaylandCairoSurface.h000066400000000000000000000021741404163720200226770ustar00rootroot00000000000000/* WaylandCairoSurface.h Copyright (C) 2020 Free Software Foundation, Inc. Author: Sergio L. Pascual Date: February 2016 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef WaylandCairoSurface_h #define WaylandCairoSurface_h #include "cairo/CairoSurface.h" @interface WaylandCairoSurface : CairoSurface { } @end #endif gnustep-back-0.29.0/Headers/cairo/Win32CairoGState.h000066400000000000000000000022001404163720200217670ustar00rootroot00000000000000/* Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef Win32CairoGState_h #define Win32CairoGState_h #include "cairo/CairoGState.h" #include @interface Win32CairoGState : CairoGState { NSBezierPath *_lastPath; } - (HDC) getHDC; - (void) releaseHDC: (HDC)hdc; @end #endif gnustep-back-0.29.0/Headers/cairo/Win32CairoGlitzSurface.h000066400000000000000000000022701404163720200232110ustar00rootroot00000000000000/* Win32CairoGlitzSurface.h Copyright (C) 2008 Free Software Foundation, Inc. March 2nd, 2008 Author: Xavier Glattard This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef Win32CairoGlitzSurface_h #define Win32CairoGlitzSurface_h #include "win32/WIN32Server.h" #include "cairo/CairoSurface.h" @interface Win32CairoGlitzSurface : CairoSurface { } @end #endif gnustep-back-0.29.0/Headers/cairo/Win32CairoSurface.h000066400000000000000000000022441404163720200222000ustar00rootroot00000000000000/* Win32CairoSurface.h Copyright (C) 2008 Free Software Foundation, Inc. March 2nd, 2008 Author: Xavier Glattard This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef Win32CairoSurface_h #define Win32CairoSurface_h #include "win32/WIN32Server.h" #include "cairo/CairoSurface.h" @interface Win32CairoSurface : CairoSurface { } @end #endif gnustep-back-0.29.0/Headers/cairo/XGCairoGlitzSurface.h000066400000000000000000000022211404163720200226210ustar00rootroot00000000000000/* Copyright (C) 2004 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XGCairoGlitzSurface_h #define XGCairoGlitzSurface_h #include "x11/XGServer.h" #include "x11/XGServerWindow.h" #include "cairo/CairoSurface.h" @interface XGCairoGlitzSurface : CairoSurface { } @end #endif gnustep-back-0.29.0/Headers/cairo/XGCairoModernSurface.h000066400000000000000000000022071404163720200227600ustar00rootroot00000000000000/* Copyright (C) 2011 Free Software Foundation, Inc. Author: Eric Wasylishen This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XGCairoXModernSurface_h #define XGCairoXModernSurface_h #include "cairo/CairoSurface.h" @interface XGCairoModernSurface : CairoSurface { @private cairo_surface_t *_windowSurface; } @end #endif gnustep-back-0.29.0/Headers/cairo/XGCairoSurface.h000066400000000000000000000021071404163720200216120ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XGCairoSurface_h #define XGCairoSurface_h #include "cairo/CairoSurface.h" @interface XGCairoSurface : CairoSurface { } @end #endif gnustep-back-0.29.0/Headers/cairo/XGCairoXImageSurface.h000066400000000000000000000022171404163720200227070ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XGCairoXImageSurface_h #define XGCairoXImageSurface_h #include "cairo/CairoSurface.h" @class XWindowBuffer; @interface XGCairoXImageSurface : CairoSurface { @private XWindowBuffer *wi; } @end #endif gnustep-back-0.29.0/Headers/fontconfig/000077500000000000000000000000001404163720200176735ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/fontconfig/FCFaceInfo.h000066400000000000000000000037431404163720200217360ustar00rootroot00000000000000/* FCFaceInfo.h Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on code by Alexander Malmberg Rewrite: Fred Kiefer Date: Jan 2006 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef FCFACEINFO_H #define FCFACEINFO_H #include #include #include FT_FREETYPE_H #include @interface FCFaceInfo : NSObject { int _weight; unsigned int _traits; FcPattern *_pattern; NSString *_familyName; NSCharacterSet *_characterSet; BOOL _hasNoCharacterSet; BOOL _patternIsResolved; } - (id) initWithfamilyName: (NSString *)familyName weight: (int)weight traits: (unsigned int)traits pattern: (FcPattern *)pattern; - (unsigned int) cacheSize; - (int) weight; - (void) setWeight: (int)weight; - (unsigned int) traits; - (void) setTraits: (unsigned int)traits; - (NSString *) familyName; - (void) setFamilyName: (NSString *)name; - (NSString *) displayName; - (void *) fontFace; - (FcPattern *) matchedPattern; - (NSCharacterSet*)characterSet; @end #endif gnustep-back-0.29.0/Headers/fontconfig/FCFontEnumerator.h000066400000000000000000000034731404163720200232340ustar00rootroot00000000000000/* FCFontEnumerator.h Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef FCFontEnumerator_h #define FCFontEnumerator_h #include #define id fontconfig_id #include #undef id #include "fontconfig/FCFaceInfo.h" @interface FCFontEnumerator : GSFontEnumerator { } + (Class) faceInfoClass; + (FCFaceInfo *) fontWithName: (NSString *)name; @end @interface FontconfigPatternGenerator : NSObject { NSDictionary *_attributes; FcPattern *_pat; } - (FcPattern *)createPatternWithAttributes: (NSDictionary *)attributes; @end @interface FontconfigPatternParser : NSObject { NSMutableDictionary *_attributes; FcPattern *_pat; } - (NSDictionary*)attributesFromPattern: (FcPattern *)pat; @end @interface FontconfigCharacterSet : NSCharacterSet { FcCharSet *_charset; } - (id)initWithFontconfigCharSet: (FcCharSet*)charset; - (FcCharSet*)fontconfigCharSet; @end #endif gnustep-back-0.29.0/Headers/fontconfig/FCFontInfo.h000066400000000000000000000025411404163720200220010ustar00rootroot00000000000000/* FCFontInfo.h Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef FCFontInfo_h #define FCFontInfo_h #include #include "fontconfig/FCFaceInfo.h" @interface FCFontInfo : GSFontInfo { @public FCFaceInfo *_faceInfo; BOOL _screenFont; CGFloat lineHeight; unsigned int _cacheSize; unsigned int *_cachedGlyphs; NSSize *_cachedSizes; } - (void) setCacheSize:(unsigned int)size; - (BOOL) setupAttributes; @end #endif gnustep-back-0.29.0/Headers/gsc/000077500000000000000000000000001404163720200163135ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/gsc/GSContext.h000066400000000000000000000047661404163720200203570ustar00rootroot00000000000000/* GSContext Generic backend drawing context. Copyright (C) 2002 Free Software Foundation, Inc. Written By: Adam Fedor Date: Mar 2002 This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSContext_h_INCLUDE #define _GSContext_h_INCLUDE #include #include @class GSGState; @class GSDisplayServer; @interface GSContext : NSGraphicsContext { @public GSDisplayServer *server; void *opstack; void *gstack; GSGState *gstate; } - (GSGState *) currentGState; @end /* Error Macros */ #define DPS_WARN(type, resp) \ NSDebugLLog(@"GSContext", type, resp) #define DPS_ERROR(type, resp) \ NSLog(type, resp) /* Current keys used for the info dictionary: Key: Value: DisplayName -- (NSString)name of X server ScreenNumber -- (NSNumber)screen number DebugContext -- (NSNumber)YES or NO */ extern NSString *DPSconfigurationerror; extern NSString *DPSinvalidaccess; extern NSString *DPSinvalidcontext; extern NSString *DPSinvalidexit; extern NSString *DPSinvalidfileaccess; extern NSString *DPSinvalidfont; extern NSString *DPSinvalidid; extern NSString *DPSinvalidrestore; extern NSString *DPSinvalidparam; extern NSString *DPSioerror; extern NSString *DPSlimitcheck; extern NSString *DPSnocurrentpoint; extern NSString *DPSnulloutput; extern NSString *DPSrangecheck; extern NSString *DPSstackoverflow; extern NSString *DPSstackunderflow; extern NSString *DPStypecheck; extern NSString *DPSundefined; extern NSString *DPSundefinedfilename; extern NSString *DPSundefinedresult; extern NSString *DPSVMerror; #endif /* _GSContext_h_INCLUDE */ gnustep-back-0.29.0/Headers/gsc/GSFunction.h000066400000000000000000000035571404163720200205150ustar00rootroot00000000000000/* -*-objc-*- GSFunction - PS Function for GSGState Copyright (C) 2003 Free Software Foundation, Inc. Author: Alexander Malmberg Author: Fred Kiefer Extracted into separate class. This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSFunction_h_INCLUDE #define _GSFunction_h_INCLUDE #include @interface GSFunction : NSObject { /* General information about the function. */ int num_in, num_out; double *domain; /* num_in * 2 */ double *range; /* num_out * 2 */ /* Type specific information */ const unsigned char *data_source; int *size; /* num_in */ int bits_per_sample; double *encode; /* num_in * 2 */ double *decode; /* num_out * 2 */ } - (id) initWith: (NSDictionary *)d; - (double) getsample: (int)sample : (int) i; - (void) eval: (double *)inValues : (double *)outValues; @end @interface GSFunction2in3out : GSFunction { /* sample cache for in == 2, out == 3 */ int sample_index[2]; double sample_cache[4][3]; } - (NSRect) affectedRect; @end #endif // _GSFunction_h_INCLUDE gnustep-back-0.29.0/Headers/gsc/GSGState.h000066400000000000000000000104661404163720200201140ustar00rootroot00000000000000/* GSGState - Implements generic graphic state drawing for non-PS backends Copyright (C) 1995 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1995 Extracted from XGPS: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSGState_h_INCLUDE #define _GSGState_h_INCLUDE #include // needed for NSCompositingOperation #include #include #include @class NSAffineTransform; @class NSBezierPath; @class NSFont; @class NSColorSpace; @class GSContext; typedef enum { path_stroke, path_fill, path_eofill, path_clip, path_eoclip } ctxt_object_t; typedef enum { COLOR_STROKE = 1, COLOR_FILL = 2, COLOR_BOTH = 3 /* COLOR_BOTH = COLOR_FILL || COLOR_STROKE */ } color_state_t; @interface GSGState : NSObject { @public GSContext *drawcontext; NSAffineTransform *ctm; NSPoint offset; /* Offset from Drawable origin */ NSBezierPath *path; /* Current path */ GSFontInfo *font; /* Current font reference */ NSColorSpace *fillColorS; /* Colorspace used for fill drawing */ NSColorSpace *strokeColorS; /* Colorspace used for stroke drawing */ device_color_t fillColor; /* fill color */ device_color_t strokeColor; /* stroke color */ color_state_t cstate; /* state last time color was set */ NSImage *pattern; /* If set, image to draw with */ CGFloat charSpacing; NSAffineTransform *textCtm; /* Text transform - concat with ctm */ GSTextDrawingMode textMode; BOOL viewIsFlipped; BOOL _antialias; NSPoint _patternPhase; NSCompositingOperation _compositingOperation; } - initWithDrawContext: (GSContext *)context; - deepen; - (void) setOffset: (NSPoint)theOffset; - (NSPoint) offset; - (void) setColor: (device_color_t *)color state: (color_state_t)cState; - (void) GSSetPatterColor: (NSImage*)image; - (void) setShouldAntialias: (BOOL)antialias; - (BOOL) shouldAntialias; - (NSPoint) patternPhase; - (void) setPatternPhase: (NSPoint)phase; - (NSCompositingOperation) compositingOperation; - (void) setCompositingOperation:(NSCompositingOperation) operation; - (void) compositeGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op; - (void) dissolveGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint delta: (CGFloat)delta; - (void) compositeGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta; - (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op; - (NSPoint) pointInMatrixSpace: (NSPoint)point; - (NSPoint) deltaPointInMatrixSpace: (NSPoint)point; - (NSRect) rectInMatrixSpace: (NSRect)rect; @end /** Informal protocol to which backends can conform to when they support drawing a graphics state with arbitrary transforms on the current graphics context. */ @interface NSObject (GSDrawGState) - (void) drawGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta; @end #include "GSGStateOps.h" #endif /* _GSGState_h_INCLUDE */ gnustep-back-0.29.0/Headers/gsc/GSGStateOps.h000066400000000000000000000170511404163720200205730ustar00rootroot00000000000000/* GSGStateOPS - Ops for GSGState Copyright (C) 1998 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSGStateOps_h_INCLUDE #define _GSGStateOps_h_INCLUDE @class NSGradient; @interface GSGState (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentalpha: (CGFloat*)a; - (void) DPScurrentcmykcolor: (CGFloat*)c : (CGFloat*)m : (CGFloat*)y : (CGFloat*)k; - (void) DPScurrentgray: (CGFloat*)gray; - (void) DPScurrenthsbcolor: (CGFloat*)h : (CGFloat*)s : (CGFloat*)b; - (void) DPScurrentrgbcolor: (CGFloat*)r : (CGFloat*)g : (CGFloat*)b; - (void) DPSsetalpha: (CGFloat)a; - (void) DPSsetcmykcolor: (CGFloat)c : (CGFloat)m : (CGFloat)y : (CGFloat)k; - (void) DPSsetgray: (CGFloat)gray; - (void) DPSsethsbcolor: (CGFloat)h : (CGFloat)s : (CGFloat)b; - (void) DPSsetrgbcolor: (CGFloat)r : (CGFloat)g : (CGFloat)b; - (void) GSSetFillColorspace: (void *)spaceref; - (void) GSSetStrokeColorspace: (void *)spaceref; - (void) GSSetFillColor: (const CGFloat *)values; - (void) GSSetStrokeColor: (const CGFloat *)values; /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ - (void) DPSashow: (CGFloat)x : (CGFloat)y : (const char*)s; - (void) DPSawidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (CGFloat)ax : (CGFloat)ay : (const char*)s; - (void) DPScharpath: (const char*)s : (int)b; - (void) appendBezierPathWithPackedGlyphs: (const char *)packedGlyphs path: (NSBezierPath*)aPath; - (void) DPSshow: (const char*)s; - (void) DPSwidthshow: (CGFloat)x : (CGFloat)y : (int)c : (const char*)s; - (void) DPSxshow: (const char*)s : (const CGFloat*)numarray : (int)size; - (void) DPSxyshow: (const char*)s : (const CGFloat*)numarray : (int)size; - (void) DPSyshow: (const char*)s : (const CGFloat*)numarray : (int)size; - (void) GSSetCharacterSpacing: (CGFloat)extra; - (void) GSSetFont: (GSFontInfo *)fontref; - (void) GSSetFontSize: (CGFloat)size; - (NSAffineTransform *) GSGetTextCTM; - (NSPoint) GSGetTextPosition; - (void) GSSetTextCTM: (NSAffineTransform *)ctm; - (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode; - (void) GSSetTextPosition: (NSPoint)loc; - (void) GSShowText: (const char *)string : (size_t) length; - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length; - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length; /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - (void) DPSinitgraphics; - (void) DPScurrentflat: (CGFloat*)flatness; - (void) DPScurrentlinecap: (int*)linecap; - (void) DPScurrentlinejoin: (int*)linejoin; - (void) DPScurrentlinewidth: (CGFloat*)width; - (void) DPScurrentmiterlimit: (CGFloat*)limit; - (void) DPScurrentpoint: (CGFloat*)x : (CGFloat*)y; - (void) DPScurrentstrokeadjust: (int*)b; - (void) DPSsetdash: (const CGFloat*)pat : (NSInteger)size : (CGFloat)offset; - (void) DPSsetflat: (CGFloat)flatness; - (void) DPSsetlinecap: (int)linecap; - (void) DPSsetlinejoin: (int)linejoin; - (void) DPSsetlinewidth: (CGFloat)width; - (void) DPSsetmiterlimit: (CGFloat)limit; - (void) DPSsetstrokeadjust: (int)b; /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ - (void) DPSconcat: (const CGFloat*)m; - (void) DPSinitmatrix; - (void) DPSrotate: (CGFloat)angle; - (void) DPSscale: (CGFloat)x : (CGFloat)y; - (void) DPStranslate: (CGFloat)x : (CGFloat)y; - (NSAffineTransform *) GSCurrentCTM; - (void) GSSetCTM: (NSAffineTransform *)ctm; - (void) GSConcatCTM: (NSAffineTransform *)ctm; /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ - (NSPoint) currentPoint; - (void) DPSarc: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2; - (void) DPSarcn: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2; - (void) DPSarct: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)r; - (void) DPSclip; - (void) DPSclosepath; - (void) DPScurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3; - (void) DPSeoclip; - (void) DPSeofill; - (void) DPSfill; - (void) DPSflattenpath; - (void) DPSinitclip; - (void) DPSlineto: (CGFloat)x : (CGFloat)y; - (void) DPSmoveto: (CGFloat)x : (CGFloat)y; - (void) DPSnewpath; - (void) DPSpathbbox: (CGFloat*)llx : (CGFloat*)lly : (CGFloat*)urx : (CGFloat*)ury; - (void) DPSrcurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3; - (void) DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h; - (void) DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h; - (void) DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h; - (void) DPSreversepath; - (void) DPSrlineto: (CGFloat)x : (CGFloat)y; - (void) DPSrmoveto: (CGFloat)x : (CGFloat)y; - (void) DPSstroke; - (void) GSSendBezierPath: (NSBezierPath *)path; - (void) GSRectClipList: (const NSRect *)rects : (int) count; - (void) GSRectFillList: (const NSRect *)rects : (int) count; - (NSDictionary *) GSReadRect: (NSRect)rect; - (void)DPSimage: (NSAffineTransform*) matrix : (NSInteger) pixelsWide : (NSInteger) pixelsHigh : (NSInteger) bitsPerSample : (NSInteger) samplesPerPixel : (NSInteger) bitsPerPixel : (NSInteger) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data; - (void) DPSshfill: (NSDictionary *)shader; @end @interface GSGState (PatternColor) - (void *) saveClip; - (void) restoreClip: (void *)savedClip; - (void) fillRect: (NSRect)rect withPattern: (NSImage*)pattern; - (void) fillPath: (NSBezierPath*)fillPath withPattern: (NSImage*)pattern; - (void) eofillPath: (NSBezierPath*)fillPath withPattern: (NSImage*)pattern; @end @interface GSGState (NSGradient) - (void) drawGradient: (NSGradient*)gradient fromCenter: (NSPoint)startCenter radius: (CGFloat)startRadius toCenter: (NSPoint)endCenter radius: (CGFloat)endRadius options: (NSUInteger)options; - (void) drawGradient: (NSGradient*)gradient fromPoint: (NSPoint)startPoint toPoint: (NSPoint)endPoint options: (NSUInteger)options; @end #endif gnustep-back-0.29.0/Headers/gsc/GSStreamContext.h000066400000000000000000000023661404163720200215250ustar00rootroot00000000000000/* GSStreamContext - Output Postscript to a stream Copyright (C) 1999 Free Software Foundation, Inc. Written by: Adam Fedor Date: Mar 1999 This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSStreamContext_h_INCLUDE #define _GSStreamContext_h_INCLUDE #include #include "gsc/GSContext.h" @interface GSStreamContext : GSContext { FILE *gstream; } @end #endif /* _GSStreamContext_h_INCLUDE */ gnustep-back-0.29.0/Headers/gsc/GSStreamGState.h000066400000000000000000000024731404163720200212670ustar00rootroot00000000000000/* GSGStreamState - Implements graphic state drawing for PS stream Copyright (C) 2002 Free Software Foundation, Inc. Written by: Adam Fedor Date: Sep 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSStreamGState_h_INCLUDE #define _GSStreamGState_h_INCLUDE #include @interface GSStreamGState : GSGState { @public int clinecap, clinejoin; CGFloat clinewidth, cmiterlimit; CGFloat cstrokeadjust; } @end #endif /* _GSStreamGState_h_INCLUDE */ gnustep-back-0.29.0/Headers/gsc/gscolors.h000066400000000000000000000032301404163720200203150ustar00rootroot00000000000000/* gscolors - Color conversion routines Copyright (C) 1995 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1994 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _gscolors_h_INCLUDE #define _gscolors_h_INCLUDE #define AINDEX 5 typedef enum { gray_colorspace, rgb_colorspace, hsb_colorspace, cmyk_colorspace } device_colorspace_t; typedef struct _device_color { device_colorspace_t space; float field[6]; } device_color_t; /* Internal conversion of colors to pixels values */ extern void gsMakeColor(device_color_t *dst, device_colorspace_t space, float a, float b, float c, float d); extern void gsColorToRGB(device_color_t *color); extern void gsColorToGray(device_color_t *color); extern void gsColorToCMYK(device_color_t *color); extern void gsColorToHSB(device_color_t *color); #endif gnustep-back-0.29.0/Headers/opal/000077500000000000000000000000001404163720200164725ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/opal/OpalContext.h000066400000000000000000000021341404163720200211030ustar00rootroot00000000000000/* OpalContext.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef OpalContext_h_defined #define OpalContext_h_defined #import "gsc/GSContext.h" @interface OpalContext : GSContext { } @end #endif gnustep-back-0.29.0/Headers/opal/OpalFaceInfo.h000066400000000000000000000023011404163720200211250ustar00rootroot00000000000000/* OpalFaceInfo.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: September 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef OpalFaceInfo_h_defined #define OpalFaceInfo_h_defined #import "fontconfig/FCFaceInfo.h" #import @interface OpalFaceInfo : FCFaceInfo { CGFontRef _fontFace; } - (void *) fontFace; @end #endif gnustep-back-0.29.0/Headers/opal/OpalFontEnumerator.h000066400000000000000000000023601404163720200224300ustar00rootroot00000000000000/* OpalFontEnumerator.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef OpalFontEnumerator_h_defined #define OpalFontEnumerator_h_defined #import "fontconfig/FCFontEnumerator.h" @class OpalFaceInfo; @interface OpalFontEnumerator : FCFontEnumerator { } + (Class) faceInfoClass; + (OpalFaceInfo *) fontWithName: (NSString *)name; @end #endif gnustep-back-0.29.0/Headers/opal/OpalFontInfo.h000066400000000000000000000027361404163720200212110ustar00rootroot00000000000000/* OpalFontInfo.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef OpalFontInfo_h_defined #define OpalFontInfo_h_defined #include "fontconfig/FCFontInfo.h" #include "opal/OpalFaceInfo.h" #if 0 #include #endif @interface OpalFontInfo : FCFontInfo { @public #if 0 cairo_scaled_font_t *_scaled; #endif } /* - (id) initWithFontName: (NSString *)name matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont; */ #if 0 - (void) drawGlyphs: (const NSGlyph*)glyphs length: (int)length on: (cairo_t*)ct; #endif @end #endif gnustep-back-0.29.0/Headers/opal/OpalGState.h000066400000000000000000000052241404163720200206510ustar00rootroot00000000000000/* OpalGState.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "gsc/GSGState.h" @class OpalSurface; @interface OpalGState : GSGState { OpalSurface * _opalSurface; /** When a surface's gstate is being switched away from, we store the current gstate in _opGState. When a surface's gstate is being switched back to, if _opGState is not nil, we apply the stored gstate. To facilitate OpalGState class instance copying, we also store a copy of the gstate inside _opGState when gstate's -copyWithZone: is being run. This is because the same _opalSurface should be used in both new and old OpalGState. The same is done in Cairo backend, with one key difference: since all graphics state operations in Cairo are done directly on cairo_t and are unrelated to the surface, Opal mixes the concepts of a gstate and a surface into a context. Hence, when gstate is switched, it's OpalContext's duty to apply the stored copy of a gstate from _opGState. No such trickery is needed with Cairo, as Cairo backend can simply have a different cairo_t with the same surface. **/ OPGStateRef _opGState; } @end @interface OpalGState (InitializationMethods) - (void) DPSinitgraphics; - (void) GSSetSurface: (OpalSurface *)opalSurface : (int)x : (int)y; - (void) GSCurrentSurface: (OpalSurface **)surface : (int *)x : (int *)y; @end @interface OpalGState (Accessors) - (CGContextRef) CGContext; - (OPGStateRef) OPGState; - (void) setOPGState: (OPGStateRef) opGState; @end @interface OpalGState (NonrequiredMethods) - (void) DPSgsave; - (void) DPSgrestore; @end gnustep-back-0.29.0/Headers/opal/OpalSurface.h000066400000000000000000000026741404163720200210600ustar00rootroot00000000000000/* OpalSurface.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import @interface OpalSurface : NSObject { struct _gswindow_device_t * _gsWindowDevice; CGContextRef _backingCGContext; CGContextRef _x11CGContext; } - (id) initWithDevice: (void *)device context: (CGContextRef)ctx; - (void *)device; - (CGContextRef) CGContext; - (NSSize) size; - (CGContextRef) backingCGContext; - (CGContextRef) x11CGContext; - (void) handleExposeRect: (NSRect)rect; - (BOOL) isDrawingToScreen; @end gnustep-back-0.29.0/Headers/wayland/000077500000000000000000000000001404163720200171765ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/wayland/WaylandServer.h000066400000000000000000000063771404163720200221520ustar00rootroot00000000000000/* WaylandServer Backend server using Wayland. Copyright (C) 2020 Free Software Foundation, Inc. Author: Sergio L. Pascual Date: February 2016 This file is part of the GNUstep Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WaylandServer_h_INCLUDE #define _WaylandServer_h_INCLUDE #include "config.h" #include #include #include #include #include "cairo/WaylandCairoSurface.h" #include "wayland/xdg-shell-client-protocol.h" struct pointer { struct wl_pointer *wlpointer; float x; float y; uint32_t last_click_button; uint32_t last_click_time; float last_click_x; float last_click_y; uint32_t serial; struct window *focus; }; typedef struct _WaylandConfig { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_shell *shell; struct wl_shm *shm; struct wl_seat *seat; struct wl_keyboard *keyboard; struct xdg_wm_base *wm_base; struct wl_list output_list; int output_count; struct wl_list window_list; int window_count; int last_window_id; struct pointer pointer; struct xkb_context *xkb_context; struct { struct xkb_keymap *keymap; struct xkb_state *state; xkb_mod_mask_t control_mask; xkb_mod_mask_t alt_mask; xkb_mod_mask_t shift_mask; } xkb; int modifiers; int seat_version; float mouse_scroll_multiplier; } WaylandConfig; struct output { WaylandConfig *wlconfig; struct wl_output *output; uint32_t server_output_id; struct wl_list link; int alloc_x; int alloc_y; int width; int height; int transform; int scale; char *make; char *model; void *user_data; }; struct window { WaylandConfig *wlconfig; id instance; int window_id; struct wl_list link; BOOL configured; // surface has been configured once float pos_x; float pos_y; float width; float height; float saved_pos_x; float saved_pos_y; int is_out; unsigned char *data; struct wl_buffer *buffer; struct wl_surface *surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *toplevel; struct output *output; WaylandCairoSurface *wcs; }; @interface WaylandServer : GSDisplayServer { WaylandConfig *wlconfig; BOOL _mouseInitialized; } @end #endif /* _XGServer_h_INCLUDE */ gnustep-back-0.29.0/Headers/wayland/xdg-shell-client-protocol.h000066400000000000000000001732231404163720200243610ustar00rootroot00000000000000/* Generated by wayland-scanner 1.17.0 */ #ifndef XDG_SHELL_CLIENT_PROTOCOL_H #define XDG_SHELL_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_xdg_shell The xdg_shell protocol * @section page_ifaces_xdg_shell Interfaces * - @subpage page_iface_xdg_wm_base - create desktop-style surfaces * - @subpage page_iface_xdg_positioner - child surface positioner * - @subpage page_iface_xdg_surface - desktop user interface surface base interface * - @subpage page_iface_xdg_toplevel - toplevel surface * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus * @section page_copyright_xdg_shell Copyright *
 *
 * Copyright © 2008-2013 Kristian Høgsberg
 * Copyright © 2013      Rafael Antognolli
 * Copyright © 2013      Jasper St. Pierre
 * Copyright © 2010-2013 Intel Corporation
 * Copyright © 2015-2017 Samsung Electronics Co., Ltd
 * Copyright © 2015-2017 Red Hat Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 * 
*/ struct wl_output; struct wl_seat; struct wl_surface; struct xdg_popup; struct xdg_positioner; struct xdg_surface; struct xdg_toplevel; struct xdg_wm_base; /** * @page page_iface_xdg_wm_base xdg_wm_base * @section page_iface_xdg_wm_base_desc Description * * The xdg_wm_base interface is exposed as a global object enabling clients * to turn their wl_surfaces into windows in a desktop environment. It * defines the basic functionality needed for clients and the compositor to * create windows that can be dragged, resized, maximized, etc, as well as * creating transient windows such as popup menus. * @section page_iface_xdg_wm_base_api API * See @ref iface_xdg_wm_base. */ /** * @defgroup iface_xdg_wm_base The xdg_wm_base interface * * The xdg_wm_base interface is exposed as a global object enabling clients * to turn their wl_surfaces into windows in a desktop environment. It * defines the basic functionality needed for clients and the compositor to * create windows that can be dragged, resized, maximized, etc, as well as * creating transient windows such as popup menus. */ extern const struct wl_interface xdg_wm_base_interface; /** * @page page_iface_xdg_positioner xdg_positioner * @section page_iface_xdg_positioner_desc Description * * The xdg_positioner provides a collection of rules for the placement of a * child surface relative to a parent surface. Rules can be defined to ensure * the child surface remains within the visible area's borders, and to * specify how the child surface changes its position, such as sliding along * an axis, or flipping around a rectangle. These positioner-created rules are * constrained by the requirement that a child surface must intersect with or * be at least partially adjacent to its parent surface. * * See the various requests for details about possible rules. * * At the time of the request, the compositor makes a copy of the rules * specified by the xdg_positioner. Thus, after the request is complete the * xdg_positioner object can be destroyed or reused; further changes to the * object will have no effect on previous usages. * * For an xdg_positioner object to be considered complete, it must have a * non-zero size set by set_size, and a non-zero anchor rectangle set by * set_anchor_rect. Passing an incomplete xdg_positioner object when * positioning a surface raises an error. * @section page_iface_xdg_positioner_api API * See @ref iface_xdg_positioner. */ /** * @defgroup iface_xdg_positioner The xdg_positioner interface * * The xdg_positioner provides a collection of rules for the placement of a * child surface relative to a parent surface. Rules can be defined to ensure * the child surface remains within the visible area's borders, and to * specify how the child surface changes its position, such as sliding along * an axis, or flipping around a rectangle. These positioner-created rules are * constrained by the requirement that a child surface must intersect with or * be at least partially adjacent to its parent surface. * * See the various requests for details about possible rules. * * At the time of the request, the compositor makes a copy of the rules * specified by the xdg_positioner. Thus, after the request is complete the * xdg_positioner object can be destroyed or reused; further changes to the * object will have no effect on previous usages. * * For an xdg_positioner object to be considered complete, it must have a * non-zero size set by set_size, and a non-zero anchor rectangle set by * set_anchor_rect. Passing an incomplete xdg_positioner object when * positioning a surface raises an error. */ extern const struct wl_interface xdg_positioner_interface; /** * @page page_iface_xdg_surface xdg_surface * @section page_iface_xdg_surface_desc Description * * An interface that may be implemented by a wl_surface, for * implementations that provide a desktop-style user interface. * * It provides a base set of functionality required to construct user * interface elements requiring management by the compositor, such as * toplevel windows, menus, etc. The types of functionality are split into * xdg_surface roles. * * Creating an xdg_surface does not set the role for a wl_surface. In order * to map an xdg_surface, the client must create a role-specific object * using, e.g., get_toplevel, get_popup. The wl_surface for any given * xdg_surface can have at most one role, and may not be assigned any role * not based on xdg_surface. * * A role must be assigned before any other requests are made to the * xdg_surface object. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_surface state to take effect. * * Creating an xdg_surface from a wl_surface which has a buffer attached or * committed is a client error, and any attempts by a client to attach or * manipulate a buffer prior to the first xdg_surface.configure call must * also be treated as errors. * * Mapping an xdg_surface-based role surface is defined as making it * possible for the surface to be shown by the compositor. Note that * a mapped surface is not guaranteed to be visible once it is mapped. * * For an xdg_surface to be mapped by the compositor, the following * conditions must be met: * (1) the client has assigned an xdg_surface-based role to the surface * (2) the client has set and committed the xdg_surface state and the * role-dependent state to the surface * (3) the client has committed a buffer to the surface * * A newly-unmapped surface is considered to have met condition (1) out * of the 3 required conditions for mapping a surface if its role surface * has not been destroyed. * @section page_iface_xdg_surface_api API * See @ref iface_xdg_surface. */ /** * @defgroup iface_xdg_surface The xdg_surface interface * * An interface that may be implemented by a wl_surface, for * implementations that provide a desktop-style user interface. * * It provides a base set of functionality required to construct user * interface elements requiring management by the compositor, such as * toplevel windows, menus, etc. The types of functionality are split into * xdg_surface roles. * * Creating an xdg_surface does not set the role for a wl_surface. In order * to map an xdg_surface, the client must create a role-specific object * using, e.g., get_toplevel, get_popup. The wl_surface for any given * xdg_surface can have at most one role, and may not be assigned any role * not based on xdg_surface. * * A role must be assigned before any other requests are made to the * xdg_surface object. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_surface state to take effect. * * Creating an xdg_surface from a wl_surface which has a buffer attached or * committed is a client error, and any attempts by a client to attach or * manipulate a buffer prior to the first xdg_surface.configure call must * also be treated as errors. * * Mapping an xdg_surface-based role surface is defined as making it * possible for the surface to be shown by the compositor. Note that * a mapped surface is not guaranteed to be visible once it is mapped. * * For an xdg_surface to be mapped by the compositor, the following * conditions must be met: * (1) the client has assigned an xdg_surface-based role to the surface * (2) the client has set and committed the xdg_surface state and the * role-dependent state to the surface * (3) the client has committed a buffer to the surface * * A newly-unmapped surface is considered to have met condition (1) out * of the 3 required conditions for mapping a surface if its role surface * has not been destroyed. */ extern const struct wl_interface xdg_surface_interface; /** * @page page_iface_xdg_toplevel xdg_toplevel * @section page_iface_xdg_toplevel_desc Description * * This interface defines an xdg_surface role which allows a surface to, * among other things, set window-like properties such as maximize, * fullscreen, and minimize, set application-specific metadata like title and * id, and well as trigger user interactive operations such as interactive * resize and move. * * Unmapping an xdg_toplevel means that the surface cannot be shown * by the compositor until it is explicitly mapped again. * All active operations (e.g., move, resize) are canceled and all * attributes (e.g. title, state, stacking, ...) are discarded for * an xdg_toplevel surface when it is unmapped. * * Attaching a null buffer to a toplevel unmaps the surface. * @section page_iface_xdg_toplevel_api API * See @ref iface_xdg_toplevel. */ /** * @defgroup iface_xdg_toplevel The xdg_toplevel interface * * This interface defines an xdg_surface role which allows a surface to, * among other things, set window-like properties such as maximize, * fullscreen, and minimize, set application-specific metadata like title and * id, and well as trigger user interactive operations such as interactive * resize and move. * * Unmapping an xdg_toplevel means that the surface cannot be shown * by the compositor until it is explicitly mapped again. * All active operations (e.g., move, resize) are canceled and all * attributes (e.g. title, state, stacking, ...) are discarded for * an xdg_toplevel surface when it is unmapped. * * Attaching a null buffer to a toplevel unmaps the surface. */ extern const struct wl_interface xdg_toplevel_interface; /** * @page page_iface_xdg_popup xdg_popup * @section page_iface_xdg_popup_desc Description * * A popup surface is a short-lived, temporary surface. It can be used to * implement for example menus, popovers, tooltips and other similar user * interface concepts. * * A popup can be made to take an explicit grab. See xdg_popup.grab for * details. * * When the popup is dismissed, a popup_done event will be sent out, and at * the same time the surface will be unmapped. See the xdg_popup.popup_done * event for details. * * Explicitly destroying the xdg_popup object will also dismiss the popup and * unmap the surface. Clients that want to dismiss the popup when another * surface of their own is clicked should dismiss the popup using the destroy * request. * * A newly created xdg_popup will be stacked on top of all previously created * xdg_popup surfaces associated with the same xdg_toplevel. * * The parent of an xdg_popup must be mapped (see the xdg_surface * description) before the xdg_popup itself. * * The x and y arguments passed when creating the popup object specify * where the top left of the popup should be placed, relative to the * local surface coordinates of the parent surface. See * xdg_surface.get_popup. An xdg_popup must intersect with or be at least * partially adjacent to its parent surface. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_popup state to take effect. * @section page_iface_xdg_popup_api API * See @ref iface_xdg_popup. */ /** * @defgroup iface_xdg_popup The xdg_popup interface * * A popup surface is a short-lived, temporary surface. It can be used to * implement for example menus, popovers, tooltips and other similar user * interface concepts. * * A popup can be made to take an explicit grab. See xdg_popup.grab for * details. * * When the popup is dismissed, a popup_done event will be sent out, and at * the same time the surface will be unmapped. See the xdg_popup.popup_done * event for details. * * Explicitly destroying the xdg_popup object will also dismiss the popup and * unmap the surface. Clients that want to dismiss the popup when another * surface of their own is clicked should dismiss the popup using the destroy * request. * * A newly created xdg_popup will be stacked on top of all previously created * xdg_popup surfaces associated with the same xdg_toplevel. * * The parent of an xdg_popup must be mapped (see the xdg_surface * description) before the xdg_popup itself. * * The x and y arguments passed when creating the popup object specify * where the top left of the popup should be placed, relative to the * local surface coordinates of the parent surface. See * xdg_surface.get_popup. An xdg_popup must intersect with or be at least * partially adjacent to its parent surface. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_popup state to take effect. */ extern const struct wl_interface xdg_popup_interface; #ifndef XDG_WM_BASE_ERROR_ENUM #define XDG_WM_BASE_ERROR_ENUM enum xdg_wm_base_error { /** * given wl_surface has another role */ XDG_WM_BASE_ERROR_ROLE = 0, /** * xdg_wm_base was destroyed before children */ XDG_WM_BASE_ERROR_DEFUNCT_SURFACES = 1, /** * the client tried to map or destroy a non-topmost popup */ XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP = 2, /** * the client specified an invalid popup parent surface */ XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT = 3, /** * the client provided an invalid surface state */ XDG_WM_BASE_ERROR_INVALID_SURFACE_STATE = 4, /** * the client provided an invalid positioner */ XDG_WM_BASE_ERROR_INVALID_POSITIONER = 5, }; #endif /* XDG_WM_BASE_ERROR_ENUM */ /** * @ingroup iface_xdg_wm_base * @struct xdg_wm_base_listener */ struct xdg_wm_base_listener { /** * check if the client is alive * * The ping event asks the client if it's still alive. Pass the * serial specified in the event back to the compositor by sending * a "pong" request back with the specified serial. See * xdg_wm_base.pong. * * Compositors can use this to determine if the client is still * alive. It's unspecified what will happen if the client doesn't * respond to the ping request, or in what timeframe. Clients * should try to respond in a reasonable amount of time. * * A compositor is free to ping in any way it wants, but a client * must always respond to any xdg_wm_base object it created. * @param serial pass this to the pong request */ void (*ping)(void *data, struct xdg_wm_base *xdg_wm_base, uint32_t serial); }; /** * @ingroup iface_xdg_wm_base */ static inline int xdg_wm_base_add_listener(struct xdg_wm_base *xdg_wm_base, const struct xdg_wm_base_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) xdg_wm_base, (void (**)(void)) listener, data); } #define XDG_WM_BASE_DESTROY 0 #define XDG_WM_BASE_CREATE_POSITIONER 1 #define XDG_WM_BASE_GET_XDG_SURFACE 2 #define XDG_WM_BASE_PONG 3 /** * @ingroup iface_xdg_wm_base */ #define XDG_WM_BASE_PING_SINCE_VERSION 1 /** * @ingroup iface_xdg_wm_base */ #define XDG_WM_BASE_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_wm_base */ #define XDG_WM_BASE_CREATE_POSITIONER_SINCE_VERSION 1 /** * @ingroup iface_xdg_wm_base */ #define XDG_WM_BASE_GET_XDG_SURFACE_SINCE_VERSION 1 /** * @ingroup iface_xdg_wm_base */ #define XDG_WM_BASE_PONG_SINCE_VERSION 1 /** @ingroup iface_xdg_wm_base */ static inline void xdg_wm_base_set_user_data(struct xdg_wm_base *xdg_wm_base, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) xdg_wm_base, user_data); } /** @ingroup iface_xdg_wm_base */ static inline void * xdg_wm_base_get_user_data(struct xdg_wm_base *xdg_wm_base) { return wl_proxy_get_user_data((struct wl_proxy *) xdg_wm_base); } static inline uint32_t xdg_wm_base_get_version(struct xdg_wm_base *xdg_wm_base) { return wl_proxy_get_version((struct wl_proxy *) xdg_wm_base); } /** * @ingroup iface_xdg_wm_base * * Destroy this xdg_wm_base object. * * Destroying a bound xdg_wm_base object while there are surfaces * still alive created by this xdg_wm_base object instance is illegal * and will result in a protocol error. */ static inline void xdg_wm_base_destroy(struct xdg_wm_base *xdg_wm_base) { wl_proxy_marshal((struct wl_proxy *) xdg_wm_base, XDG_WM_BASE_DESTROY); wl_proxy_destroy((struct wl_proxy *) xdg_wm_base); } /** * @ingroup iface_xdg_wm_base * * Create a positioner object. A positioner object is used to position * surfaces relative to some parent surface. See the interface description * and xdg_surface.get_popup for details. */ static inline struct xdg_positioner * xdg_wm_base_create_positioner(struct xdg_wm_base *xdg_wm_base) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_wm_base, XDG_WM_BASE_CREATE_POSITIONER, &xdg_positioner_interface, NULL); return (struct xdg_positioner *) id; } /** * @ingroup iface_xdg_wm_base * * This creates an xdg_surface for the given surface. While xdg_surface * itself is not a role, the corresponding surface may only be assigned * a role extending xdg_surface, such as xdg_toplevel or xdg_popup. * * This creates an xdg_surface for the given surface. An xdg_surface is * used as basis to define a role to a given surface, such as xdg_toplevel * or xdg_popup. It also manages functionality shared between xdg_surface * based surface roles. * * See the documentation of xdg_surface for more details about what an * xdg_surface is and how it is used. */ static inline struct xdg_surface * xdg_wm_base_get_xdg_surface(struct xdg_wm_base *xdg_wm_base, struct wl_surface *surface) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_wm_base, XDG_WM_BASE_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface); return (struct xdg_surface *) id; } /** * @ingroup iface_xdg_wm_base * * A client must respond to a ping event with a pong request or * the client may be deemed unresponsive. See xdg_wm_base.ping. */ static inline void xdg_wm_base_pong(struct xdg_wm_base *xdg_wm_base, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) xdg_wm_base, XDG_WM_BASE_PONG, serial); } #ifndef XDG_POSITIONER_ERROR_ENUM #define XDG_POSITIONER_ERROR_ENUM enum xdg_positioner_error { /** * invalid input provided */ XDG_POSITIONER_ERROR_INVALID_INPUT = 0, }; #endif /* XDG_POSITIONER_ERROR_ENUM */ #ifndef XDG_POSITIONER_ANCHOR_ENUM #define XDG_POSITIONER_ANCHOR_ENUM enum xdg_positioner_anchor { XDG_POSITIONER_ANCHOR_NONE = 0, XDG_POSITIONER_ANCHOR_TOP = 1, XDG_POSITIONER_ANCHOR_BOTTOM = 2, XDG_POSITIONER_ANCHOR_LEFT = 3, XDG_POSITIONER_ANCHOR_RIGHT = 4, XDG_POSITIONER_ANCHOR_TOP_LEFT = 5, XDG_POSITIONER_ANCHOR_BOTTOM_LEFT = 6, XDG_POSITIONER_ANCHOR_TOP_RIGHT = 7, XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT = 8, }; #endif /* XDG_POSITIONER_ANCHOR_ENUM */ #ifndef XDG_POSITIONER_GRAVITY_ENUM #define XDG_POSITIONER_GRAVITY_ENUM enum xdg_positioner_gravity { XDG_POSITIONER_GRAVITY_NONE = 0, XDG_POSITIONER_GRAVITY_TOP = 1, XDG_POSITIONER_GRAVITY_BOTTOM = 2, XDG_POSITIONER_GRAVITY_LEFT = 3, XDG_POSITIONER_GRAVITY_RIGHT = 4, XDG_POSITIONER_GRAVITY_TOP_LEFT = 5, XDG_POSITIONER_GRAVITY_BOTTOM_LEFT = 6, XDG_POSITIONER_GRAVITY_TOP_RIGHT = 7, XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT = 8, }; #endif /* XDG_POSITIONER_GRAVITY_ENUM */ #ifndef XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM #define XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM /** * @ingroup iface_xdg_positioner * vertically resize the surface * * Resize the surface vertically so that it is completely unconstrained. */ enum xdg_positioner_constraint_adjustment { XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_NONE = 0, XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1, XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2, XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X = 4, XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8, XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16, XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32, }; #endif /* XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM */ #define XDG_POSITIONER_DESTROY 0 #define XDG_POSITIONER_SET_SIZE 1 #define XDG_POSITIONER_SET_ANCHOR_RECT 2 #define XDG_POSITIONER_SET_ANCHOR 3 #define XDG_POSITIONER_SET_GRAVITY 4 #define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT 5 #define XDG_POSITIONER_SET_OFFSET 6 /** * @ingroup iface_xdg_positioner */ #define XDG_POSITIONER_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_positioner */ #define XDG_POSITIONER_SET_SIZE_SINCE_VERSION 1 /** * @ingroup iface_xdg_positioner */ #define XDG_POSITIONER_SET_ANCHOR_RECT_SINCE_VERSION 1 /** * @ingroup iface_xdg_positioner */ #define XDG_POSITIONER_SET_ANCHOR_SINCE_VERSION 1 /** * @ingroup iface_xdg_positioner */ #define XDG_POSITIONER_SET_GRAVITY_SINCE_VERSION 1 /** * @ingroup iface_xdg_positioner */ #define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1 /** * @ingroup iface_xdg_positioner */ #define XDG_POSITIONER_SET_OFFSET_SINCE_VERSION 1 /** @ingroup iface_xdg_positioner */ static inline void xdg_positioner_set_user_data(struct xdg_positioner *xdg_positioner, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) xdg_positioner, user_data); } /** @ingroup iface_xdg_positioner */ static inline void * xdg_positioner_get_user_data(struct xdg_positioner *xdg_positioner) { return wl_proxy_get_user_data((struct wl_proxy *) xdg_positioner); } static inline uint32_t xdg_positioner_get_version(struct xdg_positioner *xdg_positioner) { return wl_proxy_get_version((struct wl_proxy *) xdg_positioner); } /** * @ingroup iface_xdg_positioner * * Notify the compositor that the xdg_positioner will no longer be used. */ static inline void xdg_positioner_destroy(struct xdg_positioner *xdg_positioner) { wl_proxy_marshal((struct wl_proxy *) xdg_positioner, XDG_POSITIONER_DESTROY); wl_proxy_destroy((struct wl_proxy *) xdg_positioner); } /** * @ingroup iface_xdg_positioner * * Set the size of the surface that is to be positioned with the positioner * object. The size is in surface-local coordinates and corresponds to the * window geometry. See xdg_surface.set_window_geometry. * * If a zero or negative size is set the invalid_input error is raised. */ static inline void xdg_positioner_set_size(struct xdg_positioner *xdg_positioner, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) xdg_positioner, XDG_POSITIONER_SET_SIZE, width, height); } /** * @ingroup iface_xdg_positioner * * Specify the anchor rectangle within the parent surface that the child * surface will be placed relative to. The rectangle is relative to the * window geometry as defined by xdg_surface.set_window_geometry of the * parent surface. * * When the xdg_positioner object is used to position a child surface, the * anchor rectangle may not extend outside the window geometry of the * positioned child's parent surface. * * If a negative size is set the invalid_input error is raised. */ static inline void xdg_positioner_set_anchor_rect(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) xdg_positioner, XDG_POSITIONER_SET_ANCHOR_RECT, x, y, width, height); } /** * @ingroup iface_xdg_positioner * * Defines the anchor point for the anchor rectangle. The specified anchor * is used derive an anchor point that the child surface will be * positioned relative to. If a corner anchor is set (e.g. 'top_left' or * 'bottom_right'), the anchor point will be at the specified corner; * otherwise, the derived anchor point will be centered on the specified * edge, or in the center of the anchor rectangle if no edge is specified. */ static inline void xdg_positioner_set_anchor(struct xdg_positioner *xdg_positioner, uint32_t anchor) { wl_proxy_marshal((struct wl_proxy *) xdg_positioner, XDG_POSITIONER_SET_ANCHOR, anchor); } /** * @ingroup iface_xdg_positioner * * Defines in what direction a surface should be positioned, relative to * the anchor point of the parent surface. If a corner gravity is * specified (e.g. 'bottom_right' or 'top_left'), then the child surface * will be placed towards the specified gravity; otherwise, the child * surface will be centered over the anchor point on any axis that had no * gravity specified. */ static inline void xdg_positioner_set_gravity(struct xdg_positioner *xdg_positioner, uint32_t gravity) { wl_proxy_marshal((struct wl_proxy *) xdg_positioner, XDG_POSITIONER_SET_GRAVITY, gravity); } /** * @ingroup iface_xdg_positioner * * Specify how the window should be positioned if the originally intended * position caused the surface to be constrained, meaning at least * partially outside positioning boundaries set by the compositor. The * adjustment is set by constructing a bitmask describing the adjustment to * be made when the surface is constrained on that axis. * * If no bit for one axis is set, the compositor will assume that the child * surface should not change its position on that axis when constrained. * * If more than one bit for one axis is set, the order of how adjustments * are applied is specified in the corresponding adjustment descriptions. * * The default adjustment is none. */ static inline void xdg_positioner_set_constraint_adjustment(struct xdg_positioner *xdg_positioner, uint32_t constraint_adjustment) { wl_proxy_marshal((struct wl_proxy *) xdg_positioner, XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT, constraint_adjustment); } /** * @ingroup iface_xdg_positioner * * Specify the surface position offset relative to the position of the * anchor on the anchor rectangle and the anchor on the surface. For * example if the anchor of the anchor rectangle is at (x, y), the surface * has the gravity bottom|right, and the offset is (ox, oy), the calculated * surface position will be (x + ox, y + oy). The offset position of the * surface is the one used for constraint testing. See * set_constraint_adjustment. * * An example use case is placing a popup menu on top of a user interface * element, while aligning the user interface element of the parent surface * with some user interface element placed somewhere in the popup surface. */ static inline void xdg_positioner_set_offset(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y) { wl_proxy_marshal((struct wl_proxy *) xdg_positioner, XDG_POSITIONER_SET_OFFSET, x, y); } #ifndef XDG_SURFACE_ERROR_ENUM #define XDG_SURFACE_ERROR_ENUM enum xdg_surface_error { XDG_SURFACE_ERROR_NOT_CONSTRUCTED = 1, XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED = 2, XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER = 3, }; #endif /* XDG_SURFACE_ERROR_ENUM */ /** * @ingroup iface_xdg_surface * @struct xdg_surface_listener */ struct xdg_surface_listener { /** * suggest a surface change * * The configure event marks the end of a configure sequence. A * configure sequence is a set of one or more events configuring * the state of the xdg_surface, including the final * xdg_surface.configure event. * * Where applicable, xdg_surface surface roles will during a * configure sequence extend this event as a latched state sent as * events before the xdg_surface.configure event. Such events * should be considered to make up a set of atomically applied * configuration states, where the xdg_surface.configure commits * the accumulated state. * * Clients should arrange their surface for the new states, and * then send an ack_configure request with the serial sent in this * configure event at some point before committing the new surface. * * If the client receives multiple configure events before it can * respond to one, it is free to discard all but the last event it * received. * @param serial serial of the configure event */ void (*configure)(void *data, struct xdg_surface *xdg_surface, uint32_t serial); }; /** * @ingroup iface_xdg_surface */ static inline int xdg_surface_add_listener(struct xdg_surface *xdg_surface, const struct xdg_surface_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) xdg_surface, (void (**)(void)) listener, data); } #define XDG_SURFACE_DESTROY 0 #define XDG_SURFACE_GET_TOPLEVEL 1 #define XDG_SURFACE_GET_POPUP 2 #define XDG_SURFACE_SET_WINDOW_GEOMETRY 3 #define XDG_SURFACE_ACK_CONFIGURE 4 /** * @ingroup iface_xdg_surface */ #define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ #define XDG_SURFACE_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ #define XDG_SURFACE_GET_TOPLEVEL_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ #define XDG_SURFACE_GET_POPUP_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ #define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ #define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1 /** @ingroup iface_xdg_surface */ static inline void xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data); } /** @ingroup iface_xdg_surface */ static inline void * xdg_surface_get_user_data(struct xdg_surface *xdg_surface) { return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface); } static inline uint32_t xdg_surface_get_version(struct xdg_surface *xdg_surface) { return wl_proxy_get_version((struct wl_proxy *) xdg_surface); } /** * @ingroup iface_xdg_surface * * Destroy the xdg_surface object. An xdg_surface must only be destroyed * after its role object has been destroyed. */ static inline void xdg_surface_destroy(struct xdg_surface *xdg_surface) { wl_proxy_marshal((struct wl_proxy *) xdg_surface, XDG_SURFACE_DESTROY); wl_proxy_destroy((struct wl_proxy *) xdg_surface); } /** * @ingroup iface_xdg_surface * * This creates an xdg_toplevel object for the given xdg_surface and gives * the associated wl_surface the xdg_toplevel role. * * See the documentation of xdg_toplevel for more details about what an * xdg_toplevel is and how it is used. */ static inline struct xdg_toplevel * xdg_surface_get_toplevel(struct xdg_surface *xdg_surface) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_surface, XDG_SURFACE_GET_TOPLEVEL, &xdg_toplevel_interface, NULL); return (struct xdg_toplevel *) id; } /** * @ingroup iface_xdg_surface * * This creates an xdg_popup object for the given xdg_surface and gives * the associated wl_surface the xdg_popup role. * * If null is passed as a parent, a parent surface must be specified using * some other protocol, before committing the initial state. * * See the documentation of xdg_popup for more details about what an * xdg_popup is and how it is used. */ static inline struct xdg_popup * xdg_surface_get_popup(struct xdg_surface *xdg_surface, struct xdg_surface *parent, struct xdg_positioner *positioner) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_surface, XDG_SURFACE_GET_POPUP, &xdg_popup_interface, NULL, parent, positioner); return (struct xdg_popup *) id; } /** * @ingroup iface_xdg_surface * * The window geometry of a surface is its "visible bounds" from the * user's perspective. Client-side decorations often have invisible * portions like drop-shadows which should be ignored for the * purposes of aligning, placing and constraining windows. * * The window geometry is double buffered, and will be applied at the * time wl_surface.commit of the corresponding wl_surface is called. * * When maintaining a position, the compositor should treat the (x, y) * coordinate of the window geometry as the top left corner of the window. * A client changing the (x, y) window geometry coordinate should in * general not alter the position of the window. * * Once the window geometry of the surface is set, it is not possible to * unset it, and it will remain the same until set_window_geometry is * called again, even if a new subsurface or buffer is attached. * * If never set, the value is the full bounds of the surface, * including any subsurfaces. This updates dynamically on every * commit. This unset is meant for extremely simple clients. * * The arguments are given in the surface-local coordinate space of * the wl_surface associated with this xdg_surface. * * The width and height must be greater than zero. Setting an invalid size * will raise an error. When applied, the effective window geometry will be * the set window geometry clamped to the bounding rectangle of the * combined geometry of the surface of the xdg_surface and the associated * subsurfaces. */ static inline void xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) xdg_surface, XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height); } /** * @ingroup iface_xdg_surface * * When a configure event is received, if a client commits the * surface in response to the configure event, then the client * must make an ack_configure request sometime before the commit * request, passing along the serial of the configure event. * * For instance, for toplevel surfaces the compositor might use this * information to move a surface to the top left only when the client has * drawn itself for the maximized or fullscreen state. * * If the client receives multiple configure events before it * can respond to one, it only has to ack the last configure event. * * A client is not required to commit immediately after sending * an ack_configure request - it may even ack_configure several times * before its next surface commit. * * A client may send multiple ack_configure requests before committing, but * only the last request sent before a commit indicates which configure * event the client really is responding to. */ static inline void xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) xdg_surface, XDG_SURFACE_ACK_CONFIGURE, serial); } #ifndef XDG_TOPLEVEL_RESIZE_EDGE_ENUM #define XDG_TOPLEVEL_RESIZE_EDGE_ENUM /** * @ingroup iface_xdg_toplevel * edge values for resizing * * These values are used to indicate which edge of a surface * is being dragged in a resize operation. */ enum xdg_toplevel_resize_edge { XDG_TOPLEVEL_RESIZE_EDGE_NONE = 0, XDG_TOPLEVEL_RESIZE_EDGE_TOP = 1, XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM = 2, XDG_TOPLEVEL_RESIZE_EDGE_LEFT = 4, XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT = 5, XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT = 6, XDG_TOPLEVEL_RESIZE_EDGE_RIGHT = 8, XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT = 9, XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT = 10, }; #endif /* XDG_TOPLEVEL_RESIZE_EDGE_ENUM */ #ifndef XDG_TOPLEVEL_STATE_ENUM #define XDG_TOPLEVEL_STATE_ENUM /** * @ingroup iface_xdg_toplevel * the surface is tiled * * The window is currently in a tiled layout and the bottom edge is * considered to be adjacent to another part of the tiling grid. */ enum xdg_toplevel_state { /** * the surface is maximized */ XDG_TOPLEVEL_STATE_MAXIMIZED = 1, /** * the surface is fullscreen */ XDG_TOPLEVEL_STATE_FULLSCREEN = 2, /** * the surface is being resized */ XDG_TOPLEVEL_STATE_RESIZING = 3, /** * the surface is now activated */ XDG_TOPLEVEL_STATE_ACTIVATED = 4, /** * @since 2 */ XDG_TOPLEVEL_STATE_TILED_LEFT = 5, /** * @since 2 */ XDG_TOPLEVEL_STATE_TILED_RIGHT = 6, /** * @since 2 */ XDG_TOPLEVEL_STATE_TILED_TOP = 7, /** * @since 2 */ XDG_TOPLEVEL_STATE_TILED_BOTTOM = 8, }; /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION 2 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION 2 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_STATE_TILED_TOP_SINCE_VERSION 2 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_STATE_TILED_BOTTOM_SINCE_VERSION 2 #endif /* XDG_TOPLEVEL_STATE_ENUM */ /** * @ingroup iface_xdg_toplevel * @struct xdg_toplevel_listener */ struct xdg_toplevel_listener { /** * suggest a surface change * * This configure event asks the client to resize its toplevel * surface or to change its state. The configured state should not * be applied immediately. See xdg_surface.configure for details. * * The width and height arguments specify a hint to the window * about how its surface should be resized in window geometry * coordinates. See set_window_geometry. * * If the width or height arguments are zero, it means the client * should decide its own window dimension. This may happen when the * compositor needs to configure the state of the surface but * doesn't have any information about any previous or expected * dimension. * * The states listed in the event specify how the width/height * arguments should be interpreted, and possibly how it should be * drawn. * * Clients must send an ack_configure in response to this event. * See xdg_surface.configure and xdg_surface.ack_configure for * details. */ void (*configure)(void *data, struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height, struct wl_array *states); /** * surface wants to be closed * * The close event is sent by the compositor when the user wants * the surface to be closed. This should be equivalent to the user * clicking the close button in client-side decorations, if your * application has any. * * This is only a request that the user intends to close the * window. The client may choose to ignore this request, or show a * dialog to ask the user to save their data, etc. */ void (*close)(void *data, struct xdg_toplevel *xdg_toplevel); }; /** * @ingroup iface_xdg_toplevel */ static inline int xdg_toplevel_add_listener(struct xdg_toplevel *xdg_toplevel, const struct xdg_toplevel_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) xdg_toplevel, (void (**)(void)) listener, data); } #define XDG_TOPLEVEL_DESTROY 0 #define XDG_TOPLEVEL_SET_PARENT 1 #define XDG_TOPLEVEL_SET_TITLE 2 #define XDG_TOPLEVEL_SET_APP_ID 3 #define XDG_TOPLEVEL_SHOW_WINDOW_MENU 4 #define XDG_TOPLEVEL_MOVE 5 #define XDG_TOPLEVEL_RESIZE 6 #define XDG_TOPLEVEL_SET_MAX_SIZE 7 #define XDG_TOPLEVEL_SET_MIN_SIZE 8 #define XDG_TOPLEVEL_SET_MAXIMIZED 9 #define XDG_TOPLEVEL_UNSET_MAXIMIZED 10 #define XDG_TOPLEVEL_SET_FULLSCREEN 11 #define XDG_TOPLEVEL_UNSET_FULLSCREEN 12 #define XDG_TOPLEVEL_SET_MINIMIZED 13 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_CLOSE_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_PARENT_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_TITLE_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_APP_ID_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SHOW_WINDOW_MENU_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_MOVE_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_RESIZE_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_MAX_SIZE_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_MIN_SIZE_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_UNSET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_FULLSCREEN_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_UNSET_FULLSCREEN_SINCE_VERSION 1 /** * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_SET_MINIMIZED_SINCE_VERSION 1 /** @ingroup iface_xdg_toplevel */ static inline void xdg_toplevel_set_user_data(struct xdg_toplevel *xdg_toplevel, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) xdg_toplevel, user_data); } /** @ingroup iface_xdg_toplevel */ static inline void * xdg_toplevel_get_user_data(struct xdg_toplevel *xdg_toplevel) { return wl_proxy_get_user_data((struct wl_proxy *) xdg_toplevel); } static inline uint32_t xdg_toplevel_get_version(struct xdg_toplevel *xdg_toplevel) { return wl_proxy_get_version((struct wl_proxy *) xdg_toplevel); } /** * @ingroup iface_xdg_toplevel * * This request destroys the role surface and unmaps the surface; * see "Unmapping" behavior in interface section for details. */ static inline void xdg_toplevel_destroy(struct xdg_toplevel *xdg_toplevel) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_DESTROY); wl_proxy_destroy((struct wl_proxy *) xdg_toplevel); } /** * @ingroup iface_xdg_toplevel * * Set the "parent" of this surface. This surface should be stacked * above the parent surface and all other ancestor surfaces. * * Parent windows should be set on dialogs, toolboxes, or other * "auxiliary" surfaces, so that the parent is raised when the dialog * is raised. * * Setting a null parent for a child window removes any parent-child * relationship for the child. Setting a null parent for a window which * currently has no parent is a no-op. * * If the parent is unmapped then its children are managed as * though the parent of the now-unmapped parent has become the * parent of this surface. If no parent exists for the now-unmapped * parent then the children are managed as though they have no * parent surface. */ static inline void xdg_toplevel_set_parent(struct xdg_toplevel *xdg_toplevel, struct xdg_toplevel *parent) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_PARENT, parent); } /** * @ingroup iface_xdg_toplevel * * Set a short title for the surface. * * This string may be used to identify the surface in a task bar, * window list, or other user interface elements provided by the * compositor. * * The string must be encoded in UTF-8. */ static inline void xdg_toplevel_set_title(struct xdg_toplevel *xdg_toplevel, const char *title) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_TITLE, title); } /** * @ingroup iface_xdg_toplevel * * Set an application identifier for the surface. * * The app ID identifies the general class of applications to which * the surface belongs. The compositor can use this to group multiple * surfaces together, or to determine how to launch a new application. * * For D-Bus activatable applications, the app ID is used as the D-Bus * service name. * * The compositor shell will try to group application surfaces together * by their app ID. As a best practice, it is suggested to select app * ID's that match the basename of the application's .desktop file. * For example, "org.freedesktop.FooViewer" where the .desktop file is * "org.freedesktop.FooViewer.desktop". * * Like other properties, a set_app_id request can be sent after the * xdg_toplevel has been mapped to update the property. * * See the desktop-entry specification [0] for more details on * application identifiers and how they relate to well-known D-Bus * names and .desktop files. * * [0] http://standards.freedesktop.org/desktop-entry-spec/ */ static inline void xdg_toplevel_set_app_id(struct xdg_toplevel *xdg_toplevel, const char *app_id) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_APP_ID, app_id); } /** * @ingroup iface_xdg_toplevel * * Clients implementing client-side decorations might want to show * a context menu when right-clicking on the decorations, giving the * user a menu that they can use to maximize or minimize the window. * * This request asks the compositor to pop up such a window menu at * the given position, relative to the local surface coordinates of * the parent surface. There are no guarantees as to what menu items * the window menu contains. * * This request must be used in response to some sort of user action * like a button press, key press, or touch down event. */ static inline void xdg_toplevel_show_window_menu(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SHOW_WINDOW_MENU, seat, serial, x, y); } /** * @ingroup iface_xdg_toplevel * * Start an interactive, user-driven move of the surface. * * This request must be used in response to some sort of user action * like a button press, key press, or touch down event. The passed * serial is used to determine the type of interactive move (touch, * pointer, etc). * * The server may ignore move requests depending on the state of * the surface (e.g. fullscreen or maximized), or if the passed serial * is no longer valid. * * If triggered, the surface will lose the focus of the device * (wl_pointer, wl_touch, etc) used for the move. It is up to the * compositor to visually indicate that the move is taking place, such as * updating a pointer cursor, during the move. There is no guarantee * that the device focus will return when the move is completed. */ static inline void xdg_toplevel_move(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_MOVE, seat, serial); } /** * @ingroup iface_xdg_toplevel * * Start a user-driven, interactive resize of the surface. * * This request must be used in response to some sort of user action * like a button press, key press, or touch down event. The passed * serial is used to determine the type of interactive resize (touch, * pointer, etc). * * The server may ignore resize requests depending on the state of * the surface (e.g. fullscreen or maximized). * * If triggered, the client will receive configure events with the * "resize" state enum value and the expected sizes. See the "resize" * enum value for more details about what is required. The client * must also acknowledge configure events using "ack_configure". After * the resize is completed, the client will receive another "configure" * event without the resize state. * * If triggered, the surface also will lose the focus of the device * (wl_pointer, wl_touch, etc) used for the resize. It is up to the * compositor to visually indicate that the resize is taking place, * such as updating a pointer cursor, during the resize. There is no * guarantee that the device focus will return when the resize is * completed. * * The edges parameter specifies how the surface should be resized, * and is one of the values of the resize_edge enum. The compositor * may use this information to update the surface position for * example when dragging the top left corner. The compositor may also * use this information to adapt its behavior, e.g. choose an * appropriate cursor image. */ static inline void xdg_toplevel_resize(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, uint32_t edges) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_RESIZE, seat, serial, edges); } /** * @ingroup iface_xdg_toplevel * * Set a maximum size for the window. * * The client can specify a maximum size so that the compositor does * not try to configure the window beyond this size. * * The width and height arguments are in window geometry coordinates. * See xdg_surface.set_window_geometry. * * Values set in this way are double-buffered. They will get applied * on the next commit. * * The compositor can use this information to allow or disallow * different states like maximize or fullscreen and draw accurate * animations. * * Similarly, a tiling window manager may use this information to * place and resize client windows in a more effective way. * * The client should not rely on the compositor to obey the maximum * size. The compositor may decide to ignore the values set by the * client and request a larger size. * * If never set, or a value of zero in the request, means that the * client has no expected maximum size in the given dimension. * As a result, a client wishing to reset the maximum size * to an unspecified state can use zero for width and height in the * request. * * Requesting a maximum size to be smaller than the minimum size of * a surface is illegal and will result in a protocol error. * * The width and height must be greater than or equal to zero. Using * strictly negative values for width and height will result in a * protocol error. */ static inline void xdg_toplevel_set_max_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_MAX_SIZE, width, height); } /** * @ingroup iface_xdg_toplevel * * Set a minimum size for the window. * * The client can specify a minimum size so that the compositor does * not try to configure the window below this size. * * The width and height arguments are in window geometry coordinates. * See xdg_surface.set_window_geometry. * * Values set in this way are double-buffered. They will get applied * on the next commit. * * The compositor can use this information to allow or disallow * different states like maximize or fullscreen and draw accurate * animations. * * Similarly, a tiling window manager may use this information to * place and resize client windows in a more effective way. * * The client should not rely on the compositor to obey the minimum * size. The compositor may decide to ignore the values set by the * client and request a smaller size. * * If never set, or a value of zero in the request, means that the * client has no expected minimum size in the given dimension. * As a result, a client wishing to reset the minimum size * to an unspecified state can use zero for width and height in the * request. * * Requesting a minimum size to be larger than the maximum size of * a surface is illegal and will result in a protocol error. * * The width and height must be greater than or equal to zero. Using * strictly negative values for width and height will result in a * protocol error. */ static inline void xdg_toplevel_set_min_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_MIN_SIZE, width, height); } /** * @ingroup iface_xdg_toplevel * * Maximize the surface. * * After requesting that the surface should be maximized, the compositor * will respond by emitting a configure event. Whether this configure * actually sets the window maximized is subject to compositor policies. * The client must then update its content, drawing in the configured * state. The client must also acknowledge the configure when committing * the new content (see ack_configure). * * It is up to the compositor to decide how and where to maximize the * surface, for example which output and what region of the screen should * be used. * * If the surface was already maximized, the compositor will still emit * a configure event with the "maximized" state. * * If the surface is in a fullscreen state, this request has no direct * effect. It may alter the state the surface is returned to when * unmaximized unless overridden by the compositor. */ static inline void xdg_toplevel_set_maximized(struct xdg_toplevel *xdg_toplevel) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_MAXIMIZED); } /** * @ingroup iface_xdg_toplevel * * Unmaximize the surface. * * After requesting that the surface should be unmaximized, the compositor * will respond by emitting a configure event. Whether this actually * un-maximizes the window is subject to compositor policies. * If available and applicable, the compositor will include the window * geometry dimensions the window had prior to being maximized in the * configure event. The client must then update its content, drawing it in * the configured state. The client must also acknowledge the configure * when committing the new content (see ack_configure). * * It is up to the compositor to position the surface after it was * unmaximized; usually the position the surface had before maximizing, if * applicable. * * If the surface was already not maximized, the compositor will still * emit a configure event without the "maximized" state. * * If the surface is in a fullscreen state, this request has no direct * effect. It may alter the state the surface is returned to when * unmaximized unless overridden by the compositor. */ static inline void xdg_toplevel_unset_maximized(struct xdg_toplevel *xdg_toplevel) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_UNSET_MAXIMIZED); } /** * @ingroup iface_xdg_toplevel * * Make the surface fullscreen. * * After requesting that the surface should be fullscreened, the * compositor will respond by emitting a configure event. Whether the * client is actually put into a fullscreen state is subject to compositor * policies. The client must also acknowledge the configure when * committing the new content (see ack_configure). * * The output passed by the request indicates the client's preference as * to which display it should be set fullscreen on. If this value is NULL, * it's up to the compositor to choose which display will be used to map * this surface. * * If the surface doesn't cover the whole output, the compositor will * position the surface in the center of the output and compensate with * with border fill covering the rest of the output. The content of the * border fill is undefined, but should be assumed to be in some way that * attempts to blend into the surrounding area (e.g. solid black). * * If the fullscreened surface is not opaque, the compositor must make * sure that other screen content not part of the same surface tree (made * up of subsurfaces, popups or similarly coupled surfaces) are not * visible below the fullscreened surface. */ static inline void xdg_toplevel_set_fullscreen(struct xdg_toplevel *xdg_toplevel, struct wl_output *output) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_FULLSCREEN, output); } /** * @ingroup iface_xdg_toplevel * * Make the surface no longer fullscreen. * * After requesting that the surface should be unfullscreened, the * compositor will respond by emitting a configure event. * Whether this actually removes the fullscreen state of the client is * subject to compositor policies. * * Making a surface unfullscreen sets states for the surface based on the following: * * the state(s) it may have had before becoming fullscreen * * any state(s) decided by the compositor * * any state(s) requested by the client while the surface was fullscreen * * The compositor may include the previous window geometry dimensions in * the configure event, if applicable. * * The client must also acknowledge the configure when committing the new * content (see ack_configure). */ static inline void xdg_toplevel_unset_fullscreen(struct xdg_toplevel *xdg_toplevel) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_UNSET_FULLSCREEN); } /** * @ingroup iface_xdg_toplevel * * Request that the compositor minimize your surface. There is no * way to know if the surface is currently minimized, nor is there * any way to unset minimization on this surface. * * If you are looking to throttle redrawing when minimized, please * instead use the wl_surface.frame event for this, as this will * also work with live previews on windows in Alt-Tab, Expose or * similar compositor features. */ static inline void xdg_toplevel_set_minimized(struct xdg_toplevel *xdg_toplevel) { wl_proxy_marshal((struct wl_proxy *) xdg_toplevel, XDG_TOPLEVEL_SET_MINIMIZED); } #ifndef XDG_POPUP_ERROR_ENUM #define XDG_POPUP_ERROR_ENUM enum xdg_popup_error { /** * tried to grab after being mapped */ XDG_POPUP_ERROR_INVALID_GRAB = 0, }; #endif /* XDG_POPUP_ERROR_ENUM */ /** * @ingroup iface_xdg_popup * @struct xdg_popup_listener */ struct xdg_popup_listener { /** * configure the popup surface * * This event asks the popup surface to configure itself given * the configuration. The configured state should not be applied * immediately. See xdg_surface.configure for details. * * The x and y arguments represent the position the popup was * placed at given the xdg_positioner rule, relative to the upper * left corner of the window geometry of the parent surface. * @param x x position relative to parent surface window geometry * @param y y position relative to parent surface window geometry * @param width window geometry width * @param height window geometry height */ void (*configure)(void *data, struct xdg_popup *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height); /** * popup interaction is done * * The popup_done event is sent out when a popup is dismissed by * the compositor. The client should destroy the xdg_popup object * at this point. */ void (*popup_done)(void *data, struct xdg_popup *xdg_popup); }; /** * @ingroup iface_xdg_popup */ static inline int xdg_popup_add_listener(struct xdg_popup *xdg_popup, const struct xdg_popup_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) xdg_popup, (void (**)(void)) listener, data); } #define XDG_POPUP_DESTROY 0 #define XDG_POPUP_GRAB 1 /** * @ingroup iface_xdg_popup */ #define XDG_POPUP_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_xdg_popup */ #define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1 /** * @ingroup iface_xdg_popup */ #define XDG_POPUP_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_popup */ #define XDG_POPUP_GRAB_SINCE_VERSION 1 /** @ingroup iface_xdg_popup */ static inline void xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data); } /** @ingroup iface_xdg_popup */ static inline void * xdg_popup_get_user_data(struct xdg_popup *xdg_popup) { return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup); } static inline uint32_t xdg_popup_get_version(struct xdg_popup *xdg_popup) { return wl_proxy_get_version((struct wl_proxy *) xdg_popup); } /** * @ingroup iface_xdg_popup * * This destroys the popup. Explicitly destroying the xdg_popup * object will also dismiss the popup, and unmap the surface. * * If this xdg_popup is not the "topmost" popup, a protocol error * will be sent. */ static inline void xdg_popup_destroy(struct xdg_popup *xdg_popup) { wl_proxy_marshal((struct wl_proxy *) xdg_popup, XDG_POPUP_DESTROY); wl_proxy_destroy((struct wl_proxy *) xdg_popup); } /** * @ingroup iface_xdg_popup * * This request makes the created popup take an explicit grab. An explicit * grab will be dismissed when the user dismisses the popup, or when the * client destroys the xdg_popup. This can be done by the user clicking * outside the surface, using the keyboard, or even locking the screen * through closing the lid or a timeout. * * If the compositor denies the grab, the popup will be immediately * dismissed. * * This request must be used in response to some sort of user action like a * button press, key press, or touch down event. The serial number of the * event should be passed as 'serial'. * * The parent of a grabbing popup must either be an xdg_toplevel surface or * another xdg_popup with an explicit grab. If the parent is another * xdg_popup it means that the popups are nested, with this popup now being * the topmost popup. * * Nested popups must be destroyed in the reverse order they were created * in, e.g. the only popup you are allowed to destroy at all times is the * topmost one. * * When compositors choose to dismiss a popup, they may dismiss every * nested grabbing popup as well. When a compositor dismisses popups, it * will follow the same dismissing order as required from the client. * * The parent of a grabbing popup must either be another xdg_popup with an * active explicit grab, or an xdg_popup or xdg_toplevel, if there are no * explicit grabs already taken. * * If the topmost grabbing popup is destroyed, the grab will be returned to * the parent of the popup, if that parent previously had an explicit grab. * * If the parent is a grabbing popup which has already been dismissed, this * popup will be immediately dismissed. If the parent is a popup that did * not take an explicit grab, an error will be raised. * * During a popup grab, the client owning the grab will receive pointer * and touch events for all their surfaces as normal (similar to an * "owner-events" grab in X11 parlance), while the top most grabbing popup * will always have keyboard focus. */ static inline void xdg_popup_grab(struct xdg_popup *xdg_popup, struct wl_seat *seat, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) xdg_popup, XDG_POPUP_GRAB, seat, serial); } #ifdef __cplusplus } #endif #endif gnustep-back-0.29.0/Headers/win32/000077500000000000000000000000001404163720200165015ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/win32/WIN32Geometry.h000066400000000000000000000101621404163720200211700ustar00rootroot00000000000000/* WIN32Geometry - Implements coordinate transformations for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: April 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WIN32Geometry_h_INCLUDE #define _WIN32Geometry_h_INCLUDE #include #include @class WIN32Server; static inline NSPoint MSWindowPointToGS(WIN32Server *svr, HWND hwnd, int x, int y) { NSGraphicsContext *ctxt; RECT rect; float h, l, r, t, b; NSPoint p1; NSWindow *window; ctxt = GSCurrentContext(); window = GSWindowWithNumber((int)hwnd); GetClientRect(hwnd, &rect); h = rect.bottom - rect.top; [svr styleoffsets: &l : &r : &t : &b : [window styleMask]]; p1.x = x + l; p1.y = h - y + b; return p1; } static inline NSRect MSWindowRectToGS(WIN32Server *svr, HWND hwnd, RECT r0) { NSGraphicsContext *ctxt; RECT rect; float h, l, r, t, b; NSRect r1; NSWindow *window; ctxt = GSCurrentContext(); window = GSWindowWithNumber((int)hwnd); GetClientRect(hwnd, &rect); h = rect.bottom - rect.top; [svr styleoffsets: &l : &r : &t : &b : [window styleMask]]; r1.origin.x = r0.left + l; r1.origin.y = h - r0.bottom + b; r1.size.width = r0.right - r0.left; r1.size.height = r0.bottom - r0.top; return r1; } static inline RECT GSWindowRectToMS(WIN32Server *svr, HWND hwnd, NSRect r0) { NSGraphicsContext *ctxt; RECT rect; float h, l, r, t, b; RECT r1; NSWindow *window; ctxt = GSCurrentContext(); window = GSWindowWithNumber((int)hwnd); GetClientRect(hwnd, &rect); h = rect.bottom - rect.top; [svr styleoffsets: &l : &r : &t : &b : [window styleMask]]; r1.left = r0.origin.x - l; r1.bottom = h - r0.origin.y + b; r1.right = r1.left + r0.size.width; r1.top = r1.bottom - r0.size.height; return r1; } static inline NSPoint MSWindowOriginToGS(HWND hwnd, int x, int y) { NSPoint p1; RECT rect; int h; int screen_height = GetSystemMetrics(SM_CYSCREEN); GetWindowRect(hwnd, &rect); h = rect.bottom - rect.top; p1.x = x; p1.y = screen_height - y - h; return p1; } static inline POINT GSWindowOriginToMS(HWND hwnd, NSPoint p) { POINT p1; RECT rect; int h; int screen_height = GetSystemMetrics(SM_CYSCREEN); GetWindowRect(hwnd, &rect); h = rect.bottom - rect.top; p1.x = p.x; p1.y = screen_height - p.y - h; return p1; } static inline NSPoint MSScreenPointToGS(int x, int y) { NSPoint p1; int screen_height = GetSystemMetrics(SM_CYSCREEN); p1.x = x; p1.y = screen_height - y; return p1; } static inline NSRect MSScreenRectToGS(RECT r) { NSRect r1; int screen_height = GetSystemMetrics(SM_CYSCREEN); r1.origin.x = r.left; r1.origin.y = screen_height - r.bottom; r1.size.width = r.right - r.left; r1.size.height = r.bottom - r.top; return r1; } static inline POINT GSScreenPointToMS(NSPoint p) { POINT p1; int screen_height = GetSystemMetrics(SM_CYSCREEN); p1.x = p.x; p1.y = screen_height - p.y; return p1; } static inline RECT GSScreenRectToMS(NSRect r) { RECT r1; int screen_height = GetSystemMetrics(SM_CYSCREEN); r1.left = r.origin.x; r1.bottom = screen_height - r.origin.y; r1.right = r.origin.x + r.size.width; r1.top = screen_height - r.origin.y - r.size.height; return r1; } #endif /* _WIN32Geometry_h_INCLUDE */ gnustep-back-0.29.0/Headers/win32/WIN32OpenGL.h000066400000000000000000000031751404163720200205270ustar00rootroot00000000000000/* -*-ObjC-*- */ /* Win32OpenGL - openGL management using wgl Copyright (C) 2002 Free Software Foundation, Inc. Author: Xavier Glattard Date: Jan 2007 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_WIN32OpenGL #define _GNUstep_H_WIN32OpenGL #include #define id _gs_avoid_id_collision #define BOOL WINDOWSBOOL #include #undef id #undef BOOL @class NSView; @class Win32Subwindow; @class Win32GLPixelFormat; @interface Win32GLContext : NSOpenGLContext { @public HGLRC wgl_context; Win32Subwindow *wsubwin; Win32GLPixelFormat *format; BOOL saved_ignores_backing; } @end @interface Win32GLPixelFormat : NSOpenGLPixelFormat { @public PIXELFORMATDESCRIPTOR pfd; HDC wgl_drawable; int wgl_pixelformat; } - (void) _setDrawable: (HDC) aDrawable; @end #endif gnustep-back-0.29.0/Headers/win32/WIN32Server.h000066400000000000000000000171751404163720200206560ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2002,2005 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 Part of this code have been re-written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WIN32Server_h_INCLUDE #define _WIN32Server_h_INCLUDE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* MINGW64 hack to build */ #ifdef __MINGW64__ #undef GWL_USERDATA #define GWL_USERDATA GWLP_USERDATA #endif /* This standard windows macros are missing in MinGW. The definition here is almost correct, but will fail for multi monitor systems */ #ifndef GET_X_LPARAM #define GET_X_LPARAM(p) ((int)(short)LOWORD(p)) #endif #ifndef GET_Y_LPARAM #define GET_Y_LPARAM(p) ((int)(short)HIWORD(p)) #endif // The horizontal mousehweel message is missing in MinGW #ifndef WM_MOUSEHWHEEL #define WM_MOUSEHWHEEL 0x020E #endif #define EVENT_WINDOW(lp) (GSWindowWithNumber((int)lp)) DWORD windowStyleForGSStyle(unsigned int style); typedef struct w32serverFlags { BOOL HOLD_MINI_FOR_SIZE; // override GS size event on miniturize BOOL _eventHandled; // did we handle the event? } serverFlags; @interface WIN32Server : GSDisplayServer { BOOL handlesWindowDecorations; BOOL usesNativeTaskbar; serverFlags flags; HINSTANCE hinstance; HWND currentFocus; HWND desiredFocus; HWND currentActive; HICON currentAppIcon; NSMutableArray *monitorInfo; } - (BOOL) handlesWindowDecorations; - (void) setHandlesWindowDecorations: (BOOL) b; - (BOOL) usesNativeTaskbar; - (void) setUsesNativeTaskbar: (BOOL) b; + (void) initializeBackend; - (LRESULT) windowEventProc: (HWND)hwnd : (UINT)uMsg : (WPARAM)wParam : (LPARAM)lParam; - (void) setFlagsforEventLoop: (HWND)hwnd; - (DWORD) windowStyleForGSStyle: (unsigned int) style; - (void) resizeBackingStoreFor: (HWND)hwnd; - (HDC) createHdcForScreen: (int)screen; - (void) deleteScreenHdc: (HDC)hdc; @end @interface WIN32Server (w32_activate) - (LRESULT) decodeWM_MOUSEACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_ACTIVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam; - (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; @end @interface WIN32Server (w32_movesize) - (LRESULT) decodeWM_SIZEParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam; - (LRESULT) decodeWM_MOVEParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam; - (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_WINDOWPOSCHANGINGParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_ENTERSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_MOVINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam; - (LRESULT) decodeWM_SIZINGParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam; @end @interface WIN32Server (w32_create) - (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_CREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; @end @interface WIN32Server (w32_windowdisplay) - (void) decodeWM_SHOWWINDOWParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_NCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_ERASEBKGNDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_PAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_SYNCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_CAPTURECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (HICON) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (HICON) decodeWM_SETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; @end @interface WIN32Server (w32_text_focus) //- (LRESULT) decodeWM_SETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (LRESULT) decodeWM_SETFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_KILLFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_GETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; @end @interface WIN32Server (w32_General) - (void) decodeWM_CLOSEParams: (WPARAM)wParam :(LPARAM)lParam :(HWND)hwnd; - (void) decodeWM_DESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_NCDESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_QUERYOPENParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_SYSCOMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_COMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_THEMECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; @end // FIXME: Keep all of the extra window data in one place // Extra window data accessed via GetWindowLong enum _WIN_EXTRA_BYTES { OFF_LEVEL = 0, OFF_ORDERED = OFF_LEVEL + sizeof(DWORD), IME_INFO = OFF_ORDERED + sizeof(DWORD), WIN_EXTRABYTES = IME_INFO + sizeof(DWORD) }; // Pointer to this struct set in IME_INFO extra bytes space for // handling IME composition processing between various windows... typedef struct IME_INFO_S { DWORD isOpened; BOOL isComposing; LPVOID readString; DWORD readStringLength; LPVOID compString; DWORD compStringLength; DWORD compositionMode; DWORD sentenceMode; } IME_INFO_T; // Extra window data allocated using objc_malloc in WM_CREATE and accessed via // the GWL_USERDATA pointer typedef struct _win_intern { BOOL useHDC; BOOL backingStoreEmpty; HDC hdc; HGDIOBJ old; MINMAXINFO minmax; NSBackingStoreType type; #if (BUILD_GRAPHICS==GRAPHICS_cairo) void *surface; #endif } WIN_INTERN; #endif /* _WIN32Server_h_INCLUDE */ gnustep-back-0.29.0/Headers/winlib/000077500000000000000000000000001404163720200170235ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/winlib/WIN32Context.h000066400000000000000000000023341404163720200213450ustar00rootroot00000000000000/* WIN32Context - Implements graphic context for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WIN32Context_h_INCLUDE #define _WIN32Context_h_INCLUDE #include "gsc/GSContext.h" @interface WIN32Context : GSContext { @public } @end #endif /* _WIN32Context_h_INCLUDE */ gnustep-back-0.29.0/Headers/winlib/WIN32FontEnumerator.h000066400000000000000000000024041404163720200226670ustar00rootroot00000000000000/* Win32FontEnumerator - Implements font enumerator for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WIN32FontEnumerator_h_INCLUDE #define _WIN32FontEnumerator_h_INCLUDE #include "GNUstepGUI/GSFontInfo.h" @interface WIN32FontEnumerator : GSFontEnumerator { } @end #endif/* _WIN32FontEnumerator_h_INCLUDE */ gnustep-back-0.29.0/Headers/winlib/WIN32FontInfo.h000066400000000000000000000026751404163720200214530ustar00rootroot00000000000000/* Win32FontInfo - Implements font enumerator for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WIN32FontInfo_h_INCLUDE #define _WIN32FontInfo_h_INCLUDE #include "windows.h" #include "GNUstepGUI/GSFontInfo.h" @interface WIN32FontInfo : GSFontInfo { HFONT hFont; } - (void) draw: (const char*)s length: (int)len onDC: (HDC)hdc at: (POINT)p; - (void) drawGlyphs: (const NSGlyph*)s length: (int)len onDC: (HDC)hdc at: (POINT)p; @end #endif/* _WIN32FontInfo_h_INCLUDE */ gnustep-back-0.29.0/Headers/winlib/WIN32GState.h000066400000000000000000000034161404163720200211120ustar00rootroot00000000000000/* WIN32GState - Implements graphic state drawing for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WIN32GState_h_INCLUDE #define _WIN32GState_h_INCLUDE #include "gsc/GSGState.h" #include "windows.h" @interface WIN32GState : GSGState { @public HWND window; COLORREF wfcolor; COLORREF wscolor; int joinStyle; int lineCap; float lineWidth; float miterlimit; HRGN clipRegion; HGDIOBJ oldBrush; HGDIOBJ oldPen; HRGN oldClipRegion; XFORM oldWorldTransform; } - (void) setWindow: (HWND)number; - (HWND) window; // declared to fix conflicting type with super class warning during compile - (void) compositeGState: (WIN32GState *) source fromRect: (NSRect) sourceRect toPoint: (NSPoint) destPoint op: (NSCompositingOperation) op fraction: (float)delta; @end #endif /* _WIN32GState_h_INCLUDE */ gnustep-back-0.29.0/Headers/x11/000077500000000000000000000000001404163720200161505ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/x11/StdCmap.h000066400000000000000000000057741404163720200176710ustar00rootroot00000000000000/* $XConsortium: StdCmap.h,v 1.4 94/04/17 20:16:15 converse Exp $ */ /* Copyright (c) 1988 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. */ /* * The interfaces described by this header file are for miscellaneous utilities * and are not part of the Xlib standard. */ #ifndef _XMU_STDCMAP_H_ #define _XMU_STDCMAP_H_ #include _XFUNCPROTOBEGIN Status XmuAllStandardColormaps( #if NeedFunctionPrototypes Display* /* dpy */ #endif ); Status XmuCreateColormap( #if NeedFunctionPrototypes Display* /* dpy */, XStandardColormap* /* colormap */ #endif ); void XmuDeleteStandardColormap( #if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Atom /* property */ #endif ); Status XmuGetColormapAllocation( #if NeedFunctionPrototypes XVisualInfo* /* vinfo */, Atom /* property */, unsigned long* /* red_max_return */, unsigned long* /* green_max_return */, unsigned long* /* blue_max_return */ #endif ); Status XmuLookupStandardColormap( #if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, VisualID /* visualid */, unsigned int /* depth */, Atom /* property */, Bool /* replace */, Bool /* retain */ #endif ); XStandardColormap *XmuStandardColormap( #if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, VisualID /* visualid */, unsigned int /* depth */, Atom /* property */, Colormap /* cmap */, unsigned long /* red_max */, unsigned long /* green_max */, unsigned long /* blue_max */ #endif ); Status XmuVisualStandardColormaps( #if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, VisualID /* visualid */, unsigned int /* depth */, Bool /* replace */, Bool /* retain */ #endif ); _XFUNCPROTOEND #endif /* _XMU_STDCMAP_H_ */ gnustep-back-0.29.0/Headers/x11/XGDragView.h000066400000000000000000000042741404163720200202770ustar00rootroot00000000000000/* -*- mode: ObjC -*- XGDragView View that is dragged during drag and drop Copyright (C) 2001-2005 Free Software Foundation, Inc. Written By: woudshoo@xs4all.nl Date: Nov 2001 This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "x11/xdnd.h" #include "x11/XGServerWindow.h" /*" Drag and drop support functions "*/ void GSEnsureDndIsInitialized (void); DndClass xdnd (void); Atom GSActionForDragOperation(unsigned int op); NSDragOperation GSDragOperationForAction(Atom xaction); /*" WRO (notes made 18 Nov 2001) The object that is dragged over the screen. It hijacks the event loop and manages the complete drag and drop sequence. "*/ @interface XGDragView : GSDragView { Atom *typelist; } + (id) sharedDragView; - (void) setupDragInfoFromXEvent: (XEvent *)xEvent; - (void) updateDragInfoFromEvent: (NSEvent *)event; - (void) resetDragInfo; - (void) dragImage: (NSImage*)anImage at: (NSPoint)screenLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag; - (Window) _xWindowAcceptingDnDunderX: (int) x Y: (int) y; @end gnustep-back-0.29.0/Headers/x11/XGGeneric.h000066400000000000000000000222661404163720200201440ustar00rootroot00000000000000/* Generic header info common to X backends for GNUstep Copyright (C) 2000 Free Software Foundation, Inc. Written by: Richard Frith-Macdonald Date: Mar 2000 This file is part of the GNUstep project 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_XGGENERIC_H #define INCLUDED_XGGENERIC_H /* * Flags to indicate which protocols the WindowManager follows */ typedef enum { XGWM_UNKNOWN = 0, XGWM_WINDOWMAKER = 1, XGWM_GNOME = 2, XGWM_EWMH = 8 } XGWMProtocols; static char *atom_names[] = { "TEXT", "UTF8_STRING", "WM_PROTOCOLS", "WM_TAKE_FOCUS", "WM_DELETE_WINDOW", "WM_STATE", "_NET_WM_PING", "_NET_WM_SYNC_REQUEST", "_NET_WM_SYNC_REQUEST_COUNTER", "_NET_WM_WINDOW_TYPE", "_NET_WM_WINDOW_TYPE_DESKTOP", "_NET_WM_WINDOW_TYPE_DOCK", "_NET_WM_WINDOW_TYPE_TOOLBAR", "_NET_WM_WINDOW_TYPE_MENU", "_NET_WM_WINDOW_TYPE_DIALOG", "_NET_WM_WINDOW_TYPE_NORMAL", // New in wmspec 1.2 "_NET_WM_WINDOW_TYPE_UTILITY", "_NET_WM_WINDOW_TYPE_SPLASH", // New in wmspec 1.4 "_NET_WM_WINDOW_TYPE_POPUP_MENU", "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", "_NET_WM_WINDOW_TYPE_TOOLTIP", "_NET_WM_WINDOW_TYPE_NOTIFICATION", "_NET_WM_WINDOW_TYPE_COMBO", "_NET_WM_WINDOW_TYPE_DND", //KDE extensions "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", // Window state "_NET_WM_STATE", "_NET_WM_STATE_MODAL", "_NET_WM_STATE_STICKY", "_NET_WM_STATE_MAXIMIZED_VERT", "_NET_WM_STATE_MAXIMIZED_HORZ", "_NET_WM_STATE_SHADED", "_NET_WM_STATE_SKIP_TASKBAR", "_NET_WM_STATE_SKIP_PAGER", "_NET_WM_STATE_HIDDEN", "_NET_WM_STATE_FULLSCREEN", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_BELOW", "_NET_WM_STATE_DEMANDS_ATTENTION", "_NET_WM_NAME", "_NET_WM_PID", "_NET_WM_ICON", "_NET_WM_ICON_NAME", "_NET_WM_DESKTOP", "_NET_WM_WINDOW_SHADOW", "_NET_WM_USER_TIME", "_NET_WM_WINDOW_OPACITY", "_MOTIF_WM_HINTS", "_NET_SUPPORTED", "_NET_FRAME_EXTENTS", "_NET_REQUEST_FRAME_EXTENTS", "_KDE_NET_WM_FRAME_STRUT", "_WIN_SUPPORTING_WM_CHECK", "_NET_SUPPORTING_WM_CHECK", "_NET_DESKTOP_NAMES", "_NET_CURRENT_DESKTOP", "_NET_NUMBER_OF_DESKTOPS", "_NET_CLIENT_LIST_STACKING", "_NET_ACTIVE_WINDOW", "_WIN_LAYER", "_WINDOWMAKER_WM_PROTOCOLS", "_WINDOWMAKER_NOTICEBOARD", "_WINDOWMAKER_ICON_TILE", "_WINDOWMAKER_WM_FUNCTION", "_RGBA_IMAGE", "_GNUSTEP_WM_MINIATURIZE_WINDOW", "_GNUSTEP_WM_HIDE_APP", "_GNUSTEP_WM_ATTR", "_GNUSTEP_TITLEBAR_STATE", "_GNUSTEP_FRAME_OFFSETS", "WM_IGNORE_FOCUS_EVENTS" }; /* * Macros to access elements in atom_names array. */ #define TEXT_ATOM atoms[0] #define UTF8_STRING_ATOM atoms[1] #define WM_PROTOCOLS_ATOM atoms[2] #define WM_TAKE_FOCUS_ATOM atoms[3] #define WM_DELETE_WINDOW_ATOM atoms[4] #define WM_STATE_ATOM atoms[5] #define _NET_WM_PING_ATOM atoms[6] #define _NET_WM_SYNC_REQUEST_ATOM atoms[7] #define _NET_WM_SYNC_REQUEST_COUNTER_ATOM atoms[8] #define _NET_WM_WINDOW_TYPE_ATOM atoms[9] #define _NET_WM_WINDOW_TYPE_DESKTOP_ATOM atoms[10] #define _NET_WM_WINDOW_TYPE_DOCK_ATOM atoms[11] #define _NET_WM_WINDOW_TYPE_TOOLBAR_ATOM atoms[12] #define _NET_WM_WINDOW_TYPE_MENU_ATOM atoms[13] #define _NET_WM_WINDOW_TYPE_DIALOG_ATOM atoms[14] #define _NET_WM_WINDOW_TYPE_NORMAL_ATOM atoms[15] #define _NET_WM_WINDOW_TYPE_UTILITY_ATOM atoms[16] #define _NET_WM_WINDOW_TYPE_SPLASH_ATOM atoms[17] #define _NET_WM_WINDOW_TYPE_POPUP_MENU_ATOM atoms[18] #define _NET_WM_WINDOW_TYPE_DROPDOWN_MENU_ATOM atoms[19] #define _NET_WM_WINDOW_TYPE_TOOLTIP_ATOM atoms[20] #define _NET_WM_WINDOW_TYPE_NOTIFICATION_ATOM atoms[21] #define _NET_WM_WINDOW_TYPE_COMBO_ATOM atoms[22] #define _NET_WM_WINDOW_TYPE_DND_ATOM atoms[23] #define _KDE_NET_WM_WINDOW_TYPE_OVERRIDE_ATOM atoms[24] #define _NET_WM_STATE_ATOM atoms[25] #define _NET_WM_STATE_MODAL_ATOM atoms[26] #define _NET_WM_STATE_STICKY_ATOM atoms[27] #define _NET_WM_STATE_MAXIMIZED_VERT_ATOM atoms[28] #define _NET_WM_STATE_MAXIMIZED_HORZ_ATOM atoms[29] #define _NET_WM_STATE_SHADED_ATOM atoms[30] #define _NET_WM_STATE_SKIP_TASKBAR_ATOM atoms[31] #define _NET_WM_STATE_SKIP_PAGER_ATOM atoms[32] #define _NET_WM_STATE_HIDDEN_ATOM atoms[33] #define _NET_WM_STATE_FULLSCREEN_ATOM atoms[34] #define _NET_WM_STATE_ABOVE_ATOM atoms[35] #define _NET_WM_STATE_BELOW_ATOM atoms[36] #define _NET_WM_STATE_DEMANDS_ATTENTION_ATOM atoms[37] #define _NET_WM_NAME_ATOM atoms[38] #define _NET_WM_PID_ATOM atoms[39] #define _NET_WM_ICON_ATOM atoms[40] #define _NET_WM_ICON_NAME_ATOM atoms[41] #define _NET_WM_DESKTOP_ATOM atoms[42] #define _NET_WM_WINDOW_SHADOW_ATOM atoms[43] #define _NET_WM_USER_TIME_ATOM atoms[44] #define _NET_WM_WINDOW_OPACITY_ATOM atoms[45] #define _MOTIF_WM_HINTS_ATOM atoms[46] #define _NET_SUPPORTED_ATOM atoms[47] #define _NET_FRAME_EXTENTS_ATOM atoms[48] #define _NET_REQUEST_FRAME_EXTENTS_ATOM atoms[49] #define _KDE_NET_WM_FRAME_STRUT_ATOM atoms[50] #define _WIN_SUPPORTING_WM_CHECK_ATOM atoms[51] #define _NET_SUPPORTING_WM_CHECK_ATOM atoms[52] #define _NET_DESKTOP_NAMES_ATOM atoms[53] #define _NET_CURRENT_DESKTOP_ATOM atoms[54] #define _NET_NUMBER_OF_DESKTOPS_ATOM atoms[55] #define _NET_CLIENT_LIST_STACKING_ATOM atoms[56] #define _NET_ACTIVE_WINDOW_ATOM atoms[57] #define _WIN_LAYER_ATOM atoms[58] #define _WINDOWMAKER_WM_PROTOCOLS_ATOM atoms[59] #define _WINDOWMAKER_NOTICEBOARD_ATOM atoms[60] #define _WINDOWMAKER_ICON_TILE_ATOM atoms[61] #define _WINDOWMAKER_WM_FUNCTION_ATOM atoms[62] #define _RGBA_IMAGE_ATOM atoms[63] #define _GNUSTEP_WM_MINIATURIZE_WINDOW_ATOM atoms[64] #define _GNUSTEP_WM_HIDE_APP_ATOM atoms[65] #define _GNUSTEP_WM_ATTR_ATOM atoms[66] #define _GNUSTEP_TITLEBAR_STATE_ATOM atoms[67] #define _GNUSTEP_FRAME_OFFSETS_ATOM atoms[68] #define WM_IGNORE_FOCUS_EVENTS_ATOM atoms[69] /* * Frame offsets for window inside parent decoration window. */ typedef struct { short l; // offset from left short r; // offset from right short t; // offset from top short b; // offset from bottom BOOL known; // obtained from Reparent event or just guessed? } Offsets; /* * Structure containing ivars that are common to all X backend contexts. */ struct XGGeneric { int wm; struct { unsigned useWindowMakerIcons:1; unsigned appOwnsMiniwindow:1; unsigned doubleParentWindow:1; } flags; // Time of last X event Time lastTime; // Approximate local time for last X event, used to decide // if the last X event time is still valid. NSTimeInterval lastTimeStamp; // last reference time on X server, used to prevent time drift between // local machine and X server. Time baseXServerTime; Time lastClick; Window lastClickWindow; int lastClickX; int lastClickY; Time lastMotion; // Name for application root window. char *rootName; long currentFocusWindow; long desiredFocusWindow; unsigned long focusRequestNumber; unsigned char lMouse; unsigned char mMouse; unsigned char rMouse; unsigned char upMouse; unsigned char downMouse; unsigned char scrollLeftMouse; unsigned char scrollRightMouse; int lMouseMask; int mMouseMask; int rMouseMask; Window appRootWindow; void *cachedWindow; // last gswindow_device_t used. Offsets offsets[16]; Atom atoms[sizeof(atom_names)/sizeof(char*)]; }; /* GNOME Window layers */ #define WIN_LAYER_DESKTOP 0 #define WIN_LAYER_BELOW 2 #define WIN_LAYER_NORMAL 4 #define WIN_LAYER_ONTOP 6 #define WIN_LAYER_DOCK 8 #define WIN_LAYER_ABOVE_DOCK 10 #define WIN_LAYER_MENU 12 /* NET WM State */ #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ #define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ #endif gnustep-back-0.29.0/Headers/x11/XGInputServer.h000066400000000000000000000045201404163720200210470ustar00rootroot00000000000000/* XGInputServer - Keyboard input handling Copyright (C) 2002 Free Software Foundation, Inc. Author: Adam Fedor Date: January 2002 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_XGInputServer #define _GNUstep_H_XGInputServer #include #include @protocol XInputFiltering - (BOOL) filterEvent: (XEvent *)event; - (NSString *) lookupStringForEvent: (XKeyEvent *)event window: (gswindow_device_t *)window keysym: (KeySym *)keysymptr; @end @interface XIMInputServer: NSInputServer { id delegate; NSString *server_name; XIM xim; XIMStyle xim_style; /* Track the XIC:s and destroy them explicitly to work around an XFree86 bug: http://www.xfree86.org/pipermail/xpert/2002-June/018370.html */ XIC *xics; int num_xics; } - (id) initWithDelegate: (id)aDelegate display: (Display *)dpy name: (NSString *)name; - (void) ximFocusICWindow: (gswindow_device_t *)windev; - (void) ximCloseIC: (XIC)xic; @end // Public interface for the input methods @interface XIMInputServer (InputMethod) - (NSString *) inputMethodStyle; - (NSString *) fontSize: (int *)size; - (BOOL) clientWindowRect: (NSRect *)rect; - (BOOL) statusArea: (NSRect *)rect; - (BOOL) preeditArea: (NSRect *)rect; - (BOOL) preeditSpot: (NSPoint *)p; - (BOOL) setStatusArea: (NSRect *)rect; - (BOOL) setPreeditArea: (NSRect *)rect; - (BOOL) setPreeditSpot: (NSPoint *)p; @end // XIMInputServer (InputMethod) #endif gnustep-back-0.29.0/Headers/x11/XGOpenGL.h000066400000000000000000000037001404163720200177040ustar00rootroot00000000000000/* -*-ObjC-*- */ /* XGOpenGL - openGL management using glX Copyright (C) 2002 Free Software Foundation, Inc. Author: Frederic De Jaeger Date: Nov 2002 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_XGOpenGL_ #define _GNUstep_H_XGOpenGL_ #include #define id _gs_avoid_id_collision #define BOOL XWINDOWSBOOL #include #undef id #undef BOOL @class NSView; @class XGXSubWindow; @class XGGLPixelFormat; @interface XGGLContext : NSOpenGLContext { int glxminorversion; GLXContext glx_context; GLXWindow glx_drawable; XGXSubWindow *xSubWindow; XGGLPixelFormat *pixelFormat; BOOL saved_ignores_backing; } - (GLXContext)glxcontext; @end @interface XGGLPixelFormat : NSOpenGLPixelFormat { Display * display; int glxminorversion; GLXFBConfig *fbconfig; int pickedFBConfig; int configurationCount; BOOL shouldRequestARGBVisual; XVisualInfo *visualinfo; } + (int) glxMinorVersion; - (Display *) display; - (XVisualInfo *) visualinfo; - (GLXContext) createGLXContext: (XGGLContext *)share; - (GLXWindow) drawableForWindow: (Window)xwindowid; @end #endif gnustep-back-0.29.0/Headers/x11/XGServer.h000066400000000000000000000070701404163720200200320ustar00rootroot00000000000000/* XGServer Backend server using the X11. Copyright (C) 2002-2015 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 2002 This file is part of the GNUstep Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XGServer_h_INCLUDE #define _XGServer_h_INCLUDE #include "config.h" #include #include #include #include #include "x11/XGGeneric.h" #ifdef HAVE_X11_EXTENSIONS_SYNC_H #include #endif /* * Enumerated type to say how we should draw pixels to the X display - used * to select different drawing mechanisms to try to optimise. */ typedef enum { XGDM_FAST15, XGDM_FAST16, XGDM_FAST32, XGDM_FAST32_BGR, XGDM_FAST8, XGDM_PORTABLE } XGDrawMechanism; typedef struct MonitorDevice { int screen_id; NSWindowDepth depth; NSSize resolution; NSRect frame; } MonitorDevice; @interface XGServer : GSDisplayServer { Display *dpy; int defScreen; NSSize xScreenSize; NSMapTable *screenList; Window grabWindow; struct XGGeneric generic; id inputServer; int randrEventBase; int randrErrorBase; MonitorDevice *monitors; unsigned monitorsCount; } + (Display *) xDisplay; - (Display *) xDisplay; - (Window) xDisplayRootWindow; - (Window) xAppRootWindow; - (NSSize) xScreenSize; - (void *) screenRContext; - (Visual *) screenVisual; - (int) screenDepth; - (XGDrawMechanism) screenDrawMechanism; - (void) getForScreen: (int)screen_number pixelFormat: (int *)bpp_number masks: (int *)red_mask : (int *)green_mask : (int *)blue_mask; - (XColor) xColorFromColor: (XColor)color; + (void) waitAllContexts; @end /* * Synchronize with X event queue - soak up events. * Waits for up to 1 second for event. */ @interface XGServer (XSync) - (BOOL) xSyncMap: (void*)window; @end @interface XGServer (XGGeneric) - (NSRect) _OSFrameToXFrame: (NSRect)o for: (void*)window; - (NSRect) _OSFrameToXHints: (NSRect)o for: (void*)window; - (NSRect) _XFrameToOSFrame: (NSRect)x for: (void*)window; - (NSRect) _XFrameToXHints: (NSRect)o for: (void*)window; - (NSString *) windowManagerName; @end // Public interface for the input methods. @interface XGServer (InputMethod) - (NSString *) inputMethodStyle; - (NSString *) fontSize: (int *)size; - (BOOL) clientWindowRect: (NSRect *)rect; - (BOOL) statusArea: (NSRect *)rect; - (BOOL) preeditArea: (NSRect *)rect; - (BOOL) preeditSpot: (NSPoint *)p; - (BOOL) setStatusArea: (NSRect *)rect; - (BOOL) setPreeditArea: (NSRect *)rect; - (BOOL) setPreeditSpot: (NSPoint *)p; @end @interface XGServer (TimeKeeping) - (void) setLastTime: (Time)last; - (Time) lastTime; @end #endif /* _XGServer_h_INCLUDE */ gnustep-back-0.29.0/Headers/x11/XGServerWindow.h000066400000000000000000000135321404163720200212220ustar00rootroot00000000000000/* Window ops for X11 server Copyright (C) 1999-2015 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1999 This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XGServerWindow_h_INCLUDE #define _XGServerWindow_h_INCLUDE #define BOOL XWINDOWSBOOL // prevent X windows BOOL #include // warning #undef BOOL #include /* * WindowMaker window manager interaction * * NB. Despite the fact that all the fields in this table are notionally * 32bit values (WindowMaker defines them as CARD32 and Pixmap types and * the X protocol spec says Pixmap is 32bits) they actually all have to be * long values (64bits on a 64bit processor). This is because of a bug in * X-windows property functions, such that they assume that where property * data is specified as 32bit it is actually a long. * The X headers automatically adjust the size of a Pixmap to be that of * a long, so we can declare Pixmap fields to be that size, but we must * explicitly use 'unsigned long' rather than CARD32 foir the others. */ typedef struct { unsigned long flags; unsigned long window_style; unsigned long window_level; unsigned long reserved; Pixmap miniaturize_pixmap; // pixmap for miniaturize button Pixmap close_pixmap; // pixmap for close button Pixmap miniaturize_mask; // miniaturize pixmap mask Pixmap close_mask; // close pixmap mask unsigned long extra_flags; } GNUstepWMAttributes; #define GSWindowStyleAttr (1<<0) #define GSWindowLevelAttr (1<<1) #define GSMiniaturizePixmapAttr (1<<3) #define GSClosePixmapAttr (1<<4) #define GSMiniaturizeMaskAttr (1<<5) #define GSCloseMaskAttr (1<<6) #define GSExtraFlagsAttr (1<<7) #define GSDocumentEditedFlag (1<<0) #define GSWindowWillResizeNotificationsFlag (1<<1) #define GSWindowWillMoveNotificationsFlag (1<<2) #define GSNoApplicationIconFlag (1<<5) #define WMFHideOtherApplications 10 #define WMFHideApplication 12 #define GSMaxWMProtocols 6 /* Graphics Driver protocol. Setup in [NSGraphicsContext-contextDevice:] */ enum { GDriverHandlesBacking = 1, GDriverHandlesExpose = 2 }; typedef struct _gswindow_device_t { Display *display; /* Display this window is on */ Window ident; /* Window handle */ Window root; /* Handle of root window */ Window parent; /* Handle of parent window */ int screen_id; /* Screeen this window is on */ int monitor_id; /* Physical monitor this window is on */ GC gc; /* GC for drawing */ long number; /* Globally unique identifier */ unsigned int depth; /* Window depth */ unsigned int border; /* Border size */ int map_state; /* X map state */ int visibility; /* X visibility */ int wm_state; /* X WM state */ NSBackingStoreType type; /* Backing type */ NSRect xframe; /* Window frame in X11 coordinates */ NSRect osframe; /* Window frame in OpenStep coordinates */ unsigned int buffer_width; /* Size in pixels of the current buffers. */ unsigned int buffer_height; Drawable buffer; /* Backing store pixmap */ Drawable alpha_buffer; /* Alpha buffer. Managed by gdriver will be freed if HandlesBacking=0 */ BOOL is_exposed; NSMutableArray *exposedRects; /* List of exposure event rects */ Region region; /* Used between several expose events */ XWMHints gen_hints; XSizeHints siz_hints; GNUstepWMAttributes win_attrs; XSetWindowAttributes xwn_attrs; int xoff; int yoff; int boff; Atom protocols[GSMaxWMProtocols]; int numProtocols; XIC ic; void *gdriver; /* gdriver ident. Managed by gdriver */ int gdriverProtocol; /* Managed by gdriver */ BOOL ignore_take_focus; #ifdef HAVE_X11_EXTENSIONS_SYNC_H uint32_t net_wm_sync_request_counter_value_low; uint32_t net_wm_sync_request_counter_value_high; XSyncCounter net_wm_sync_request_counter; #endif } gswindow_device_t; #define GET_XDRAWABLE(win) ((win)->buffer ? (win)->buffer: (win)->ident) @interface XGServer (DPSWindow) + (gswindow_device_t *) _windowForXWindow: (Window)xWindow; + (gswindow_device_t *) _windowForXParent: (Window)xWindow; + (gswindow_device_t *) _windowWithTag: (int)windowNumber; - (void) _addExposedRectangle: (XRectangle)rectangle : (int)win : (BOOL) ignoreBacking; - (void) _processExposedRectangles: (int)win; - (void) _initializeCursorForXWindow: (Window) win; - (void) _destroyServerWindows; /* This needs to go in GSDisplayServer */ - (void) _DPSsetcursor: (Cursor)c : (BOOL)set; - (int) _wm_state: (Window) win; - (BOOL) _ewmh_isHidden: (Window) win; @end extern Pixmap xgps_cursor_mask(Display *xdpy, Drawable draw, const unsigned char *data, int w, int h, int colors); #endif gnustep-back-0.29.0/Headers/x11/XWindowBuffer.h000066400000000000000000000105141404163720200210530ustar00rootroot00000000000000/* Copyright (C) 2002, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XWindowBuffer_h #define XWindowBuffer_h #include #ifdef XSHM #include #else // FIXME #define XShmSegmentInfo int #endif struct XWindowBuffer_depth_info_s { /* The drawing depth according to X. Usually the number of bits of color data in each pixel. */ int drawing_depth; /* The number of bytes used by a pixel. There is generally no relationship between this and drawing_depth, except that bytes_per_pixel*8>=drawing_depth. (Eg. 32-bit modes usually have a drawing depth of 24.) */ int bytes_per_pixel; /* If alpha is to be stored inside the normal data, this should be YES. Otherwise, a separate buffer will be allocated for the alpha data (which never does any harm, but it wastes memory if there's enough space in a pixel, as in 32-bit modes. There needs to be 8 bits available for alpha data at a byte boundary for this to work, though. (This could be fixed, but in the mean time, just setting inline_alpha to NO is easier.) inline_alpha_ofs should be the offset to the byte in each pixel that holds the alpha value. */ BOOL inline_alpha; int inline_alpha_ofs; /* The byte order used for the buffer. This must be either MSBFirst or LSBFirst. */ int byte_order; }; /* XWindowBuffer maintains an XImage for a window. Each ARTGState that renders to that window uses the same XWindowBuffer (and thus the same buffer, etc.). Many states might render to the same window, so we need to make sure that there's only one XWindowBuffer for each window. */ @interface XWindowBuffer : NSObject { @public gswindow_device_t *window; @private GC gc; Drawable drawable; XImage *ximage; Display *display; Pixmap pixmap; int use_shm; XShmSegmentInfo shminfo; struct XWindowBuffer_depth_info_s DI; /* While a XShmPutImage is in progress we don't try to call it again. The pending updates are stored here, and when we get the ShmCompletion event, we handle them. */ int pending_put; /* There are pending updates */ struct { int x, y, w, h; } pending_rect; /* in this rectangle. */ int pending_event; /* We're waiting for the ShmCompletion event. */ /* This is for the ugly shape-hack */ unsigned char *old_shape; int old_shape_size; @public unsigned char *data; int sx, sy; int bytes_per_line, bits_per_pixel, bytes_per_pixel; /* If has_alpha is 1 and alpha is NULL, the alpha is stored in data somehow. The drawing mechanism code should know how to deal with it. A separate alpha buffer will always be exactly the right size, so each row is sx bytes long. If has_alpha is 0, the window is assumed to be completely opaque. */ unsigned char *alpha; int has_alpha; } /* Returns a _retained_ XWindowBuffer for the specified gswindow_device_t. The depth info is only used if a new XWindowBuffer needs to be allocated. */ + windowBufferForWindow: (gswindow_device_t *)awindow depthInfo: (struct XWindowBuffer_depth_info_s *)aDI; /* Note that alpha is _not_ guaranteed to exist after this has been called; you still need to check has_alpha. If the call fails, a message will be logged. (In ARTGState, I handle failures by simply ignoring the operation that required alpha.) The alpha channel is initialized to being completely opaque when first created. */ -(void) needsAlpha; -(void) _gotShmCompletion; -(void) _exposeRect: (NSRect)r; +(void) _gotShmCompletion: (Drawable)d; @end #endif gnustep-back-0.29.0/Headers/x11/wraster.h000066400000000000000000000272171404163720200200210ustar00rootroot00000000000000/* * Raster graphics library * * Copyright (c) 1997-2002 Alfredo K. Kojima * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Environment variables: * * WRASTER_GAMMA // * gamma correction value. Must be greater than 0 * Only for PseudoColor visuals. * * Default: * WRASTER_GAMMA 1/1/1 * * * If you want a specific value for a screen, append the screen number * preceded by a hash to the variable name as in * WRASTER_GAMMA#1 * for screen number 1 */ #ifndef RLRASTER_H_ #define RLRASTER_H_ /* version of the header for the library: 0.21 */ #define WRASTER_HEADER_VERSION 21 #include #include #ifdef XSHM #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* RBestMatchRendering or RDitheredRendering */ #define RC_RenderMode (1<<0) /* number of colors per channel for colormap in PseudoColor mode */ #define RC_ColorsPerChannel (1<<1) /* do gamma correction */ #define RC_GammaCorrection (1<<2) /* visual id to use */ #define RC_VisualID (1<<3) /* shared memory usage */ #define RC_UseSharedMemory (1<<4) /* use default instead of best visual */ #define RC_DefaultVisual (1<<5) /* filter type for smoothed scaling */ #define RC_ScalingFilter (1<<6) /* standard colormap usage */ #define RC_StandardColormap (1<<7) /* std colormap usage/creation modes */ enum { RUseStdColormap, /* default. fallbacks to RIgnore.. if there is none defined */ RCreateStdColormap, RIgnoreStdColormap }; typedef struct RContextAttributes { int flags; int render_mode; int colors_per_channel; /* for PseudoColor */ float rgamma; /* gamma correction for red, */ float ggamma; /* green, */ float bgamma; /* and blue */ VisualID visualid; /* visual ID to use */ int use_shared_memory; /* True of False */ int scaling_filter; int standard_colormap_mode; /* what to do with std cma */ } RContextAttributes; /* * describes a screen in terms of depth, visual, number of colors * we can use, if we should do dithering, and what colors to use for * dithering. */ typedef struct RContext { Display *dpy; int screen_number; Colormap cmap; RContextAttributes *attribs; GC copy_gc; Visual *visual; int depth; Window drawable; /* window to pass for XCreatePixmap().*/ /* generally = root */ int vclass; unsigned long black; unsigned long white; int red_offset; /* only used in 24bpp */ int green_offset; int blue_offset; /* only used for pseudocolor and grayscale */ XStandardColormap *std_rgb_map; /* standard RGB colormap */ XStandardColormap *std_gray_map; /* standard grayscale colormap */ int ncolors; /* total number of colors we can use */ XColor *colors; /* internal colormap */ unsigned long *pixels; /* RContext->colors[].pixel */ struct { unsigned int use_shared_pixmap:1; unsigned int optimize_for_speed:1; } flags; struct RHermesData *hermes_data; /* handle for Hermes stuff */ } RContext; typedef struct RColor { unsigned char red; unsigned char green; unsigned char blue; unsigned char alpha; } RColor; typedef struct RHSVColor { unsigned short hue; /* 0-359 */ unsigned char saturation; /* 0-255 */ unsigned char value; /* 0-255 */ } RHSVColor; typedef struct RPoint { int x, y; } RPoint; typedef struct RSegment { int x1, y1, x2, y2; } RSegment; /* image formats */ enum RImageFormat { RRGBFormat, RRGBAFormat }; /* * internal 24bit+alpha image representation */ typedef struct RImage { unsigned char *data; /* image data RGBA or RGB */ int width, height; /* size of the image */ enum RImageFormat format; RColor background; /* background color */ int refCount; } RImage; /* * internal wrapper for XImage. Used for shm abstraction */ typedef struct RXImage { XImage *image; /* Private data. Do not access */ #ifdef XSHM XShmSegmentInfo info; char is_shared; #endif } RXImage; /* image display modes */ enum { RDitheredRendering = 0, RBestMatchRendering = 1 }; /* smoothed scaling filter types */ enum { RBoxFilter, RTriangleFilter, RBellFilter, RBSplineFilter, RLanczos3Filter, RMitchellFilter }; /* note that not all operations are supported in all functions */ enum { RClearOperation, /* clear with 0 */ RCopyOperation, RNormalOperation, /* same as combine */ RAddOperation, RSubtractOperation }; enum { RAbsoluteCoordinates = 0, RRelativeCoordinates = 1 }; enum { RSunkenBevel = -1, RNoBevel = 0, RRaisedBevel = 1 }; /* bw compat */ #define RBEV_SUNKEN RSunkenBevel /* 1 pixel wide */ #define RBEV_RAISED RRaisedBevel /* 1 pixel wide on top/left 2 on bottom/right */ #define RBEV_RAISED2 2 /* 2 pixel width */ #define RBEV_RAISED3 3 enum { RHorizontalGradient = 2, RVerticalGradient = 3, RDiagonalGradient = 4 }; /* for backwards compatibility */ #define RGRD_HORIZONTAL RHorizontalGradient #define RGRD_VERTICAL RVerticalGradient #define RGRD_DIAGONAL RDiagonalGradient /* error codes */ #define RERR_NONE 0 #define RERR_OPEN 1 /* cant open file */ #define RERR_READ 2 /* error reading from file */ #define RERR_WRITE 3 /* error writing to file */ #define RERR_NOMEMORY 4 /* out of memory */ #define RERR_NOCOLOR 5 /* out of color cells */ #define RERR_BADIMAGEFILE 6 /* image file is corrupted or invalid */ #define RERR_BADFORMAT 7 /* image file format is unknown */ #define RERR_BADINDEX 8 /* no such image index in file */ #define RERR_BADVISUALID 16 /* invalid visual ID requested for context */ #define RERR_STDCMAPFAIL 17 /* failed to created std colormap */ #define RERR_XERROR 127 /* internal X error */ #define RERR_INTERNAL 128 /* should not happen */ /* * Returns a NULL terminated array of strings containing the * supported formats, such as: TIFF, XPM, PNG, JPEG, PPM, GIF * Do not free the returned data. */ char **RSupportedFileFormats(void); char *RGetImageFileFormat(char *file); /* * Xlib contexts */ RContext *RCreateContext(Display *dpy, int screen_number, RContextAttributes *attribs); void RDestroyContext(RContext *context); Bool RGetClosestXColor(RContext *context, RColor *color, XColor *retColor); /* * RImage creation */ RImage *RCreateImage(unsigned width, unsigned height, int alpha); RImage *RCreateImageFromXImage(RContext *context, XImage *image, XImage *mask); RImage *RCreateImageFromDrawable(RContext *context, Drawable drawable, Pixmap mask); RImage *RLoadImage(RContext *context, char *file, int index); RImage* RRetainImage(RImage *image); void RReleaseImage(RImage *image); /* Obsoleted function. Use RReleaseImage() instead. This was kept only to * allow a smoother transition and to avoid breaking existing programs, but * it will be removed in a future release. Right now is just an alias to * RReleaseImage(). Do _NOT_ use RDestroyImage() anymore in your programs. * Being an alias to RReleaseImage() this function no longer actually * destroys the image, unless the image is no longer retained in some other * place. */ void RDestroyImage(RImage *image); RImage *RGetImageFromXPMData(RContext *context, char **xpmData); /* * RImage storing */ Bool RSaveImage(RImage *image, char *filename, char *format); /* * Area manipulation */ RImage *RCloneImage(RImage *image); RImage *RGetSubImage(RImage *image, int x, int y, unsigned width, unsigned height); void RCombineImageWithColor(RImage *image, RColor *color); void RCombineImages(RImage *image, RImage *src); void RCombineArea(RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy); void RCombineImagesWithOpaqueness(RImage *image, RImage *src, int opaqueness); void RCombineAreaWithOpaqueness(RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy, int opaqueness); RImage *RScaleImage(RImage *image, unsigned new_width, unsigned new_height); RImage *RSmoothScaleImage(RImage *src, unsigned new_width, unsigned new_height); RImage *RRotateImage(RImage *image, float angle); RImage *RMakeTiledImage(RImage *tile, unsigned width, unsigned height); RImage* RMakeCenteredImage(RImage *image, unsigned width, unsigned height, RColor *color); /* * Drawing */ Bool RGetPixel(RImage *image, int x, int y, RColor *color); void RPutPixel(RImage *image, int x, int y, RColor *color); void ROperatePixel(RImage *image, int operation, int x, int y, RColor *color); void RPutPixels(RImage *image, RPoint *points, int npoints, int mode, RColor *color); void ROperatePixels(RImage *image, int operation, RPoint *points, int npoints, int mode, RColor *color); int RDrawLine(RImage *image, int x0, int y0, int x1, int y1, RColor *color); int ROperateLine(RImage *image, int operation, int x0, int y0, int x1, int y1, RColor *color); void RDrawLines(RImage *image, RPoint *points, int npoints, int mode, RColor *color); void ROperateLines(RImage *image, int operation, RPoint *points, int npoints, int mode, RColor *color); void RDrawSegments(RImage *image, RSegment *segs, int nsegs, RColor *color); void ROperateSegments(RImage *image, int operation, RSegment *segs, int nsegs, RColor *color); /* * Color convertion */ void RRGBtoHSV(RColor *color, RHSVColor *hsv); void RHSVtoRGB(RHSVColor *hsv, RColor *rgb); /* * Painting */ void RClearImage(RImage *image, RColor *color); void RFillImage(RImage *image, RColor *color); void RBevelImage(RImage *image, int bevel_type); RImage *RRenderGradient(unsigned width, unsigned height, RColor *from, RColor *to, int style); RImage *RRenderMultiGradient(unsigned width, unsigned height, RColor **colors, int style); RImage *RRenderInterwovenGradient(unsigned width, unsigned height, RColor colors1[2], int thickness1, RColor colors2[2], int thickness2); /* * Convertion into X Pixmaps */ int RConvertImage(RContext *context, RImage *image, Pixmap *pixmap); int RConvertImageMask(RContext *context, RImage *image, Pixmap *pixmap, Pixmap *mask, int threshold); /* * misc. utilities */ RXImage *RCreateXImage(RContext *context, int depth, unsigned width, unsigned height); RXImage *RGetXImage(RContext *context, Drawable d, int x, int y, unsigned width, unsigned height); void RDestroyXImage(RContext *context, RXImage *ximage); void RPutXImage(RContext *context, Drawable d, GC gc, RXImage *ximage, int src_x, int src_y, int dest_x, int dest_y, unsigned width, unsigned height); /* do not free the returned string! */ const char *RMessageForError(int errorCode); int RBlurImage(RImage *image); /****** Global Variables *******/ extern int RErrorCode; #ifdef __cplusplus } #endif /* __cplusplus */ #endif gnustep-back-0.29.0/Headers/x11/xdnd.h000066400000000000000000000130221404163720200172540ustar00rootroot00000000000000/* xdnd.c, xdnd.h - C program library for handling the Xdnd protocol Copyright (C) 1998 Paul Sheer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Further info can also be obtained by emailing the author at, psheer@obsidian.co.za */ #ifndef _X_DND_H #define _X_DND_H #define XDND_VERSION 2 /* XdndEnter */ #define XDND_THREE 3 #define XDND_ENTER_SOURCE_WIN(e) ((e)->xclient.data.l[0]) #define XDND_ENTER_THREE_TYPES(e) (((e)->xclient.data.l[1] & 0x1UL) == 0) #define XDND_ENTER_THREE_TYPES_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x1UL) | (((b) == 0) ? 0 : 0x1UL) #define XDND_ENTER_VERSION(e) ((e)->xclient.data.l[1] >> 24) #define XDND_ENTER_VERSION_SET(e,v) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~(0xFF << 24)) | ((v) << 24) #define XDND_ENTER_TYPE(e,i) ((e)->xclient.data.l[2 + i]) /* i => (0, 1, 2) */ /* XdndPosition */ #define XDND_POSITION_SOURCE_WIN(e) ((e)->xclient.data.l[0]) #define XDND_POSITION_ROOT_X(e) ((e)->xclient.data.l[2] >> 16) #define XDND_POSITION_ROOT_Y(e) ((e)->xclient.data.l[2] & 0xFFFFUL) #define XDND_POSITION_ROOT_SET(e,x,y) (e)->xclient.data.l[2] = ((x) << 16) | ((y) & 0xFFFFUL) #define XDND_POSITION_TIME(e) ((e)->xclient.data.l[3]) #define XDND_POSITION_ACTION(e) ((e)->xclient.data.l[4]) /* XdndStatus */ #define XDND_STATUS_TARGET_WIN(e) ((e)->xclient.data.l[0]) #define XDND_STATUS_WILL_ACCEPT(e) ((e)->xclient.data.l[1] & 0x1L) #define XDND_STATUS_WILL_ACCEPT_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x1UL) | (((b) == 0) ? 0 : 0x1UL) #define XDND_STATUS_WANT_POSITION(e) ((e)->xclient.data.l[1] & 0x2UL) #define XDND_STATUS_WANT_POSITION_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x2UL) | (((b) == 0) ? 0 : 0x2UL) #define XDND_STATUS_RECT_X(e) ((e)->xclient.data.l[2] >> 16) #define XDND_STATUS_RECT_Y(e) ((e)->xclient.data.l[2] & 0xFFFFL) #define XDND_STATUS_RECT_WIDTH(e) ((e)->xclient.data.l[3] >> 16) #define XDND_STATUS_RECT_HEIGHT(e) ((e)->xclient.data.l[3] & 0xFFFFL) #define XDND_STATUS_RECT_SET(e,x,y,w,h) {(e)->xclient.data.l[2] = ((x) << 16) | ((y) & 0xFFFFUL); (e)->xclient.data.l[3] = ((w) << 16) | ((h) & 0xFFFFUL); } #define XDND_STATUS_ACTION(e) ((e)->xclient.data.l[4]) /* XdndLeave */ #define XDND_LEAVE_SOURCE_WIN(e) ((e)->xclient.data.l[0]) /* XdndDrop */ #define XDND_DROP_SOURCE_WIN(e) ((e)->xclient.data.l[0]) #define XDND_DROP_TIME(e) ((e)->xclient.data.l[2]) /* XdndFinished */ #define XDND_FINISHED_TARGET_WIN(e) ((e)->xclient.data.l[0]) typedef struct _DndClass DndClass; struct _DndClass { Display *display; Atom XdndAware; Atom XdndSelection; Atom XdndEnter; Atom XdndLeave; Atom XdndPosition; Atom XdndDrop; Atom XdndFinished; Atom XdndStatus; Atom XdndActionCopy; Atom XdndActionMove; Atom XdndActionLink; Atom XdndActionAsk; Atom XdndActionPrivate; Atom XdndTypeList; Atom XdndActionList; Atom XdndActionDescription; Atom Xdnd_NON_PROTOCOL_ATOM; Atom version; Window root_window; #define XDND_DROP_STAGE_IDLE 0 #define XDND_DRAG_STAGE_DRAGGING 1 #define XDND_DRAG_STAGE_ENTERED 2 #define XDND_DROP_STAGE_CONVERTING 3 #define XDND_DROP_STAGE_ENTERED 4 int stage; int dragging_version; int internal_drag; int want_position; int ready_to_drop; int will_accept; XRectangle rectangle; Window dropper_window, dragger_window; Atom *dragger_typelist; Atom desired_type; Atom supported_action; Time time; /* drop position from last XdndPosition */ int x, y; /* block for only this many seconds on not receiving a XdndFinished from target, default : 10 */ int time_out; }; void xdnd_init (DndClass * dnd, Display * display); void xdnd_set_dnd_aware (DndClass * dnd, Window window, Atom * typelist); int xdnd_is_dnd_aware (DndClass * dnd, Window window, int *version, Atom * typelist); void xdnd_set_type_list (DndClass * dnd, Window window, Atom * typelist); void xdnd_get_type_list (DndClass * dnd, Window window, Atom ** typelist); void xdnd_send_enter (DndClass * dnd, Window window, Window from, Atom * typelist); void xdnd_send_position (DndClass * dnd, Window window, Window from, Atom action, int x, int y, unsigned long etime); void xdnd_send_status (DndClass * dnd, Window window, Window from, int will_accept, int want_position, int x, int y, int w, int h, Atom action); void xdnd_send_leave (DndClass * dnd, Window window, Window from); void xdnd_send_drop (DndClass * dnd, Window window, Window from, unsigned long etime); void xdnd_send_finished (DndClass * dnd, Window window, Window from, int error); int xdnd_convert_selection (DndClass * dnd, Window window, Window requester, Atom type); int xdnd_set_selection_owner (DndClass * dnd, Window window, Atom type); void xdnd_selection_send (DndClass * dnd, XSelectionRequestEvent * request, unsigned char *data, int length); #endif /* !_X_DND_H */ gnustep-back-0.29.0/Headers/xdps/000077500000000000000000000000001404163720200165155ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/xdps/NSDPSContext.h000066400000000000000000000066251404163720200211330ustar00rootroot00000000000000/* NSDPSContext.h Encapsulation of Display Postscript contexts Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDPSContext #define _GNUstep_H_NSDPSContext /* Define this to avoid including redefinitions of ps functions introduced by NSGraphicsContext */ #define _PSOperators_h_INCLUDE #define BOOL XWINDOWSBOOL // prevent X windows BOOL #include // warning #undef BOOL #include #include #include #include #include #include #include #include #include typedef enum { ALPHAIMAGE_EXT = 1, COMPOSITE_EXT = 2, COMPOSITERECT_EXT = 4, DISSOLVE_EXT = 8, READIMAGE_EXT = 16, SETALPHA_EXT = 32, FLUSHPAGE_EXT = 64 } op_extensions_t; @class NSData; @class NSMutableData; @class NSAffineTransform; @class GSDisplayServer; // // NSDPSContext class interface // @interface NSDPSContext : NSGraphicsContext { DPSContext dps_context; BOOL is_screen_context; DPSErrorProc error_proc; DPSTextProc text_proc; NSDPSContext *chained_parent; NSDPSContext *chained_child; BOOL is_output_traced; BOOL is_synchronized; float ctm[6], invctm[6]; int dps_revision; op_extensions_t ext_flags; NSDPSContext *next_context; GSDisplayServer *server; @public void *context; } - (void)wait; // // Managing Returned Text and Errors // + (NSString *)stringForDPSError:(const DPSBinObjSeqRec *)error; - (DPSErrorProc)errorProc; - (void)setErrorProc:(DPSErrorProc)proc; - (void)setTextProc:(DPSTextProc)proc; - (DPSTextProc)textProc; // // Managing Chained Contexts // - (void)chainChildContext:(NSDPSContext *)child; - (NSDPSContext *)childContext; - (NSDPSContext *)parentContext; - (void)unchainContext; // // Debugging Aids // + (BOOL)areAllContextsOutputTraced; + (BOOL)areAllContextsSynchronized; + (void)setAllContextsOutputTraced:(BOOL)flag; + (void)setAllContextsSynchronized:(BOOL)flag; - (BOOL)isOutputTraced; - (BOOL)isSynchronized; - (void)setOutputTraced:(BOOL)flag; - (void)setSynchronized:(BOOL)flag; @end @interface NSDPSContext (GNUstepXDPS) - (Display *)xDisplay; - (DPSContext)xDPSContext; - (void *)xrContext; - (NSPoint) userPointFromXPoint: (NSPoint)xPoint; - (NSPoint) XPointFromUserPoint: (NSPoint)userPoint; - (NSRect) userRectFromXRect: (NSRect)xrect; - (NSRect) XRectFromUserRect: (NSRect)urect; - (op_extensions_t) operatorExtensions; @end #endif /* _GNUstep_H_NSDPSContext */ gnustep-back-0.29.0/Headers/xlib/000077500000000000000000000000001404163720200164755ustar00rootroot00000000000000gnustep-back-0.29.0/Headers/xlib/GSXftFontInfo.h000066400000000000000000000036051404163720200213100ustar00rootroot00000000000000/* GSXftFontInfo NSFont helper for GNUstep GUI X/GPS Backend Copyright (C) 1996 Free Software Foundation, Inc. Author: Fred Kiefer Date: July 2001 This file is part of the GNUstep GUI X/GPS Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Include this before we include any objC defines, otherwise id is defined #include #define id xwindowsid #include #undef id #import "fontconfig/FCFontInfo.h" #import "fontconfig/FCFontEnumerator.h" @interface GSXftFaceInfo : FCFaceInfo @end @interface GSXftFontEnumerator : FCFontEnumerator + (Class) faceInfoClass; + (GSXftFaceInfo *) fontWithName: (NSString *)name; @end @interface GSXftFontInfo : FCFontInfo { XftFont *font_info; } - (void) drawString: (NSString*)string onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp; - (void) draw: (const char*) s length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp; - (CGFloat) widthOf: (const char*) s length: (int) len; - (void) setActiveFor: (Display*) xdpy gc: (GC) xgcntxt; @end gnustep-back-0.29.0/Headers/xlib/XGContext.h000066400000000000000000000023521404163720200205330ustar00rootroot00000000000000/* XGContext Backend drawing context using the Xlib library. Copyright (C) 1995 Free Software Foundation, Inc. Written By: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XGContext_h_INCLUDE #define _XGContext_h_INCLUDE #include "gsc/GSContext.h" @interface XGContext : GSContext { } @end #endif /* _XGContext_h_INCLUDE */ gnustep-back-0.29.0/Headers/xlib/XGFontSetFontInfo.h000066400000000000000000000047271404163720200221440ustar00rootroot00000000000000/* XGFontSetFontInfo NSFont helper for GNUstep X/GPS Backend Copyright (C) 2003-2005 Free Software Foundation, Inc. Author: Kazunobu Kuriyama Date: July 2003 This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __XGFontSetFontInfo_h #define __XGFontSetFontInfo_h #include #import #ifdef X_HAVE_UTF8_STRING #if 0 // Commented out till the implementation completes. // ---------------------------------------------------------------------------- // XGFontSetEnumerator // ---------------------------------------------------------------------------- @interface XGFontSetEnumerator : GSFontEnumerator { } - (void) enumerateFontsAndFamilies; @end // XGFontSetEnumerator : GSFontEnumerator #endif // #if 0 // ---------------------------------------------------------------------------- // XGFontSetFontInfo // ---------------------------------------------------------------------------- @interface XGFontSetFontInfo : GSFontInfo { XFontSet _font_set; XFontStruct **_fonts; int _num_fonts; } - (id) initWithFontName: (NSString*)name matrix: (const CGFloat*)matrix screenFont: (BOOL)screenFont; - (void) drawGlyphs: (const NSGlyph*)glyphs length: (int)len onDisplay: (Display*)dpy drawable: (Drawable)win with: (GC)gc at: (XPoint)xp; - (CGFloat) widthOfGlyphs: (const NSGlyph*)glyphs length: (int)len; - (void) setActiveFor: (Display*)dpy gc: (GC)gc; @end // XGFontSetFontInfo : GSFontInfo #endif // X_HAVE_UTF8_STRING defined #endif // __XGFontSetFontInfo_h gnustep-back-0.29.0/Headers/xlib/XGGState.h000066400000000000000000000047501404163720200203020ustar00rootroot00000000000000/* XGGState - Implements graphic state drawing for Xlib Copyright (C) 1995 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1995 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XGGState_h_INCLUDE #define _XGGState_h_INCLUDE #include #include #include "gsc/GSGState.h" #include #include #include "x11/XGServer.h" #ifdef HAVE_XFT #define id xwindowsid #include #undef id #endif @class NSBezierPath; @class NSFont; @interface XGGState : GSGState { @public void *context; void *windevice; XGDrawMechanism drawMechanism; GC xgcntxt; GC agcntxt; XGCValues gcv; Drawable draw; Drawable alpha_buffer; Region clipregion; #ifdef HAVE_XFT XftDraw *xft_draw; XftDraw *xft_alpha_draw; XftColor xft_color; #endif BOOL drawingAlpha; BOOL sharedGC; /* Do we own the GC or share it? */ } - (void) setWindowDevice: (void *)device; - (void) setGraphicContext: (GC)xGraphicContext; - (void) setGCValues: (XGCValues)values withMask: (int)mask; - (void) setClipMask; - (Region) xClipRegion; - (BOOL) hasDrawable; - (BOOL) hasGraphicContext; - (void *) windevice; - (Drawable) drawable; - (GC) graphicContext; - (NSRect) clipRect; #ifdef HAVE_XFT - (XftDraw *)xftDrawForDrawable: (Drawable)d; - (XftColor)xftColor; #endif - (XPoint) viewPointToX: (NSPoint)aPoint; - (XRectangle) viewRectToX: (NSRect)aRect; - (XPoint) windowPointToX: (NSPoint)aPoint; - (XRectangle) windowRectToX: (NSRect)aRect; @end @interface XGGState (Ops) - (NSDictionary *) GSReadRect: (NSRect)rect; @end #endif /* _XGGState_h_INCLUDE */ gnustep-back-0.29.0/Headers/xlib/XGGeometry.h000066400000000000000000000124401404163720200207010ustar00rootroot00000000000000/* -*- mode: ObjC -*- XGGeometry Point and rectangle manipulations for X-structures Copyright (C) 2001-2005 Free Software Foundation, Inc. Written by: woudshoo@xs4all.nl Date: Nov, 2001 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file implements the NSGeometry manipulation functions for the XPoint and XRectangle structures. So most code is copied from NSGeometry, with only the structs changed */ #ifndef _XGGeometry_h_INCLUDE #define _XGGeometry_h_INCLUDE #include #include #include "xlib/XGGState.h" #include "x11/XGServerWindow.h" XRectangle accessibleRectForWindow (gswindow_device_t *win); void clipXRectsForCopying (gswindow_device_t* winA, XRectangle* rectA, gswindow_device_t* winB, XRectangle* rectB); static inline XPoint XGMakePoint (short x, short y) { XPoint p; p.x = x; p.y = y; return p; } static inline XRectangle XGMakeRect (short x, short y, unsigned short w, unsigned short h) { XRectangle rect; rect.x = x; rect.y = y; rect.width = w; rect.height = h; return rect; } static inline short XGMinX (XRectangle aRect) { return aRect.x; } static inline short XGMinY (XRectangle aRect) { return aRect.y; } static inline short XGMaxX (XRectangle aRect) { return aRect.x + aRect.width; } static inline short XGMaxY (XRectangle aRect) { return aRect.y + aRect.height; } static inline short XGWidth (XRectangle aRect) { return aRect.width; } static inline short XGHeight (XRectangle aRect) { return aRect.height; } static inline XRectangle XGIntersectionRect (XRectangle aRect, XRectangle bRect) { if (XGMaxX (aRect) <= XGMinX (bRect) || XGMaxX (bRect) <= XGMinX (aRect) || XGMaxY (aRect) <= XGMinY (bRect) || XGMaxY (bRect) <= XGMinY (aRect)) { return XGMakeRect (0, 0, 0, 0); } else { XRectangle rect; if (XGMinX (aRect) <= XGMinX (bRect)) rect.x = bRect.x; else rect.x = aRect.x; if (XGMaxX (aRect) >= XGMaxX (bRect)) rect.width = XGMaxX (bRect) - rect.x; else rect.width = XGMaxX (aRect) - rect.x; if (XGMinY (aRect) <= XGMinY (bRect)) rect.y = bRect.y; else rect.y = aRect.y; if (XGMaxY (aRect) >= XGMaxY (bRect)) rect.height = XGMaxY (bRect) - rect.y; else rect.height = XGMaxY (aRect) - rect.y; return rect; } } static inline BOOL XGIsEmptyRect (XRectangle aRect) { if (aRect.width == 0 || aRect.height == 0) return YES; else return NO; } // Just in case this are not defined on a system #ifndef SHRT_MAX #define SHRT_MAX 32767 #endif #ifndef SHRT_MIN #define SHRT_MIN (-32768) #endif /* Quick floor using C casts . This casts to short as this is the type X uses for all geometry. */ static inline short gs_floor (float f) { if (f >= 0) { if (f > SHRT_MAX) return SHRT_MAX; else return (short)f; } else { if (f < SHRT_MIN) return SHRT_MIN; else { int g = (int)f; if (f - ((float)g) > 0) { return g - 1; } else { return g; } } } } /* * Inline functions to convert from OpenStep view coordinates or * OpenStep window coordinates to X window coordinates. */ static inline XPoint XGWindowPointToX (XGGState *s, NSPoint p) { XPoint newPoint; newPoint.x = gs_floor(p.x - s->offset.x); newPoint.y = gs_floor(s->offset.y - p.y); return newPoint; } static inline XRectangle XGWindowRectToX (XGGState *s, NSRect r) { XRectangle newRect; newRect.x = gs_floor(r.origin.x - s->offset.x); /* We gs_floor the extreme points, and get the width as the difference */ newRect.width = gs_floor(r.origin.x - s->offset.x + r.size.width) - newRect.x; newRect.y = gs_floor(s->offset.y - r.origin.y - r.size.height); newRect.height = gs_floor(s->offset.y - r.origin.y) - newRect.y; return newRect; } /* * Inline functions to convert from OpenStep view coordinates or * OpenStep window coordinates to X window coordinates. */ static inline XPoint XGViewPointToX(XGGState *s, NSPoint p) { p = [s->ctm transformPoint: p]; return XGWindowPointToX(s, p); } static inline XRectangle XGViewRectToX(XGGState *s, NSRect r) { r = [s->ctm rectInMatrixSpace: r]; return XGWindowRectToX(s, r); } #endif /* _XGGeometry_h_INCLUDE */ gnustep-back-0.29.0/Headers/xlib/XGPrivate.h000066400000000000000000000073431404163720200205260ustar00rootroot00000000000000/* XGPrivate.h Copyright (C) 2002 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 2002 This file is part of the GNUstep GUI X/GPS Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XGPrivate_h_INCLUDE #define _XGPrivate_h_INCLUDE #ifdef HAVE_WRASTER_H #include "wraster.h" #else #include "x11/wraster.h" #endif #include "x11/XGServer.h" #include "xlib/XGContext.h" #include /* Font function (defined in XGFontManager) */ extern NSString *XGXFontName(NSString *fontName, float size); /* Font functions (defined in XGCommonFont) */ extern NSString *XGFontCacheName(Display *dpy); extern NSString *XGFontName(Display *dpy, XFontStruct *font_struct); extern NSString *XGFontFamily(Display *dpy, XFontStruct *font_struct); extern float XGFontPointSize(Display *dpy, XFontStruct *font_struct); extern int XGWeightOfFont(Display *dpy, XFontStruct *info); extern NSFontTraitMask XGTraitsOfFont(Display *dpy, XFontStruct *info); extern BOOL XGFontIsFixedPitch(Display *dpy, XFontStruct *font_struct); extern NSString *XGFontPropString(Display *dpy, XFontStruct *font_struct, Atom atom); extern unsigned long XGFontPropULong(Display *dpy, XFontStruct *font_struct, Atom atom); @interface XGFontEnumerator : GSFontEnumerator { } @end @interface XGFontInfo : GSFontInfo { XFontStruct *font_info; } @end @interface GSFontInfo (XBackend) - (void) drawString: (NSString*)string onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp; - (void) draw: (const char*) s length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp; - (CGFloat) widthOf: (const char*) s length: (int) len; - (void) setActiveFor: (Display*) xdpy gc: (GC) xgcntxt; - (void) drawGlyphs: (const NSGlyph *) glyphs length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp; - (CGFloat) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len; @end /* In XGBitmap.m */ extern int _pixmap_combine_alpha(RContext *context, RXImage *source_im, RXImage *source_alpha, RXImage *dest_im, RXImage *dest_alpha, XRectangle srect, NSCompositingOperation op, XGDrawMechanism drawMechanism, float fraction); extern int _bitmap_combine_alpha(RContext *context, unsigned char * data_planes[5], int width, int height, int bits_per_sample, int samples_per_pixel, int bits_per_pixel, int bytes_per_row, int colour_space, BOOL one_is_black, BOOL is_planar, BOOL has_alpha, BOOL fast_min, RXImage *dest_im, RXImage *dest_alpha, XRectangle srect, XRectangle drect, NSCompositingOperation op, XGDrawMechanism drawMechanism); extern NSData *_pixmap_read_alpha(RContext *context, RXImage *source_im, RXImage *source_alpha, XRectangle srect, XGDrawMechanism drawMechanism); #endif gnustep-back-0.29.0/INSTALL000066400000000000000000000041441404163720200152200ustar00rootroot000000000000001 Installation ************** 1.1 Introduction ================ This file documents the installation of the GNUstep Backend Library, 'gnustep-back'. If you are installing this package as part of the GNUstep core package, read the file GNUstep-HOWTO for more complete instructions on how to install the entire GNUstep package (including this library). GNUstep-HOWTO is located at You must have installed gnustep-gui before installing this library. 1.2 Configuration ================= Configuration is performed by running the 'configure' program at a shell prompt. You may want to use some of the optional arguments to the 'configure' program. Type 'configure --help' for a list. GNUstep specific options are at the end of this list (if any). The backend comes with several different window server and graphics drawing implementations. If you do nothing, the default ones will be chosen. You can can change this using configure. For instance, to choose the art graphical drawing implementation, run configure --enable-graphics=art Type 'configure --help' for a list of graphical drawing implementations. You can also change the name of the backend when configuring it. This is convienient if you want to have a different backend with different configurations. For instance, to create an xlib and and art backend, you could do this: configure --enable-graphics=xlib --with-name=xlib make install make distclean configure --enable-graphics=art --with-name=art make install Before running an application, choose one backend using the defaults program: defaults write NSGlobalDomain GSBackend libgnustep-xlib 1.3 Compilation =============== To compile this library, type make. After this is complete, type make install (make sure you are the root user). Some additional options you can use with make are 'debug=yes' to make a debugging version of the library and 'shared=no' to make a static version of the library. See the gstep-make package for more information on these options. 1.4 Installing ============== To install, type make install gnustep-back-0.29.0/NEWS000066400000000000000000000270121404163720200146650ustar00rootroot000000000000001 NEWS ****** 1.1 Noteworthy changes in version '0.29.0' ========================================== The release includes an alpha version of the wayland backend and a few bug fixes. * Alpha version of the wayland backend. * Improved focus handling for WindowMaker interaction. * Speed up for font pattern resolving. * Improved appicon behavior under WindowMaker. * Prevent appicon flickering on WindowMaker at application start. * On Windows, consistently use 'GetWindowLongPtr' and 'SetWindowLongPtr' in place of 'GetWindowLong' and 'SetWindowLong' for win32 and cairo for various win64 fixes. 1.2 Noteworthy changes in version '0.28.0' ========================================== This release includes a few bugfixes and a huge rework of multi monitor handling. * Improved focus handling for WindowMaker interaction. * Cursor improvements. * Better handling of fonts with fontconfig. * Simplify code that converts images for X11. * art: Remove ftfont-old.m. * Use Xrandr for multi monitor support. 1.3 Noteworthy changes in version '0.27.0' ========================================== This release includes a few bugfixes. * configure: Improve configuration. * xlib: Improve xft font classes. * x11: Enable drawing in secondary threads. * x11: Better handling of atoms. Method to get the window manager. * opal: Improve colour handling 1.4 Noteworthy changes in version '0.26.2' ========================================== This release contains no changes since 0.26.1. It is released to coincide with gnustep-gui 0.26.2, which has important bugfixes related to printing. 1.5 Noteworthy changes in version '0.26.1' ========================================== This release contains no changes since 0.26.0. It is released to coincide with gnustep-gui 0.26.1, released to mark gnustep-base 1.25.1 as the requirement for gnustep-gui. 1.6 Noteworthy changes in version '0.26.0' ========================================== This release includes a few bugfixes, as well as compatibility improvements as a result of GSoC 2017 project. * opal: Bridging categories between Opal and GNUstep GUI. Added onto NSColor, NSImage and NSImageRep. * cairo: Get -DPSshow: to work on scaled windows. * opal: Allow creating a NSGraphicsContext with a custom graphics port, other than a CGContext. * misc: Fix reported static analyser warnings. 1.7 Noteworthy changes in version '0.25.1' ========================================== Small fixes and cleanups. 1.8 Noteworthy changes in version '0.25.0' ========================================== Support for pattern phase, compositing operation, image interpolation and antialiasing per gstate. Improvements to Win32 code. Fix application menus under WindowMaker. Various fixes. 1.9 Noteworthy changes in version '0.24.1' ========================================== Improvements in win32 display and mouse tracking. Various minor bugfixes and cleanups. 1.10 Noteworthy changes in version '0.24.0' =========================================== Added experimental Opal backend. Allow for ARGB visual for OpenGL. 1.11 Noteworthy changes in version '0.23.0' =========================================== Added cairo support for ms-windows. Updated for NSInteger/CGFloat support 1.12 Noteworthy changes in version '0.22.0' =========================================== Added new user defaults to make app icons and mini windows sticky (omnipresent) Many improvements to Cairo rendering, including buffering, glyphs and DPI scaling. 1.13 Noteworthy changes in version '0.20.0' =========================================== Cairo is now the default backend, but falls back to art and xlib gracefully. Fixed drawing and flipping (goes along with gui change). More Windows improvements. 1.14 Noteworthy changes in version '0.19.0' =========================================== This is an (unstable) copy of the 0.18.0 release 1.15 Noteworthy changes in version '0.18.0' =========================================== Many Windows improvements Implement pattern colours for all backends. 1.16 Noteworthy changes in version '0.17.1' =========================================== Use DejaVu as another fallback font. 1.17 Noteworthy changes in version '0.17.0' =========================================== Key repeat support implemented in X11. OpenGL fixes and improvements. 1.18 Noteworthy changes in version '0.16.0' =========================================== Transparent windows implemented in WIN32 backend, better position and scaling of images. General cleanup of code. 1.19 Noteworthy changes in version '0.14.0' =========================================== Added code to automatically make any window which uses the NSDesktopWindowLevel also be omnipresent. Many glyph drawing improvements. 1.20 Noteworthy changes in version '0.13.2' =========================================== Added basic implementation of window levels on Windows. In general a bunch of improvements in the Windows backend. Experimental patch for using cairo on Windows. More support for RTF, TIFF and selctions in the pasteboard server. There has been change in the interaction of devices with the gui frontend. This version or greater of the backend needs to be used with gui 0.13.2 1.21 Noteworthy changes in version '0.13.1' =========================================== Minor improvements. 1.22 Noteworthy changes in version '0.13.0' =========================================== Many improvements to the cairo backend. Add DPSshfill for all backends. Better handling of X event times. 1.23 Noteworthy changes in version '0.12.0' =========================================== Big improvements to the cairo graphics and Window backend. Also better support for OpenGL. 1.24 Noteworthy changes in version '0.11.0' =========================================== Bugfixes to art and xlib. There was some work on the Windows backend for the GDI interface by Christopher Armstrong. 1.25 Noteworthy changes in version '0.10.3' =========================================== Fixes. A lot of Cairo backend work. 1.26 Noteworthy changes in version '0.10.2' =========================================== The Backend can set UTF8 window titles where this is allowed. 1.27 Noteworthy changes in version '0.10.1' =========================================== The art graphics module is the default now. As was previously the case, if the proper libraries are not found, the configuration will automatically switch to xlib on winlib (whichever is appropriate). There was a great deal of work by Tom MacSween on the windows module to get windows and taskbars working together, closing, opening, hiding, and just general good window management. The Cairo module has been significantly updated and now works with Cariro version 1.0, although you need to make some minor changes to the Cairo library before it will work with GNUstep. Due to this, this module is still considered beta. Ask on the mailing lists for help with this. 1.28 Noteworthy changes in version '0.10.0' =========================================== The installed name of the backend now includes an interface version number. This avoids the potential version mismatch between the frontend (GUI) library and the backend. * Alpha blending was implemented for Windows, although it does not seem to work on some machines. 1.29 Noteworthy changes in version '0.9.5' ========================================== * Added support for window alpha on X servers. * Add support for old and new freetype libs. * Some improvements to the Windows backend. 1.30 Noteworthy changes in version '0.9.4' ========================================== * Fast drawing on 8 bit displays was added (although it might only speed things up on old X11 servers and/or remote servers). * GNUstep modifier keys are mapped to KeySyms instead of KeyCodes * Added a Cairo backend, although it is probably non-functional. Anyone is invited to contribute to making it work. * art backend supports reading from a window. * Add internal window decoration handling. 1.31 Noteworthy changes in version '0.9.3' ========================================== * A number of W32 window event enhancements * art backend glyph drawing with alpha enhancements. * libwraster is no longer checked for - image functions now in frontend 1.32 Noteworthy changes in version '0.9.2' ========================================== * Art backend added support for grayscale, one-isblack colorspaces. * Windows pasteboard interaction handling added. * Better focus handling on Windows. * Better font and draw handling on Windows. 1.33 Noteworthy changes in version '0.9.1' ========================================== Color on 8 bit displays works correctly now. WindowMaker properties are always set now in case another manager is emulating WindowMaker styles. 1.34 Noteworthy changes in version '0.9.0' ========================================== Some more improvements to copy/paste support following ICCCM specifications (like COMPOUND_TEXT support). 1.35 Noteworthy changes in version '0.8.9' ========================================== * Much improved pasting support between X apps and GNUstep apps. * Backend headers are no longer installed (now private). 1.36 Noteworthy changes in version '0.8.8' ========================================== Full multi-byte/unicode support for East Asian languages was added to the xlib backend. The X11 server now supports use of the XIM input method for entering non-keyboard characters. Both contributions thanks to Kazunobu Kuriyama. * Also added slightly better EWMH support. * Art backend works with more versions of freetype. 1.37 Noteworthy changes in version '0.8.7' ========================================== Handle NSBezierPath glyph drawing in art backend. art backend compiles with all freetype except 2.1.3 via ifdefs. 1.38 Noteworthy changes in version '0.8.6' ========================================== Bug fixes. See the gnustep-gui NEWS for changes. 1.39 Noteworthy changes in version '0.8.5' ========================================== Text system improvements. See the gnustep-gui NEWS for changes. 1.40 Noteworthy changes in version '0.8.3' ========================================== See the gnustep-gui NEWS for changes. 1.41 Noteworthy changes in version '0.8.2' ========================================== Improved font handling in art backend. Improved compositing with transformations and clipping in art backend. 1.42 Noteworthy changes in version '0.8.1' ========================================== art (libart-based) backend added. Use ./configure -enable-graphics=art to choose this backend. 1.43 Noteworthy changes in version '0.8.0' ========================================== Bug fixes. 1.44 Noteworthy changes in version '0.7.9' ========================================== Bug fixes. 1.45 Noteworthy changes in version '0.7.8' ========================================== Simplified backend selection using -enable-server and -enable-graphics. Add -with-library-flags and -with-include-flags for adding additonal flags. Set name with -with-name 1.46 Noteworthy changes in version '0.7.7' ========================================== First release. Most components extracted from xgps. The old backends, xgps and xdps were depreciated in favor of this new backend, simply named back, which can be configured for a variety of window server and graphics implementations, and also allow for improved code sharing. In addition there is now a window server backend for Windows computers, although it is in a very alpha state. gnustep-back-0.29.0/README000066400000000000000000000011701404163720200150430ustar00rootroot000000000000001 README ******** This is version 0.29.0 of the GNUstep GUI Backend ('gnustep-back'). Here is some introductory info to get you started: 1.1 Initial reading =================== * The file 'ANNOUNCE' contains a very brief overview of the library. It also tells you where to get the most recent version. * The file 'NEWS' has the library's feature history. * The file 'INSTALL' gives instructions for installing the library. 1.2 How can you help? ===================== * Give us feedback! Tell us what you like; tell us what you think could be better. Send us bug reports at . gnustep-back-0.29.0/Source/000077500000000000000000000000001404163720200154245ustar00rootroot00000000000000gnustep-back-0.29.0/Source/.cvsignore000066400000000000000000000000351404163720200174220ustar00rootroot00000000000000ix86 config.h *_obj *.bundle gnustep-back-0.29.0/Source/English.lproj/000077500000000000000000000000001404163720200201425ustar00rootroot00000000000000gnustep-back-0.29.0/Source/English.lproj/nfontFaceNames.strings000066400000000000000000000014111404163720200244410ustar00rootroot00000000000000/*** English.lproj/nfontFaceNames.strings updated by make_strings 2003-06-28 15:21:29 +0200 add comments above this one ***/ /*** Strings from art/ftfont.m ***/ /* File: art/ftfont.m:183 */ "Bold" = "Bold"; /* File: art/ftfont.m:189 */ "Bold Italic" = "Bold Italic"; /* File: art/ftfont.m:190 */ "Bold Oblique" = "Bold Oblique"; /* File: art/ftfont.m:177 */ "Book" = "Book"; /* File: art/ftfont.m:181 */ "Demi" = "Demi"; /* File: art/ftfont.m:182 */ "Demibold" = "Demibold"; /* File: art/ftfont.m:184 */ "Heavy" = "Heavy"; /* File: art/ftfont.m:186 */ "Italic" = "Italic"; /* File: art/ftfont.m:180 */ "Medium" = "Medium"; /* File: art/ftfont.m:187 */ "Oblique" = "Oblique"; /* File: art/ftfont.m:178 */ "Regular" = "Regular"; /* File: art/ftfont.m:179 */ "Roman" = "Roman"; gnustep-back-0.29.0/Source/GNUmakefile000066400000000000000000000036331404163720200175030ustar00rootroot00000000000000# # Top level makefile for GNUstep Backend # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back include $(GNUSTEP_MAKEFILES)/common.make include ../config.make include ../Version # The library to be compiled, as a library or as a bundle ifeq ($(BACKEND_BUNDLE),) BACKEND_FULL=$(BACKEND_NAME) LIBRARY_NAME=libgnustep-$(BACKEND_FULL) else BACKEND_FULL=$(BACKEND_NAME)-$(INTERFACE_VERSION_NUMBER) BUNDLE_NAME=libgnustep-$(BACKEND_FULL) endif # # The list of subproject directories # SUBPROJECTS = gsc $(BUILD_SERVER) $(BUILD_GRAPHICS) libgnustep-$(BACKEND_FULL)_SUBPROJECTS=$(SUBPROJECTS) libgnustep-$(BACKEND_FULL)_OBJC_FILES=GSBackend.m libgnustep-$(BACKEND_FULL)_PRINCIPAL_CLASS=GSBackend libgnustep-$(BACKEND_FULL)_LOCALIZED_RESOURCE_FILES=nfontFaceNames.strings libgnustep-$(BACKEND_FULL)_LANGUAGES=English Swedish -include GNUmakefile.preamble ifeq ($(BACKEND_BUNDLE),) include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/bundle.make endif -include GNUmakefile.postamble gnustep-back-0.29.0/Source/GNUmakefile.postamble000066400000000000000000000043131404163720200214640ustar00rootroot00000000000000# # GNUakefile.postamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # Things to do before compiling before-all:: $(GNUSTEP_TARGET_DIR)/config.h $(BUNDLE_NAME)Info.plist # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning after-clean:: rm -f $(BUNDLE_NAME)Info.plist: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning after-distclean:: rm -rf $(GNUSTEP_TARGET_DIR)/config.h rm -rf $(GNUSTEP_TARGET_CPU) # Things to do before checking # before-check:: # Things to do after checking # after-check:: # # The config.h file is specific to a target # $(GNUSTEP_TARGET_DIR)/config.h: ../config.status $(MKDIRS) $(GNUSTEP_TARGET_DIR) -cp ../config.h $(GNUSTEP_TARGET_DIR) # # Make an Info.plist for the bundle # $(BUNDLE_NAME)Info.plist: $(ECHO_CREATING)(echo "{"; \ echo " GSBundleShortVersionString = \"$(VERSION)\";"; \ echo " GSBundleVersion = $(VERSION_NUMBER);"; \ echo " CFBundleShortVersionString = \"$(VERSION)\";"; \ echo " CFBundleVersion = $(VERSION_NUMBER);"; \ echo "}") > $@$(END_ECHO) gnustep-back-0.29.0/Source/GNUmakefile.preamble000066400000000000000000000042331404163720200212660ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS += # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../Headers -I$(GNUSTEP_TARGET_DIR) CONFIG_SYSTEM_INCL += $(GRAPHIC_CFLAGS) # Additional LDFLAGS to pass to the linker #ADDITIONAL_LDFLAGS += # Additional library directories the linker should search #ADDITIONAL_LIB_DIRS += CONFIG_SYSTEM_LIB_DIR += $(GRAPHIC_LFLAGS) # # Flags for compiling as a bundle or library (if the system depends # on having libraries specified). # libgnustep-$(BACKEND_FULL)_BUNDLE_LIBS = $(GRAPHIC_LIBS) ifeq ($(BACKEND_BUNDLE),) libgnustep-$(BACKEND_FULL)_LIBRARIES_DEPEND_UPON = \ -lgnustep-gui -l$(FOUNDATION_LIBRARY_NAME) $(GRAPHIC_LIBS) endif # # The */*.m is a hack to get make_strings to pull in all the .m files in all # sub-directories. Even if we aren't including a directory in the build, it is # important that the strings files contains all strings. # MAKE_STRINGS_OPTIONS = --aggressive-match --aggressive-remove */*.m gnustep-back-0.29.0/Source/GSBackend.m000066400000000000000000000063771404163720200174000ustar00rootroot00000000000000/* GSBackend - backend initialize class Copyright (C) 2002 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 2002 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include @interface GSBackend : NSObject { } + (void) initializeBackend; @end #if BUILD_SERVER == SERVER_x11 #include @interface XGServer (Initialize) + (void) initializeBackend; @end #elif BUILD_SERVER == SERVER_win32 #include @interface WIN32Server (Initialize) + (void) initializeBackend; @end #elif BUILD_SERVER == SERVER_wayland #include @interface WaylandServer (Initialize) + (void) initializeBackend; @end #endif /* Call the correct initalization routines for the choosen backend. This depends both on configuration data and defaults. */ @implementation GSBackend + (void) initializeBackend { Class contextClass; NSString *context = nil; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; /* Load in only one server */ #if BUILD_SERVER == SERVER_x11 [XGServer initializeBackend]; #elif BUILD_SERVER == SERVER_win32 [WIN32Server initializeBackend]; #elif BUILD_SERVER == SERVER_wayland [WaylandServer initializeBackend]; #else [NSException raise: NSInternalInconsistencyException format: @"No Window Server configured in backend"]; #endif /* The way the frontend is currently structured it's not possible to have more than one */ /* What backend context? */ if ([defs stringForKey: @"GSContext"]) context = [defs stringForKey: @"GSContext"]; if ((context == nil) || ([context length] == 0)) { #if (BUILD_GRAPHICS==GRAPHICS_xdps) context = @"NSDPSContext"; #elif (BUILD_GRAPHICS==GRAPHICS_art) context = @"ARTContext"; #elif (BUILD_GRAPHICS==GRAPHICS_xlib) context = @"XGContext"; #elif (BUILD_GRAPHICS==GRAPHICS_winlib) context = @"WIN32Context"; #elif (BUILD_GRAPHICS==GRAPHICS_cairo) context = @"CairoContext"; #elif (BUILD_GRAPHICS==GRAPHICS_opal) context = @"OpalContext"; #else #error INVALID build graphics type #endif } // Reference the requested build time class... contextClass = NSClassFromString(context); if (contextClass == nil) { NSLog(@"%s:Backend context class missing for: %@\n", __PRETTY_FUNCTION__, context); exit(1); } [contextClass initializeBackend]; } @end gnustep-back-0.29.0/Source/Swedish.lproj/000077500000000000000000000000001404163720200201575ustar00rootroot00000000000000gnustep-back-0.29.0/Source/Swedish.lproj/nfontFaceNames.strings000066400000000000000000000020651404163720200244640ustar00rootroot00000000000000/* Translated by Alexander Malmberg. Jag kan egentligen inte mycket svensk typografijargong; nagon som kan borde dubbel-kolla oversattningen. (2003-06-28) */ /*** Swedish.lproj/nfontFaceNames.strings updated by make_strings 2003-06-28 15:21:29 +0200 add comments above this one ***/ /*** Unmatched/untranslated keys ***/ /* File: art/ftfont.m:177 */ /* Flag: untranslated */ "Book" = "Book"; /* File: art/ftfont.m:179 */ /* Flag: untranslated */ "Roman" = "Roman"; /* File: art/ftfont.m:180 */ /* Flag: untranslated */ "Medium" = "Medium"; /* File: art/ftfont.m:184 */ /* Flag: untranslated */ "Heavy" = "Heavy"; /*** Strings from art/ftfont.m ***/ /* File: art/ftfont.m:183 */ "Bold" = "Fet"; /* File: art/ftfont.m:189 */ "Bold Italic" = "Fet Kursiv"; /* File: art/ftfont.m:190 */ "Bold Oblique" = "Fet Kursiv"; /* File: art/ftfont.m:181 */ "Demi" = "Halvfet"; /* File: art/ftfont.m:182 */ "Demibold" = "Halvfet"; /* File: art/ftfont.m:186 */ "Italic" = "Kursiv"; /* File: art/ftfont.m:187 */ "Oblique" = "Kursiv"; /* File: art/ftfont.m:178 */ "Regular" = "Vanlig"; gnustep-back-0.29.0/Source/art/000077500000000000000000000000001404163720200162125ustar00rootroot00000000000000gnustep-back-0.29.0/Source/art/.cvsignore000066400000000000000000000000171404163720200202100ustar00rootroot00000000000000Resources *obj gnustep-back-0.29.0/Source/art/ARTContext.m000066400000000000000000000103731404163720200203670ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "ARTGState.h" #import "blit.h" #import "ftfont.h" #ifndef RDS #import "x11/XWindowBuffer.h" #endif @implementation ARTContext + (void)initializeBackend { float gamma; NSDebugLLog(@"back-art",@"Initializing libart/freetype backend"); [NSGraphicsContext setDefaultContextClass: [ARTContext class]]; [FTFontInfo initializeBackend]; gamma = [[NSUserDefaults standardUserDefaults] floatForKey: @"back-art-text-gamma"]; artcontext_setup_gamma(gamma); } + (Class) GStateClass { return [ARTGState class]; } - (void) setupDrawInfo: (void*)device { int bpp; int red_mask, green_mask, blue_mask; #ifdef RDS RDSServer *s = (RDSServer *)server; [s getPixelFormat: &bpp masks: &red_mask : &green_mask : &blue_mask]; #else gswindow_device_t *gs_win; gs_win = device; [(XGServer *)server getForScreen: gs_win->screen_id pixelFormat: &bpp masks: &red_mask : &green_mask : &blue_mask]; #endif artcontext_setup_draw_info(&DI, red_mask, green_mask, blue_mask, bpp); } - (void) flushGraphics { /* TODO: _really_ flush? (ie. force updates and wait for shm completion?) */ #ifndef RDS XFlush([(XGServer *)server xDisplay]); #endif } #ifndef RDS + (void) _gotShmCompletion: (Drawable)d { [XWindowBuffer _gotShmCompletion: d]; } - (void) gotShmCompletion: (Drawable)d { [XWindowBuffer _gotShmCompletion: d]; } #endif /* Private backend methods */ + (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver { [(XWindowBuffer *)driver _exposeRect: rect]; } - (BOOL) isCompatibleBitmap: (NSBitmapImageRep*)bitmap { NSString *colorSpaceName; int numColors; if ([bitmap bitmapFormat] != 0) { return NO; } if (([bitmap bitsPerSample] > 8) && ([bitmap bitsPerSample] != 16)) { return NO; } numColors = [bitmap samplesPerPixel] - ([bitmap hasAlpha] ? 1 : 0); colorSpaceName = [bitmap colorSpaceName]; if ([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] || [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) { return (numColors == 3); } else if ([colorSpaceName isEqualToString: NSDeviceCMYKColorSpace]) { return (numColors == 4); } else if ([colorSpaceName isEqualToString: NSDeviceWhiteColorSpace] || [colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) { return (numColors == 1); } else if ([colorSpaceName isEqualToString: NSDeviceBlackColorSpace] || [colorSpaceName isEqualToString: NSCalibratedBlackColorSpace]) { return (numColors == 1); } else { return NO; } } @end @implementation ARTContext (ops) - (void) GSSetDevice: (void*)device : (int)x : (int)y { // Currently all windows share the same drawing info. // It is enough to initialize it once. // This will fail when different screen use different visuals. static BOOL serverInitialized = NO; if (!serverInitialized) { [self setupDrawInfo: device]; serverInitialized = YES; } [(ARTGState *)gstate GSSetDevice: device : x : y]; } - (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { [(ARTGState *)gstate GSCurrentDevice: device : x : y]; } @end gnustep-back-0.29.0/Source/art/ARTGState.h000066400000000000000000000055451404163720200201320ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ARTGState_h #define ARTGState_h #include "art/ARTContext.h" #include "gsc/GSGState.h" #include "config.h" #if (BUILD_SERVER==SERVER_rds) #define RDS #endif #ifndef RDS #include "x11/XGServer.h" #include "x11/XGServerWindow.h" #else #include "rds/RDSServer.h" #endif #include @class XWindowBuffer; @interface ARTGState : GSGState { unsigned char fill_color[4],stroke_color[4]; float line_width; int linecapstyle,linejoinstyle; float miter_limit; BOOL strokeadjust; struct _ArtVpathDash dash; int do_dash; XWindowBuffer *wi; int clip_x0,clip_y0,clip_x1,clip_y1; BOOL all_clipped; #define CLIP_DATA (wi->data+clip_x0*wi->bytes_per_pixel+clip_y0*wi->bytes_per_line) int clip_sx,clip_sy; /* Clipping spans are stored this way. clip_index has an index to the spans (in clip_span) for each line. clip_span has the x-starting coordinate for each span. A line starts 'off', each coordinate flips the state. The spans are stored in increasing y order, so clip_index[y+1]-1 is the index of the last span coordinate. Thus, if clip_index[y]==clip_index[y+1], the entire line is clipped. clip_index actually has clip_sy+1 entries, so clip_index[y+1] is valid for _all_ lines. All coordinates are in device space and counted inside the clipping rectangle. To make things easier, each line also ends in the off state (so the last entry in clip_span might be a dummy entry at the end of the line). */ unsigned int *clip_span; unsigned int *clip_index; int clip_num_span; } @end @interface ARTGState (internal_stuff) -(void) GSSetDevice: (gswindow_device_t *)win : (int)x : (int)y; -(void) GSCurrentDevice: (void **)device : (int *)x : (int *)y; @end #define UPDATE_UNBUFFERED \ if (wi->window->type==NSBackingStoreNonretained) \ { \ [wi _exposeRect: NSMakeRect(clip_x0,clip_y0,clip_sx,clip_sy)]; \ } extern struct draw_info_s ART_DI; #define DI ART_DI #endif gnustep-back-0.29.0/Source/art/ARTGState.m000066400000000000000000000412211404163720200201260ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "ARTGState.h" #include "blit.h" #include "ftfont.h" #ifndef RDS #include "x11/XWindowBuffer.h" #endif #include draw_info_t ART_DI; @implementation ARTGState /* TODO: optimize all this. passing device_color_t structures around by value is very expensive */ -(void) setColor: (device_color_t *)color state: (color_state_t)cState { device_color_t c; unsigned char r,g,b; [super setColor: color state: cState]; if (cState & COLOR_FILL) { c = fillColor; gsColorToRGB(&c); /* TODO: check this */ if (c.field[0] > 1.0) c.field[0] = 1.0; if (c.field[0] < 0.0) c.field[0] = 0.0; r = c.field[0] * 255; if (c.field[1] > 1.0) c.field[1] = 1.0; if (c.field[1] < 0.0) c.field[1] = 0.0; g = c.field[1] * 255; if (c.field[2] > 1.0) c.field[2] = 1.0; if (c.field[2] < 0.0) c.field[2] = 0.0; b = c.field[2] * 255; fill_color[0] = r; fill_color[1] = g; fill_color[2] = b; fill_color[3] = fillColor.field[AINDEX] * 255; } if (cState & COLOR_STROKE) { c = strokeColor; gsColorToRGB(&c); /* TODO: check this */ if (c.field[0] > 1.0) c.field[0] = 1.0; if (c.field[0] < 0.0) c.field[0] = 0.0; r = c.field[0] * 255; if (c.field[1] > 1.0) c.field[1] = 1.0; if (c.field[1] < 0.0) c.field[1] = 0.0; g = c.field[1] * 255; if (c.field[2] > 1.0) c.field[2] = 1.0; if (c.field[2] < 0.0) c.field[2] = 0.0; b = c.field[2] * 255; stroke_color[0] = r; stroke_color[1] = g; stroke_color[2] = b; stroke_color[3] = strokeColor.field[AINDEX] * 255; } } /* specially optimized versions (since these are common and simple) */ -(void) DPSsetgray: (CGFloat)gray { if (gray < 0.0) gray = 0.0; if (gray > 1.0) gray = 1.0; fillColor.space = strokeColor.space = gray_colorspace; fillColor.field[0] = strokeColor.field[0] = gray; cstate = COLOR_FILL | COLOR_STROKE; stroke_color[0] = stroke_color[1] = stroke_color[2] = fill_color[0] = fill_color[1] = fill_color[2] = gray * 255; } -(void) DPSsetalpha: (CGFloat)a { if (a < 0.0) a = 0.0; if (a > 1.0) a = 1.0; fillColor.field[AINDEX] = strokeColor.field[AINDEX] = a; stroke_color[3] = fill_color[3] = a * 255; } - (void) DPSsetrgbcolor: (CGFloat)r : (CGFloat)g : (CGFloat)b { if (r < 0.0) r = 0.0; if (r > 1.0) r = 1.0; if (g < 0.0) g = 0.0; if (g > 1.0) g = 1.0; if (b < 0.0) b = 0.0; if (b > 1.0) b = 1.0; fillColor.space = strokeColor.space = rgb_colorspace; fillColor.field[0] = strokeColor.field[0] = r; fillColor.field[1] = strokeColor.field[1] = g; fillColor.field[2] = strokeColor.field[2] = b; cstate = COLOR_FILL | COLOR_STROKE; stroke_color[0] = fill_color[0] = r * 255; stroke_color[1] = fill_color[1] = g * 255; stroke_color[2] = fill_color[2] = b * 255; } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ - (void) DPSashow: (CGFloat)ax : (CGFloat)ay : (const char*)s { /* adds (ax,ay) in user space to each glyph's x/y advancement */ NSPoint p; int x, y; CGFloat numarray[2]; if (!wi || !wi->data) return; if (all_clipped) return; if ([path isEmpty]) return; p = [path currentPoint]; numarray[0] = ax; numarray[1] = ay; x = p.x - offset.x; y = offset.y - p.y; [(id)font drawString: s at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line : (wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL) : wi->sx color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm deltas: numarray : 1 : 4 widthChar: 0 drawinfo: &DI]; UPDATE_UNBUFFERED } - (void) DPSawidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (CGFloat)ax : (CGFloat)ay : (const char*)s { /* adds (ax,ay) in user space to every glyph's advancement and (cx,cy) to character c's x/y advancement */ NSPoint p; int x, y; CGFloat numarray[4]; if (!wi || !wi->data) return; if (all_clipped) return; if ([path isEmpty]) return; p = [path currentPoint]; numarray[0] = ax; numarray[1] = ay; numarray[2] = cx; numarray[3] = cy; x = p.x - offset.x; y = offset.y - p.y; [(id)font drawString: s at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line : (wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL) : wi->sx color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm deltas: numarray : 1 : 12 widthChar: c drawinfo: &DI]; UPDATE_UNBUFFERED } - (void) DPScharpath: (const char*)s : (int)b { /* TODO: handle b? will freetype ever give us a stroke-only font? */ NSPoint p; if ([path isEmpty]) return; p=[self currentPoint]; [(id)font outlineString: s at: p.x : p.y gstate: self]; [self DPSclosepath]; } - (void) DPSshow: (const char*)s { NSPoint p; int x, y; if (!wi || !wi->data) return; if (all_clipped) return; if ([path isEmpty]) return; p = [path currentPoint]; x = p.x - offset.x; y = offset.y - p.y; [(id)font drawString: s at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line : (wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL) : wi->sx color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm deltas: NULL : 0 : 0 widthChar: 0 drawinfo: &DI]; UPDATE_UNBUFFERED } - (void) DPSwidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (const char*)s { /* adds (x,y) in user space to character c's x/y advancement */ NSPoint p; int x, y; CGFloat numarray[2]; if (!wi || !wi->data) return; if (all_clipped) return; if ([path isEmpty]) return; p = [path currentPoint]; numarray[0] = cx; numarray[1] = cy; x = p.x - offset.x; y = offset.y - p.y; [(id)font drawString: s at: x : y to: clip_x0:clip_y0:clip_x1:clip_y1 : CLIP_DATA : wi->bytes_per_line : (wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL) : wi->sx color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] transform: ctm deltas: numarray : 1 : 8 widthChar: c drawinfo: &DI]; UPDATE_UNBUFFERED } - (void) DPSxshow: (const char*)s : (const CGFloat*)numarray : (int)size { NSPoint p; int x, y; if (!wi || !wi->data) return; if (all_clipped) return; if ([path isEmpty]) return; p = [path currentPoint]; x = p.x - offset.x; y = offset.y - p.y; [(id)font drawString: s at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line : (wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL) : wi->sx color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm deltas: numarray : size : 1 widthChar: 0 drawinfo: &DI]; UPDATE_UNBUFFERED } - (void) DPSxyshow: (const char*)s : (const CGFloat*)numarray : (int)size { NSPoint p; int x, y; if (!wi || !wi->data) return; if (all_clipped) return; if ([path isEmpty]) return; p = [path currentPoint]; x = p.x - offset.x; y = offset.y - p.y; [(id)font drawString: s at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line : (wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL) : wi->sx color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm deltas: numarray : size : 3 widthChar: 0 drawinfo: &DI]; UPDATE_UNBUFFERED } - (void) DPSyshow: (const char*)s : (const CGFloat*)numarray : (int)size { NSPoint p; int x, y; if (!wi || !wi->data) return; if (all_clipped) return; if (!path || [path isEmpty]) return; p = [path currentPoint]; x = p.x - offset.x; y = offset.y - p.y; [(id)font drawString: s at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line : (wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL) : wi->sx color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm deltas: numarray : size : 2 widthChar: 0 drawinfo: &DI]; UPDATE_UNBUFFERED } - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { // FIXME: Currently advances is ignored NSPoint p; int x, y; if (!wi || !wi->data) return; if (all_clipped) return; if (!path || [path isEmpty]) return; p = [path currentPoint]; x = p.x - offset.x; y = offset.y - p.y; if (wi->has_alpha) { [(id)font drawGlyphs: glyphs : length at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line alpha: wi->alpha + clip_x0 + clip_y0 * wi->sx : wi->sx color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm drawinfo: &DI]; } else { [(id)font drawGlyphs: glyphs : length at: x : y to: clip_x0 : clip_y0 : clip_x1 : clip_y1 : CLIP_DATA : wi->bytes_per_line color: fill_color[0] : fill_color[1] : fill_color[2] : fill_color[3] transform: ctm drawinfo: &DI]; } UPDATE_UNBUFFERED } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - (void) DPSinitgraphics { [super DPSinitgraphics]; line_width = 1.0; linecapstyle = ART_PATH_STROKE_CAP_BUTT; linejoinstyle = ART_PATH_STROKE_JOIN_MITER; strokeadjust = 1; miter_limit = 10.0; [self DPSsetalpha: 1.0]; if (dash.n_dash) { free(dash.dash); dash.dash = NULL; dash.n_dash = 0; do_dash = 0; } } - (void) DPScurrentlinecap: (int*)linecap { switch (linecapstyle) { default: case ART_PATH_STROKE_CAP_BUTT: *linecap = NSButtLineCapStyle; break; case ART_PATH_STROKE_CAP_ROUND: *linecap = NSRoundLineCapStyle; break; case ART_PATH_STROKE_CAP_SQUARE: *linecap = NSSquareLineCapStyle; break; } } - (void) DPScurrentlinejoin: (int*)linejoin { switch (linejoinstyle) { default: case ART_PATH_STROKE_JOIN_MITER: *linejoin = NSMiterLineJoinStyle; break; case ART_PATH_STROKE_JOIN_ROUND: *linejoin = NSRoundLineJoinStyle; break; case ART_PATH_STROKE_JOIN_BEVEL: *linejoin = NSBevelLineJoinStyle; break; } } - (void) DPScurrentlinewidth: (CGFloat*)width { *width = line_width; } - (void) DPScurrentmiterlimit: (CGFloat*)limit { *limit = miter_limit; } - (void) DPSsetdash: (const CGFloat*)pat : (NSInteger)size : (CGFloat)offs { NSInteger i; if (dash.n_dash) { free(dash.dash); dash.dash = NULL; dash.n_dash = 0; do_dash = 0; } if (size>0) { dash.offset = offs; dash.n_dash = size; dash.dash = malloc(sizeof(double)*size); if (!dash.dash) { /* Revert to no dash. Better than crashing. */ dash.n_dash = 0; dash.offset = 0; do_dash = 0; } else { for (i = 0; i < size; i++) dash.dash[i] = pat[i]; do_dash = 1; } } } - (void) DPSsetlinecap: (int)linecap { switch (linecap) { default: case NSButtLineCapStyle: linecapstyle = ART_PATH_STROKE_CAP_BUTT; break; case NSRoundLineCapStyle: linecapstyle = ART_PATH_STROKE_CAP_ROUND; break; case NSSquareLineCapStyle: linecapstyle = ART_PATH_STROKE_CAP_SQUARE; break; } } - (void) DPSsetlinejoin: (int)linejoin { switch (linejoin) { default: case NSMiterLineJoinStyle: linejoinstyle = ART_PATH_STROKE_JOIN_MITER; break; case NSRoundLineJoinStyle: linejoinstyle = ART_PATH_STROKE_JOIN_ROUND; break; case NSBevelLineJoinStyle: linejoinstyle = ART_PATH_STROKE_JOIN_BEVEL; break; } } - (void) DPSsetlinewidth: (CGFloat)width { line_width = width; /* TODO? handle line_width=0 properly */ if (line_width <= 0) line_width = 1; } - (void) DPSsetmiterlimit: (CGFloat)limit { miter_limit=limit; } - (void) DPScurrentstrokeadjust: (int*)b { *b = strokeadjust; } - (void) DPSsetstrokeadjust: (int)b { strokeadjust = b; } @end @implementation ARTGState (internal_stuff) - (void) dealloc { if (dash.dash) free(dash.dash); if (clip_span) free(clip_span); if (clip_index) free(clip_index); DESTROY(wi); [super dealloc]; } -(id) deepen { [super deepen]; if (dash.dash) { double *tmp = malloc(sizeof(double) * dash.n_dash); if (tmp) { memcpy(tmp, dash.dash, sizeof(double) * dash.n_dash); dash.dash = tmp; } else { dash.dash = NULL; dash.n_dash = 0; do_dash = 0; } } if (clip_span) { unsigned int *n; n = malloc(sizeof(unsigned int) * clip_num_span); if (n) { memcpy(n, clip_span, sizeof(unsigned int) * clip_num_span); clip_span = n; n = malloc(sizeof(unsigned int *) * (clip_sy+1)); if (n) { memcpy(n, clip_index, sizeof(unsigned int *) * (clip_sy + 1)); clip_index = n; } else { free(clip_span); clip_span=clip_index = NULL; clip_num_span = 0; } } else { clip_span = clip_index = NULL; clip_num_span = 0; } } wi = RETAIN(wi); return self; } -(void) GSSetDevice: (gswindow_device_t *)window : (int)x : (int)y { struct XWindowBuffer_depth_info_s di; [self setOffset: NSMakePoint(x, y)]; #ifndef RDS di.drawing_depth = DI.drawing_depth; #endif di.bytes_per_pixel = DI.bytes_per_pixel; di.inline_alpha = DI.inline_alpha; di.inline_alpha_ofs = DI.inline_alpha_ofs; di.byte_order = ImageByteOrder(window->display); ASSIGN(wi, [XWindowBuffer windowBufferForWindow: window depthInfo: &di]); } -(void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { NSPoint theOffset = [self offset]; if (x) *x = theOffset.x; if (y) *y = theOffset.y; if (device) { if (wi) *device = wi->window; else *device = NULL; } } @end @implementation ARTGState (PatternColor) typedef struct _SavedClip { int clip_x0,clip_y0,clip_x1,clip_y1; BOOL all_clipped; int clip_sx,clip_sy; unsigned int *clip_span; unsigned int *clip_index; int clip_num_span; } SavedClip; - (void *) saveClip { SavedClip *savedClip = malloc(sizeof(SavedClip)); int i; savedClip->clip_x0 = clip_x0; savedClip->clip_y0 = clip_y0; savedClip->clip_x1 = clip_x1; savedClip->clip_y1 = clip_y1; savedClip->all_clipped = all_clipped; savedClip->clip_sx = clip_sx; savedClip->clip_sy = clip_sy; if (clip_num_span == 0) { savedClip->clip_span = NULL; savedClip->clip_index = NULL; } else { savedClip->clip_span = malloc(sizeof(int) * clip_num_span); savedClip->clip_index = malloc(sizeof(int) * clip_num_span); for (i = 0; i < clip_num_span; i++) { savedClip->clip_span[i] = clip_span[i]; } for (i = 0; i < clip_num_span; i++) { savedClip->clip_index[i] = clip_index[i]; } } savedClip->clip_num_span = clip_num_span; return savedClip; } - (void) restoreClip: (void *)saved { SavedClip *savedClip = (SavedClip *)saved; clip_x0 = savedClip->clip_x0; clip_y0 = savedClip->clip_y0; clip_x1 = savedClip->clip_x1; clip_y1 = savedClip->clip_y1; all_clipped = savedClip->all_clipped; clip_sx = savedClip->clip_sx; clip_sy = savedClip->clip_sy; if (clip_span) { free(clip_span); free(clip_index); } clip_span = savedClip->clip_span; clip_index = savedClip->clip_index; clip_num_span = savedClip->clip_num_span; free(savedClip); } @end gnustep-back-0.29.0/Source/art/FTFaceInfo.h000066400000000000000000000032061404163720200202700ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef FTFaceInfo_h #define FTFaceInfo_h #include @class NSString; @class NSArray; @interface FTFaceInfo : NSObject { @public NSString *familyName; /* the following two are localized */ NSString *faceName; NSString *displayName; NSArray *files; struct { int pixel_size; NSArray *files; } *sizes; int num_sizes; int weight; unsigned int traits; /* hinting hints 0: 1 to use the auto-hinter 1: 1 to use hinting byte 0 and 1 contain hinting hints for un-antialiased and antialiased rendering, respectively. 16: 0=un-antialiased by default, 1=antialiased by default */ unsigned int render_hints_hack; } @end #endif gnustep-back-0.29.0/Source/art/FTFaceInfo.m000066400000000000000000000025101404163720200202720ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "FTFaceInfo.h" @implementation FTFaceInfo - (NSString *) description { return [NSString stringWithFormat: @"", self, displayName, files, weight, traits]; } /* FTFaceInfo:s should never be deallocated */ - (void) dealloc { NSLog(@"Warning: -dealloc called on %@",self); GSNOSUPERDEALLOC; } @end gnustep-back-0.29.0/Source/art/FTFontEnumerator.h000066400000000000000000000022511404163720200215650ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef FTFontEnumerator_h #define FTFontEnumerator_h #include @class FTFaceInfo; @interface FTFontEnumerator : GSFontEnumerator + (FTFaceInfo *) fontWithName: (NSString *)name; @end #endif gnustep-back-0.29.0/Source/art/FTFontEnumerator.m000066400000000000000000000347511404163720200216040ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include "FTFontEnumerator.h" #include "FTFaceInfo.h" #if 0 /* This is a list of "standard" face names. It is here so make_strings can pick it up and generate .strings files with them. */ NSLocalizedStringFromTable(@"Book", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Regular", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Roman", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Medium", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Demi", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Demibold", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Bold", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Heavy", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Italic", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Oblique", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Bold Italic", @"nfontFaceNames", @"") NSLocalizedStringFromTable(@"Bold Oblique", @"nfontFaceNames", @"") #endif static NSMutableArray *fcfg_allFontNames; static NSMutableDictionary *fcfg_allFontFamilies; static NSMutableDictionary *fcfg_all_fonts; static NSMutableSet *families_seen, *families_pending; static BOOL anti_alias_by_default; static int traits_from_string(NSString *s, unsigned int *traits, unsigned int *weight) { static struct { NSString *str; unsigned int trait; int weight; } suffix[] = { /* TODO */ {@"Normal" ,0 ,-1}, {@"Ultralight" ,0 , 1}, {@"Thin" ,0 , 2}, {@"Light" ,0 , 3}, {@"Extralight" ,0 , 3}, {@"Book" ,0 , 4}, {@"Regular" ,0 , 5}, {@"Plain" ,0 , 5}, {@"Display" ,0 , 5}, {@"Roman" ,0 , 5}, {@"Semilight" ,0 , 5}, {@"Medium" ,0 , 6}, {@"Demi" ,0 , 7}, {@"Demibold" ,0 , 7}, {@"Semi" ,0 , 8}, {@"Semibold" ,0 , 8}, {@"Bold" ,NSBoldFontMask , 9}, {@"Extra" ,NSBoldFontMask ,10}, {@"Extrabold" ,NSBoldFontMask ,10}, {@"Heavy" ,NSBoldFontMask ,11}, {@"Heavyface" ,NSBoldFontMask ,11}, {@"Ultrabold" ,NSBoldFontMask ,12}, {@"Black" ,NSBoldFontMask ,12}, {@"Ultra" ,NSBoldFontMask ,13}, {@"Ultrablack" ,NSBoldFontMask ,13}, {@"Fat" ,NSBoldFontMask ,13}, {@"Extrablack" ,NSBoldFontMask ,14}, {@"Obese" ,NSBoldFontMask ,14}, {@"Nord" ,NSBoldFontMask ,14}, {@"Italic" ,NSItalicFontMask ,-1}, {@"Oblique" ,NSItalicFontMask ,-1}, {@"Cond" ,NSCondensedFontMask ,-1}, {@"Condensed" ,NSCondensedFontMask ,-1}, {nil,0,-1} }; int i; *traits = 0; // printf("do '%@'\n", s); while ([s length] > 0) { // printf(" got '%@'\n", s); if ([s hasSuffix: @"-"] || [s hasSuffix: @" "]) { // printf(" do -\n"); s = [s substringToIndex: [s length] - 1]; continue; } for (i = 0; suffix[i].str; i++) { if (![s hasSuffix: suffix[i].str]) continue; // printf(" found '%@'\n", suffix[i].str); if (suffix[i].weight != -1) *weight = suffix[i].weight; (*traits) |= suffix[i].trait; s = [s substringToIndex: [s length] - [suffix[i].str length]]; break; } if (!suffix[i].str) break; } // printf("end up with '%@'\n", s); return [s length]; } static NSArray *fix_path(NSString *path, NSArray *files) { int i, c = [files count]; NSMutableArray *nfiles; if (!files) return nil; nfiles = [[NSMutableArray alloc] init]; for (i = 0; i < c; i++) { if ([[files objectAtIndex: i] isAbsolutePath]) [nfiles addObject: [files objectAtIndex: i]]; else [nfiles addObject: [path stringByAppendingPathComponent: [files objectAtIndex: i]]]; } return nfiles; } /* TODO: handling of .font packages needs to be reworked */ static void add_face(NSString *family, int family_weight, unsigned int family_traits, NSDictionary *d, NSString *path, BOOL from_nfont) { FTFaceInfo *fi; unsigned int weight; unsigned int traits; NSString *fontName; NSString *faceName, *rawFaceName; fontName = [d objectForKey: @"PostScriptName"]; if (!fontName) { NSLog(@"Warning: Face in %@ has no PostScriptName!",path); return; } if ([fcfg_allFontNames containsObject: fontName]) return; fi = [[FTFaceInfo alloc] init]; fi->familyName = [family copy]; if ([d objectForKey: @"LocalizedNames"]) { NSDictionary *l; NSArray *lang; int i; l = [d objectForKey: @"LocalizedNames"]; lang = [[NSUserDefaults standardUserDefaults] stringArrayForKey: @"NSLanguages"]; faceName = nil; rawFaceName = [l objectForKey: @"English"]; for (i = 0; i < [lang count] && !faceName; i++) { faceName = [l objectForKey: [lang objectAtIndex: i]]; } if (!faceName) faceName = rawFaceName; if (!faceName) { faceName = @""; NSLog(@"Warning: couldn't find localized face name or fallback for %@", fontName); } } else if ((faceName = [d objectForKey: @"Name"])) { rawFaceName = faceName; /* TODO: Smarter localization? Parse space separated parts and translate individually? */ /* TODO: Need to define the strings somewhere, and make sure the strings files get created. */ faceName = [NSLocalizedStringFromTableInBundle(faceName,@"nfontFaceNames", [NSBundle bundleForClass: [fi class]],nil) copy]; fi->faceName = faceName; } else if (!from_nfont) { /* try to guess something for .font packages */ unsigned int dummy; int split = traits_from_string(family,&dummy,&dummy); rawFaceName = faceName = [family substringFromIndex: split]; family = [family substringToIndex: split]; faceName = [NSLocalizedStringFromTableInBundle(faceName,@"nfontFaceNames", [NSBundle bundleForClass: [fi class]],nil) copy]; fi->faceName = faceName; } else { NSLog(@"Warning: Can't find name for face %@ in %@!",fontName,path); return; } fi->displayName = [[NSString stringWithFormat: @"%@ %@", family, faceName] retain]; weight = family_weight; if (rawFaceName) traits_from_string(rawFaceName, &traits, &weight); { NSDictionary *sizes; NSEnumerator *e; NSString *size; int i; sizes = [d objectForKey: @"ScreenFonts"]; fi->num_sizes = [sizes count]; if (fi->num_sizes) { fi->sizes = malloc(sizeof(fi->sizes[0])*[sizes count]); e = [sizes keyEnumerator]; i = 0; while ((size = [e nextObject])) { fi->sizes[i].pixel_size = [size intValue]; fi->sizes[i].files = fix_path(path,[sizes objectForKey: size]); NSDebugLLog(@"ftfont",@"%@ size %i files |%@|", fontName,fi->sizes[i].pixel_size,fi->sizes[i].files); i++; } } } fi->files = fix_path(path,[d objectForKey: @"Files"]); if ([d objectForKey: @"Weight"]) weight = [[d objectForKey: @"Weight"] intValue]; fi->weight = weight; if ([d objectForKey: @"Traits"]) traits = [[d objectForKey: @"Traits"] intValue]; traits |= family_traits; fi->traits = traits; if ([d objectForKey: @"RenderHints_hack"]) fi->render_hints_hack = strtol([[d objectForKey: @"RenderHints_hack"] cString], NULL, 0); else { if (anti_alias_by_default) fi->render_hints_hack = 0x10202; else fi->render_hints_hack = 0x00202; } NSDebugLLog(@"ftfont", @"adding '%@' '%@'", fontName, fi); [fcfg_all_fonts setObject: fi forKey: fontName]; [fcfg_allFontNames addObject: fontName]; { NSArray *a; NSMutableArray *ma; a = [NSArray arrayWithObjects: fontName, faceName, [NSNumber numberWithInt: weight], [NSNumber numberWithUnsignedInt: traits], nil]; ma = [fcfg_allFontFamilies objectForKey: family]; if (!ma) { ma = [[NSMutableArray alloc] init]; [fcfg_allFontFamilies setObject: ma forKey: family]; [ma release]; } [ma addObject: a]; } DESTROY(fi); } static void load_font_configuration(void) { int i, j, k, c; NSArray *paths; NSString *path, *font_path; NSFileManager *fm = [NSFileManager defaultManager]; NSArray *files; NSDictionary *d; NSArray *faces; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; if ([ud objectForKey: @"GSFontAntiAlias"]) anti_alias_by_default = [ud boolForKey: @"GSFontAntiAlias"]; else anti_alias_by_default = YES; fcfg_all_fonts = [[NSMutableDictionary alloc] init]; fcfg_allFontFamilies = [[NSMutableDictionary alloc] init]; fcfg_allFontNames = [[NSMutableArray alloc] init]; families_seen = [[NSMutableSet alloc] init]; families_pending = [[NSMutableSet alloc] init]; paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); for (i = 0; i < [paths count]; i++) { path = [paths objectAtIndex: i]; path = [path stringByAppendingPathComponent: @"Fonts"]; files = [fm directoryContentsAtPath: path]; c = [files count]; for (j = 0; j < c; j++) { NSString *family; NSDictionary *face_info; NSString *font_info_path; int weight; unsigned int traits; font_path = [files objectAtIndex: j]; if (![[font_path pathExtension] isEqual: @"nfont"]) continue; family = [font_path stringByDeletingPathExtension]; if ([families_seen member: family]) { NSDebugLLog(@"ftfont", @"'%@' already seen, skipping", family); continue; } [families_seen addObject: family]; font_path = [path stringByAppendingPathComponent: font_path]; NSDebugLLog(@"ftfont",@"loading %@",font_path); font_info_path = [font_path stringByAppendingPathComponent: @"FontInfo.plist"]; if (![fm fileExistsAtPath: font_info_path]) continue; d = [NSDictionary dictionaryWithContentsOfFile: font_info_path]; if (!d) continue; if ([d objectForKey: @"Family"]) family = [d objectForKey: @"Family"]; if ([d objectForKey: @"Weight"]) weight = [[d objectForKey: @"Weight"] intValue]; else weight = 5; if ([d objectForKey: @"Traits"]) traits = [[d objectForKey: @"Traits"] intValue]; else traits = 0; faces = [d objectForKey: @"Faces"]; if (![faces isKindOfClass: [NSArray class]]) { NSLog(@"Warning: %@ isn't a valid .nfont package, ignoring.", font_path); if ([faces isKindOfClass: [NSDictionary class]]) NSLog(@"(it looks like an old-style .nfont package)"); continue; } for (k = 0; k < [faces count]; k++) { face_info = [faces objectAtIndex: k]; add_face(family, weight, traits, face_info, font_path, YES); } } for (j = 0; j < c; j++) { NSString *family; font_path = [files objectAtIndex: j]; if (![[font_path pathExtension] isEqual: @"font"]) continue; family = [font_path stringByDeletingPathExtension]; font_path = [path stringByAppendingPathComponent: font_path]; d = [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObjects: family, [family stringByAppendingPathExtension: @"afm"], nil], @"Files", family,@"PostScriptName", nil]; add_face(family, 5, 0, d, font_path, NO); } [families_seen unionSet: families_pending]; [families_pending removeAllObjects]; } NSDebugLLog(@"ftfont", @"got %lu fonts in %lu families", [fcfg_allFontNames count], [fcfg_allFontFamilies count]); if (![fcfg_allFontNames count]) { NSLog(@"No fonts found!"); exit(1); } DESTROY(families_seen); DESTROY(families_pending); } @implementation FTFontEnumerator + (FTFaceInfo *) fontWithName: (NSString *)name { FTFaceInfo *face; face = [fcfg_all_fonts objectForKey: name]; if (!face) { NSLog (@"Font not found %@", name); } return face; } - (void) enumerateFontsAndFamilies { load_font_configuration(); ASSIGN(allFontNames, fcfg_allFontNames); ASSIGN(allFontFamilies, fcfg_allFontFamilies); } - (NSString *) defaultSystemFontName { if ([fcfg_allFontNames containsObject: @"BitstreamVeraSans-Roman"]) return @"BitstreamVeraSans-Roman"; if ([fcfg_allFontNames containsObject: @"FreeSans"]) return @"FreeSans"; return @"Helvetica"; } - (NSString *) defaultBoldSystemFontName { if ([fcfg_allFontNames containsObject: @"BitstreamVeraSans-Bold"]) return @"BitstreamVeraSans-Bold"; if ([fcfg_allFontNames containsObject: @"FreeSansBold"]) return @"FreeSansBold"; return @"Helvetica-Bold"; } - (NSString *) defaultFixedPitchFontName { if ([fcfg_allFontNames containsObject: @"BitstreamVeraSansMono-Roman"]) return @"BitstreamVeraSansMono-Roman"; if ([fcfg_allFontNames containsObject: @"FreeMono"]) return @"FreeMono"; return @"Courier"; } @end gnustep-back-0.29.0/Source/art/GNUmakefile000066400000000000000000000030211404163720200202600ustar00rootroot00000000000000# # Main makefile for back-art # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Alexander Malmberg # Original author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make SUBPROJECT_NAME=art # The Objective-C source files to be compiled art_OBJC_FILES = \ ARTContext.m \ ARTGState.m \ blit-main.m \ ftfont.m \ FTFontEnumerator.m \ FTFaceInfo.m \ image.m \ composite.m \ path.m \ shfill.m \ ReadRect.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/art/GNUmakefile.preamble000066400000000000000000000031321404163720200220510ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler #ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) \ # Additional LDFLAGS to pass to the linker #ADDITIONAL_LDFLAGS = # Additional library directories the linker should search #ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/art/ReadRect.m000066400000000000000000000077661404163720200201010ustar00rootroot00000000000000/* Copyright (C) 2004 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "ARTGState.h" #ifndef RDS #include "x11/XWindowBuffer.h" #endif #include "blit.h" #include #include #include #include #include #include @implementation ARTGState (ReadRect) -(NSDictionary *) GSReadRect: (NSRect)r { NSMutableDictionary *md = [[NSMutableDictionary alloc] init]; NSAffineTransform *matrix; int x0, y0, x1, y1, w, h, ox, oy; NSPoint p; /* Get the bounding rect in pixel coordinates. */ p = r.origin; p = [ctm transformPoint: p]; x0 = floor(p.x); x1 = ceil(p.x); y0 = floor(p.y); y1 = ceil(p.y); #define CHECK do { \ if (floor(p.x)x1) x1=ceil(p.x); \ if (ceil(p.y)>y1) y1=ceil(p.y); } while (0) p = r.origin; p.x += r.size.width; p = [ctm transformPoint: p]; CHECK; p = r.origin; p.x += r.size.width; p.y += r.size.height; p = [ctm transformPoint: p]; CHECK; p = r.origin; p.y += r.size.height; p = [ctm transformPoint: p]; CHECK; #undef CHECK /* Clip to the window. */ if (x0 < 0) x0 = 0; if (x1 < 0) x1 = 0; if (x0 > wi->sx) x0 = wi->sx; if (x1 > wi->sx) x1 = wi->sx; if (y0 < 0) y0 = 0; if (y1 < 0) y1 = 0; if (y0 > wi->sy) y0 = wi->sy; if (y1 > wi->sy) y1 = wi->sy; w = x1 - x0; h = y1 - y0; if (w <= 0 || h <= 0) w = h = 0; /* The matrix is the transform from user space to image space, and image space has its origin in the lower left corner if the image. Thus, we need to translate the ctm according to the position of the lower left corner in the window. */ matrix=[ctm copy]; [matrix translateXBy: -x0 yBy: -y0]; ox = [matrix transformPoint: NSMakePoint(0, 0)].x - offset.x; oy = offset.y - [matrix transformPoint: NSMakePoint(0, 0)].y; [md setObject: NSDeviceRGBColorSpace forKey: @"ColorSpace"]; [md setObject: [NSNumber numberWithUnsignedInt: 1] forKey: @"HasAlpha"]; [md setObject: [NSNumber numberWithUnsignedInt: 8] forKey: @"BitsPerSample"]; [md setObject: [NSNumber numberWithUnsignedInt: 4] forKey: @"SamplesPerPixel"]; [md setObject: [NSValue valueWithSize: NSMakeSize(w, h)] forKey: @"Size"]; [md setObject: matrix forKey: @"Matrix"]; [matrix release]; if (!w || !h) return [[md autorelease] makeImmutableCopyOnFail: YES]; /* The rectangle isn't degenerate, so we need to actually copy some data. */ { NSMutableData *d; int y; composite_run_t c; d = [[NSMutableData alloc] initWithLength: w * h * 4]; c.dst = [d mutableBytes]; c.src = wi->data + (oy - y1) * wi->bytes_per_line + (x0 + ox) * DI.bytes_per_pixel; c.srca = wi->alpha + (oy - y1) * wi->sx + (x0 + ox); for (y = 0; y < h; y++) { if (wi->has_alpha) DI.read_pixels_a(&c, w); else DI.read_pixels_o(&c, w); c.src += wi->bytes_per_line; c.srca += wi->sx; c.dst += w * 4; } [md setObject: [[d autorelease] makeImmutableCopyOnFail: YES] forKey: @"Data"]; } return [[md autorelease] makeImmutableCopyOnFail: YES]; } @end gnustep-back-0.29.0/Source/art/blit-main.m000066400000000000000000000357661404163720200202650ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "blit.h" /* First attempt at gamma correction. Only used in text rendering (blit_*), but that's where it's needed the most. The gamma adjustment is a large hack, but the results are good. */ static unsigned char gamma_table[256],inv_gamma_table[256]; #define NPRE(r, pre) pre##_##r #define M2PRE(a, b) NPRE(a, b) #define MPRE(r) M2PRE(r, FORMAT_INSTANCE) /* For each supported pixel format we define a bunch of macros and include ourself. */ /* 24-bit red green blue */ #define FORMAT_INSTANCE rgb #define FORMAT_HOW DI_24_RGB #define BLEND_TYPE unsigned char #define BLEND_READ(p,nr,ng,nb) nr=p[0]; ng=p[1]; nb=p[2]; #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) nr=p[0]; ng=p[1]; nb=p[2]; na=pa[0]; #define BLEND_WRITE(p,nr,ng,nb) p[0]=nr; p[1]=ng; p[2]=nb; #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[0]=nr; p[1]=ng; p[2]=nb; pa[0]=na; #define BLEND_INC(p) p+=3; #define ALPHA_READ(s,sa,d) d=sa[0]; #define ALPHA_INC(s,sa) s+=3; sa++; #define COPY_TYPE unsigned char #define COPY_TYPE_PIXEL(a) unsigned char a[3]; #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v[0]=r; v[1]=g; v[2]=b; #define COPY_WRITE(dst,v) dst[0]=v[0]; dst[1]=v[1]; dst[2]=v[2]; #define COPY_INC(dst) dst+=3; #include "blit.m" #undef FORMAT_INSTANCE /* 24-bit blue green red */ #define FORMAT_INSTANCE bgr #define FORMAT_HOW DI_24_BGR #define BLEND_TYPE unsigned char #define BLEND_READ(p,nr,ng,nb) nb=p[0]; ng=p[1]; nr=p[2]; #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) nb=p[0]; ng=p[1]; nr=p[2]; na=pa[0]; #define BLEND_WRITE(p,nr,ng,nb) p[0]=nb; p[1]=ng; p[2]=nr; #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[0]=nb; p[1]=ng; p[2]=nr; pa[0]=na; #define BLEND_INC(p) p+=3; #define ALPHA_READ(s,sa,d) d=sa[0]; #define ALPHA_INC(s,sa) s+=3; sa++; #define COPY_TYPE unsigned char #define COPY_TYPE_PIXEL(a) unsigned char a[3]; #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v[0]=b; v[1]=g; v[2]=r; #define COPY_WRITE(dst,v) dst[0]=v[0]; dst[1]=v[1]; dst[2]=v[2]; #define COPY_INC(dst) dst+=3; #include "blit.m" #undef FORMAT_INSTANCE /* 32-bit red green blue alpha */ #define FORMAT_INSTANCE rgba #define FORMAT_HOW DI_32_RGBA #define INLINE_ALPHA #define BLEND_TYPE unsigned char #define BLEND_READ(p,nr,ng,nb) nr=p[0]; ng=p[1]; nb=p[2]; #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) nr=p[0]; ng=p[1]; nb=p[2]; na=p[3]; #define BLEND_WRITE(p,nr,ng,nb) p[0]=nr; p[1]=ng; p[2]=nb; #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[0]=nr; p[1]=ng; p[2]=nb; p[3]=na; #define BLEND_INC(p) p+=4; #define ALPHA_READ(s,sa,d) d=s[3]; #define ALPHA_INC(s,sa) s+=4; #define COPY_TYPE unsigned int #define COPY_TYPE_PIXEL(a) unsigned int a; #if GS_WORDS_BIGENDIAN #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(r<<24)|(g<<16)|(b<<8); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(r<<24)|(g<<16)|(b<<8)|(a); #else #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(b<<16)|(g<<8)|(r<<0); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(b<<16)|(g<<8)|(r<<0)|(a<<24); #endif #define COPY_WRITE(dst,v) dst[0]=v; #define COPY_INC(dst) dst++; #include "blit.m" #undef FORMAT_INSTANCE /* 32-bit blue green red alpha */ #define FORMAT_INSTANCE bgra #define FORMAT_HOW DI_32_BGRA #define INLINE_ALPHA #define BLEND_TYPE unsigned char #define BLEND_READ(p,nr,ng,nb) nb=p[0]; ng=p[1]; nr=p[2]; #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) nb=p[0]; ng=p[1]; nr=p[2]; na=p[3]; #define BLEND_WRITE(p,nr,ng,nb) p[0]=nb; p[1]=ng; p[2]=nr; #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[0]=nb; p[1]=ng; p[2]=nr; p[3]=na; #define BLEND_INC(p) p+=4; #define ALPHA_READ(s,sa,d) d=s[3]; #define ALPHA_INC(s,sa) s+=4; #define COPY_TYPE unsigned int #define COPY_TYPE_PIXEL(a) unsigned int a; #if GS_WORDS_BIGENDIAN #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(b<<24)|(g<<16)|(r<<8); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(b<<24)|(g<<16)|(r<<8)|(a); #else #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(r<<16)|(g<<8)|(b<<0); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(r<<16)|(g<<8)|(b<<0)|(a<<24); #endif #define COPY_WRITE(dst,v) dst[0]=v; #define COPY_INC(dst) dst++; #include "blit.m" #undef FORMAT_INSTANCE /* 32-bit alpha red green blue */ #define FORMAT_INSTANCE argb #define FORMAT_HOW DI_32_ARGB #define INLINE_ALPHA #define BLEND_TYPE unsigned char #define BLEND_READ(p,nr,ng,nb) nr=p[1]; ng=p[2]; nb=p[3]; #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) nr=p[1]; ng=p[2]; nb=p[3]; na=p[0]; #define BLEND_WRITE(p,nr,ng,nb) p[1]=nr; p[2]=ng; p[3]=nb; #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[1]=nr; p[2]=ng; p[3]=nb; p[0]=na; #define BLEND_INC(p) p+=4; #define ALPHA_READ(s,sa,d) d=s[0]; #define ALPHA_INC(s,sa) s+=4; #define COPY_TYPE unsigned int #define COPY_TYPE_PIXEL(a) unsigned int a; #if GS_WORDS_BIGENDIAN #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(r<<16)|(g<<8)|(b<<0); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(r<<16)|(g<<8)|(b<<0)|(a<<24); #else #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(b<<24)|(g<<16)|(r<<8); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(b<<24)|(g<<16)|(r<<8)|(a); #endif #define COPY_WRITE(dst,v) dst[0]=v; #define COPY_INC(dst) dst++; #include "blit.m" #undef FORMAT_INSTANCE /* 32-bit alpha blue green red */ #define FORMAT_INSTANCE abgr #define FORMAT_HOW DI_32_ABGR #define INLINE_ALPHA #define BLEND_TYPE unsigned char #define BLEND_READ(p,nr,ng,nb) nb=p[1]; ng=p[2]; nr=p[3]; #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) nb=p[1]; ng=p[2]; nr=p[3]; na=p[0]; #define BLEND_WRITE(p,nr,ng,nb) p[1]=nb; p[2]=ng; p[3]=nr; #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[1]=nb; p[2]=ng; p[3]=nr; p[0]=na; #define BLEND_INC(p) p+=4; #define ALPHA_READ(s,sa,d) d=s[0]; #define ALPHA_INC(s,sa) s+=4; #define COPY_TYPE unsigned int #define COPY_TYPE_PIXEL(a) unsigned int a; #if GS_WORDS_BIGENDIAN #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(b<<16)|(g<<8)|(r<<0); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(b<<16)|(g<<8)|(r<<0)|(a<<24); #else #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=(r<<24)|(g<<16)|(b<<8); #define COPY_ASSEMBLE_PIXEL_ALPHA(v,r,g,b,a) v=(r<<24)|(g<<16)|(b<<8)|(a); #endif #define COPY_WRITE(dst,v) dst[0]=v; #define COPY_INC(dst) dst++; #include "blit.m" #undef FORMAT_INSTANCE /* 16-bit 5 bits blue, 6 bits green, 5 bits red */ #define FORMAT_INSTANCE b5g6r5 #define FORMAT_HOW DI_16_B5_G6_R5 #define BLEND_TYPE unsigned short #define BLEND_READ(p,nr,ng,nb) \ { \ unsigned short _s=p[0]; \ nr=(_s>>11)<<3; \ ng=((_s>>5)<<2)&0xff; \ nb=(_s<<3)&0xff; \ } #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) \ { \ unsigned short _s=p[0]; \ nr=(_s>>11)<<3; \ ng=((_s>>5)<<2)&0xff; \ nb=(_s<<3)&0xff; \ na=pa[0]; \ } #define BLEND_WRITE(p,nr,ng,nb) p[0]=((nr>>3)<<11)|((ng>>2)<<5)|(nb>>3); #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[0]=((nr>>3)<<11)|((ng>>2)<<5)|(nb>>3); pa[0]=na; #define BLEND_INC(p) p++; #define ALPHA_READ(s,sa,d) d=sa[0]; #define ALPHA_INC(s,sa) s++; sa++; #define COPY_TYPE unsigned short #define COPY_TYPE_PIXEL(a) unsigned short a; #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=((r>>3)<<11)|((g>>2)<<5)|(b>>3); #define COPY_WRITE(dst,v) dst[0]=v; #define COPY_INC(dst) dst++; #include "blit.m" #undef FORMAT_INSTANCE /* 16-bit 5 bits blue, 5 bits green, 5 bits red */ #define FORMAT_INSTANCE b5g5r5a1 #define FORMAT_HOW DI_16_B5_G5_R5_A1 #define BLEND_TYPE unsigned short #define BLEND_READ(p,nr,ng,nb) \ { \ unsigned short _s=p[0]; \ nr=(_s>>10)<<3; \ ng=((_s>>5)<<3)&0xff; \ nb=(_s<<3)&0xff; \ } #define BLEND_READ_ALPHA(p,pa,nr,ng,nb,na) \ { \ unsigned short _s=p[0]; \ nr=(_s>>10)<<3; \ ng=((_s>>5)<<3)&0xff; \ nb=(_s<<3)&0xff; \ na=pa[0]; \ } #define BLEND_WRITE(p,nr,ng,nb) p[0]=((nr>>3)<<10)+((ng>>3)<<5)+(nb>>3); #define BLEND_WRITE_ALPHA(p,pa,nr,ng,nb,na) p[0]=((nr>>3)<<10)+((ng>>3)<<5)+(nb>>3); pa[0]=na; #define BLEND_INC(p) p++; #define ALPHA_READ(s,sa,d) d=sa[0]; #define ALPHA_INC(s,sa) s++; sa++; #define COPY_TYPE unsigned short #define COPY_TYPE_PIXEL(a) unsigned short a; #define COPY_ASSEMBLE_PIXEL(v,r,g,b) v=((r>>3)<<10)|((g>>3)<<5)|(b>>3); #define COPY_WRITE(dst,v) dst[0]=v; #define COPY_INC(dst) dst++; #include "blit.m" #undef FORMAT_INSTANCE /* end of pixel formats */ static draw_info_t draw_infos[DI_NUM] = { #define C(x) \ NPRE(run_alpha,x), \ NPRE(run_opaque,x), \ NPRE(run_alpha_a,x), \ NPRE(run_opaque_a,x), \ NPRE(blit_alpha_opaque,x), \ NPRE(blit_mono_opaque,x), \ NPRE(blit_alpha,x), \ NPRE(blit_mono,x), \ NPRE(blit_alpha_a,x), \ NPRE(blit_mono_a,x), \ \ NPRE(blit_subpixel,x), \ \ NPRE(read_pixels_o,x), \ NPRE(read_pixels_a,x), \ \ NPRE(sover_aa,x), \ NPRE(sover_ao,x), \ NPRE(sin_aa,x), \ NPRE(sin_oa,x), \ NPRE(sout_aa,x), \ NPRE(sout_oa,x), \ NPRE(satop_aa,x), \ NPRE(dover_aa,x), \ NPRE(dover_oa,x), \ NPRE(din_aa,x), \ NPRE(dout_aa,x), \ NPRE(datop_aa,x), \ NPRE(xor_aa,x), \ NPRE(plusl_aa,x), \ NPRE(plusl_oa,x), \ NPRE(plusl_ao_oo,x), \ NPRE(plusl_ao_oo,x), \ NPRE(plusd_aa,x), \ NPRE(plusd_oa,x), \ NPRE(plusd_ao_oo,x), \ NPRE(plusd_ao_oo,x), \ NPRE(dissolve_aa,x), \ NPRE(dissolve_oa,x), \ NPRE(dissolve_ao,x), \ NPRE(dissolve_oo,x), /* TODO: try to implement fallback versions? possible? */ {DI_FALLBACK ,0, 0,0,-1,/*C(fallback)*/}, {DI_16_B5_G5_R5_A1 ,2,15,0,-1,C(b5g5r5a1)}, {DI_16_B5_G6_R5 ,2,16,0,-1,C(b5g6r5)}, {DI_24_RGB ,3,24,0,-1,C(rgb)}, {DI_24_BGR ,3,24,0,-1,C(bgr)}, /* ARTContext.m assumes that only 32-bit modes have inline alpha. this might eventually need to be fixed */ {DI_32_RGBA ,4,24,1, 3,C(rgba)}, {DI_32_BGRA ,4,24,1, 3,C(bgra)}, {DI_32_ARGB ,4,24,1, 0,C(argb)}, {DI_32_ABGR ,4,24,1, 0,C(abgr)}, }; static int byte_ofs_of_mask(unsigned int m) { union { unsigned char b[4]; unsigned int m; } tmp; tmp.m = m; if (tmp.b[0] == 0xff && !tmp.b[1] && !tmp.b[2] && !tmp.b[3]) return 0; else if (tmp.b[1] == 0xff && !tmp.b[0] && !tmp.b[2] && !tmp.b[3]) return 1; else if (tmp.b[2] == 0xff && !tmp.b[0] && !tmp.b[1] && !tmp.b[3]) return 2; else if (tmp.b[3] == 0xff && !tmp.b[0] && !tmp.b[1] && !tmp.b[2]) return 3; else return -1; } void artcontext_setup_draw_info(draw_info_t *di, unsigned int red_mask, unsigned int green_mask, unsigned int blue_mask, int bpp) { int t = DI_FALLBACK; NSDebugLLog(@"back-art", @"%s masks=(%08x %08x %08x) bpp=%i", __PRETTY_FUNCTION__, red_mask, green_mask, blue_mask, bpp); if (bpp == 16 && red_mask == 0xf800 && green_mask == 0x7e0 && blue_mask == 0x1f) { t = DI_16_B5_G6_R5; } else if (bpp == 16 && red_mask == 0x7c00 && green_mask == 0x3e0 && blue_mask == 0x1f) { t = DI_16_B5_G5_R5_A1; } else if (bpp == 24 || bpp == 32) { int r, g, b; r = byte_ofs_of_mask(red_mask); g = byte_ofs_of_mask(green_mask); b = byte_ofs_of_mask(blue_mask); if (bpp == 24) { if (r == 0 && g == 1 && b == 2) t = DI_24_RGB; else if (r == 2 && g == 1 && b == 0) t = DI_24_BGR; } else if (bpp == 32) { if (r == 0 && g == 1 && b == 2) t = DI_32_RGBA; else if (r == 2 && g == 1 && b == 0) t = DI_32_BGRA; else if (r == 1 && g == 2 && b == 3) t = DI_32_ARGB; else if (r == 3 && g == 2 && b == 1) t = DI_32_ABGR; } } NSDebugLLog(@"back-art", @"got t=%i", t); *di = draw_infos[t]; if (!di->render_run_alpha) *di = draw_infos[DI_FALLBACK]; if (di->how == DI_FALLBACK) { NSLog(@"gnustep-back(art): Unrecognized color masks: %08x:%08x:%08x %i", red_mask, green_mask, blue_mask, bpp); NSLog(@"Please report this along with details on your pixel format " @"(ie. the four numbers above) to bug-gnustep@gnu.org." @"Better: implement it and send a patch.)"); exit(1); } } void artcontext_setup_gamma(float gamma) { int i; if (!gamma) gamma = 1.4; NSDebugLLog(@"back-art",@"gamma=%g",gamma); gamma = 1.0 / gamma; for (i = 0; i < 256; i++) { gamma_table[i] = pow(i / 255.0, gamma) * 255 + .5; inv_gamma_table[i] = pow(i / 255.0, 1.0 / gamma) * 255 + .5; } } /* compositing: source opaque/dest. opaque 00 01 10 11 Clear 0 0 +ab, clear Copy 1 0 copy all +ab, copy copy copy Sover 1 1 - srcA impl impl copy copy Sin dstA 0 impl +ab, copy impl copy Sout 1 - dstA 0 impl clear impl clear Satop dstA 1 - srcA impl Sover 01 Sin 10 copy Dover 1 - dstA 1 impl noop impl noop Din 0 srcA impl +ab, 00 noop noop Dout 0 1 - srcA impl +ab, 00 clear clear Datop 1 - dstA srcA impl +ab, 00 Dover 10 noop Xor 1 - dstA 1 - srcA impl +ab, 00 Sout 10 clear PlusL impl impl impl impl dst=dst+src, dsta=dsta+srca PlusD impl impl impl impl dst=dst+src-1, dsta=dsta+srca compositing (source transparent) dest. opaque 0 1 Clear 0 0 clear clear Copy 1 0 clear clear Sover 1 1 - srcA noop noop Sin dstA 0 clear clear Sout 1 - dstA 0 clear clear Satop dstA 1 - srcA noop noop Dover 1 - dstA 1 noop noop Din 0 srcA clear clear Dout 0 1 - srcA noop noop Datop 1 - dstA srcA clear clear Xor 1 - dstA 1 - srcA noop noop PlusL dst=src+dst , clamp to 1.0; dsta=srca+dsta, clamp to 1.0 PlusD dst=src+dst-1, clamp to 0.0; dsta=srca+dsta, clamp to 1.0 */ gnustep-back-0.29.0/Source/art/blit.h000066400000000000000000000127251404163720200173240ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef blit_h #define blit_h /** Information about how we draw stuff **/ typedef struct render_run_s { unsigned char r, g, b, a; unsigned char *dst, *dsta; } render_run_t; typedef struct { unsigned char *dst, *dsta; unsigned char *src, *srca; unsigned char fraction; /* for dissolving */ } composite_run_t; typedef struct draw_info_s { int how; #define DI_FALLBACK 0 /* counting from lsb */ #define DI_16_B5_G5_R5_A1 1 #define DI_16_B5_G6_R5 2 #define DI_24_RGB 3 #define DI_24_BGR 4 #define DI_32_RGBA 5 #define DI_32_BGRA 6 #define DI_32_ARGB 7 #define DI_32_ABGR 8 #define DI_NUM 9 int bytes_per_pixel; int drawing_depth; int inline_alpha, inline_alpha_ofs; void (*render_run_alpha)(render_run_t *ri, int num); void (*render_run_opaque)(render_run_t *ri, int num); void (*render_run_alpha_a)(render_run_t *ri, int num); void (*render_run_opaque_a)(render_run_t *ri, int num); void (*render_blit_alpha_opaque)(unsigned char *dst, const unsigned char *src, unsigned char r, unsigned char g, unsigned char b, int num); void (*render_blit_mono_opaque)(unsigned char *dst, const unsigned char *src, int src_ofs, unsigned char r, unsigned char g, unsigned char b, int num); void (*render_blit_alpha)(unsigned char *dst, const unsigned char *src, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, int num); void (*render_blit_mono)(unsigned char *dst, const unsigned char *src, int src_ofs, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, int num); void (*render_blit_alpha_a)(unsigned char *dst, unsigned char *dsta, const unsigned char *src, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, int num); void (*render_blit_mono_a)(unsigned char *dst, unsigned char *dsta, const unsigned char *src, int src_ofs, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, int num); void (*render_blit_subpixel)(unsigned char *dst, const unsigned char *src, unsigned char r, unsigned char g, unsigned char b, unsigned char a, int num); /* dst should be a 32bpp RGBA buffer. */ void (*read_pixels_o)(composite_run_t *c, int num); void (*read_pixels_a)(composite_run_t *c, int num); void (*composite_sover_aa)(composite_run_t *c, int num); void (*composite_sover_ao)(composite_run_t *c, int num); void (*composite_sin_aa)(composite_run_t *c, int num); void (*composite_sin_oa)(composite_run_t *c, int num); void (*composite_sout_aa)(composite_run_t *c, int num); void (*composite_sout_oa)(composite_run_t *c, int num); void (*composite_satop_aa)(composite_run_t *c, int num); void (*composite_dover_aa)(composite_run_t *c, int num); void (*composite_dover_oa)(composite_run_t *c, int num); void (*composite_din_aa)(composite_run_t *c, int num); void (*composite_dout_aa)(composite_run_t *c, int num); void (*composite_datop_aa)(composite_run_t *c, int num); void (*composite_xor_aa)(composite_run_t *c, int num); void (*composite_plusl_aa)(composite_run_t *c, int num); void (*composite_plusl_oa)(composite_run_t *c, int num); void (*composite_plusl_ao)(composite_run_t *c, int num); void (*composite_plusl_oo)(composite_run_t *c, int num); void (*composite_plusd_aa)(composite_run_t *c, int num); void (*composite_plusd_oa)(composite_run_t *c, int num); void (*composite_plusd_ao)(composite_run_t *c, int num); void (*composite_plusd_oo)(composite_run_t *c, int num); void (*dissolve_aa)(composite_run_t *c, int num); void (*dissolve_oa)(composite_run_t *c, int num); void (*dissolve_ao)(composite_run_t *c, int num); void (*dissolve_oo)(composite_run_t *c, int num); } draw_info_t; #define RENDER_RUN_ALPHA (DI.render_run_alpha) #define RENDER_RUN_OPAQUE (DI.render_run_opaque) #define RENDER_RUN_ALPHA_A (DI.render_run_alpha_a) #define RENDER_RUN_OPAQUE_A (DI.render_run_opaque_a) #define RENDER_BLIT_ALPHA_OPAQUE (DI.render_blit_alpha_opaque) #define RENDER_BLIT_MONO_OPAQUE DI.render_blit_mono_opaque #define RENDER_BLIT_ALPHA DI.render_blit_alpha #define RENDER_BLIT_MONO DI.render_blit_mono #define RENDER_BLIT_ALPHA_A DI.render_blit_alpha_a #define RENDER_BLIT_MONO_A DI.render_blit_mono_a void artcontext_setup_draw_info(draw_info_t *di, unsigned int red_mask, unsigned int green_mask, unsigned int blue_mask, int bpp); void artcontext_setup_gamma(float gamma); #endif gnustep-back-0.29.0/Source/art/blit.m000066400000000000000000001015001404163720200173170ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* TODO: rounding of alpha is wrong in many places, ie. an alpha of 255 is treated as an alpha of 255/256 instead of 255/255. The if (alpha>127) alpha++; hacks should take care of this with as much accuracy as we can get. still need to fix all the remaining spots 2002-08-06: boundary cases should be correct now in most places, although rounding is way off (but not more than 1, hopefully) for near-boundary cases. at least pure black stays pure black and pure white stays pure white 2004-01-10: Test suite now says that all composite functions are 'correct', in the sense that the difference from the correct result is never larger than 0.5, and that's the best I can get with finite precision'. :) (However, should probably check whether the results here always match the correctly rounded correct result.) TODO: (optional?) proper gamma handling? TODO: more cpp magic to reduce the amount of code? */ /* Define the different blitting functions. Each blitter is defined once for each format using the different helper macros (or specially optimized functions in some cases). */ static void MPRE(blit_alpha_opaque) (unsigned char *adst, const unsigned char *asrc, unsigned char r, unsigned char g, unsigned char b, int num) { const unsigned char *src = asrc; BLEND_TYPE *dst = (BLEND_TYPE *)adst; int nr, ng, nb, a; for (; num; num--, src++) { a = *src; if (!a) { BLEND_INC(dst) continue; } BLEND_READ(dst, nr, ng, nb) nr = inv_gamma_table[nr]; ng = inv_gamma_table[ng]; nb = inv_gamma_table[nb]; nr = (r * a + nr * (255 - a) + 0xff) >> 8; ng = (g * a + ng * (255 - a) + 0xff) >> 8; nb = (b * a + nb * (255 - a) + 0xff) >> 8; nr = gamma_table[nr]; ng = gamma_table[ng]; nb = gamma_table[nb]; BLEND_WRITE(dst, nr, ng, nb) BLEND_INC(dst) } } static void MPRE(blit_mono_opaque) (unsigned char *adst, const unsigned char *src, int src_ofs, unsigned char r, unsigned char g, unsigned char b, int num) { COPY_TYPE *dst = (COPY_TYPE *)adst; COPY_TYPE_PIXEL(v) int i; unsigned char s; COPY_ASSEMBLE_PIXEL(v, r, g, b) s = *src++; i = src_ofs; while (src_ofs--) s <<= 1; for (; num; num--) { if (s&0x80) { COPY_WRITE(dst, v) } COPY_INC(dst) i++; if (i == 8) { s = *src++; i = 0; } else s <<= 1; } } static void MPRE(blit_alpha) (unsigned char *adst, const unsigned char *asrc, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, int num) { const unsigned char *src = asrc; BLEND_TYPE *dst = (BLEND_TYPE *)adst; int a, nr, ng, nb; if (alpha>127) alpha++; for (; num; num--, src++) { a = *src; if (!a) { BLEND_INC(dst) continue; } a *= alpha; BLEND_READ(dst, nr, ng, nb) nr = (r * a + nr * (65280 - a) + 0xff00) >> 16; ng = (g * a + ng * (65280 - a) + 0xff00) >> 16; nb = (b * a + nb * (65280 - a) + 0xff00) >> 16; BLEND_WRITE(dst, nr, ng, nb) BLEND_INC(dst) } } static void MPRE(blit_mono) (unsigned char *adst, const unsigned char *src, int src_ofs, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, int num) { BLEND_TYPE *dst = (BLEND_TYPE *)adst; int i, nr, ng, nb; unsigned char s; int a; a = alpha; if (a>127) a++; s = *src++; i = src_ofs; while (src_ofs--) s <<= 1; for (; num; num--) { if (s&0x80) { BLEND_READ(dst, nr, ng, nb) nr = (r * a + nr * (255 - a) + 0xff) >> 8; ng = (g * a + ng * (255 - a) + 0xff) >> 8; nb = (b * a + nb * (255 - a) + 0xff) >> 8; BLEND_WRITE(dst, nr, ng, nb) BLEND_INC(dst) } else { BLEND_INC(dst) } i++; if (i == 8) { s = *src++; i = 0; } else s <<= 1; } } static void MPRE(blit_alpha_a) (unsigned char *adst, unsigned char *dsta, const unsigned char *asrc, unsigned char r, unsigned char g, unsigned char b, unsigned char a_alpha, int num) { const unsigned char *src = asrc; BLEND_TYPE *dst = (BLEND_TYPE *)adst; int a, nr, ng, nb, na; int alpha = a_alpha; if (alpha>127) alpha++; for (; num; num--, src++) { a = *src; if (!a) { ALPHA_INC(dst, dsta) continue; } a *= alpha; BLEND_READ_ALPHA(dst, dsta, nr, ng, nb, na) nr = (r * a + nr * (65280 - a) + 0xff00) >> 16; ng = (g * a + ng * (65280 - a) + 0xff00) >> 16; nb = (b * a + nb * (65280 - a) + 0xff00) >> 16; na = ((a << 8) + na * (65280 - a) + 0xff00) >> 16; BLEND_WRITE_ALPHA(dst, dsta, nr, ng, nb, na) ALPHA_INC(dst, dsta) } } static void MPRE(blit_mono_a) (unsigned char *adst, unsigned char *dsta, const unsigned char *src, int src_ofs, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, int num) { BLEND_TYPE *dst = (BLEND_TYPE *)adst; int i, nr, ng, nb; unsigned char s; int a; a = alpha; if (a>127) a++; s = *src++; i = src_ofs; while (src_ofs--) s <<= 1; for (; num; num--) { if (s&0x80) { BLEND_READ(dst, nr, ng, nb) nr = (r * a + nr * (255 - a) + 0xff) >> 8; ng = (g * a + ng * (255 - a) + 0xff) >> 8; nb = (b * a + nb * (255 - a) + 0xff) >> 8; BLEND_WRITE(dst, nr, ng, nb) BLEND_INC(dst) } else { BLEND_INC(dst) } i++; if (i == 8) { s = *src++; i = 0; } else s <<= 1; } } static void MPRE(blit_subpixel) (unsigned char *adst, const unsigned char *asrc, unsigned char r, unsigned char g, unsigned char b, unsigned char a, int num) { const unsigned char *src = asrc; BLEND_TYPE *dst = (BLEND_TYPE *)adst; unsigned int nr, ng, nb; unsigned int ar, ag, ab; int alpha = a; if (alpha>127) alpha++; for (; num; num--) { ar = *src++; ag = *src++; ab = *src++; BLEND_READ(dst, nr, ng, nb) nr = inv_gamma_table[nr]; ng = inv_gamma_table[ng]; nb = inv_gamma_table[nb]; ar *= alpha; ag *= alpha; ab *= alpha; nr = (r * ar + nr * (65280 - ar) + 0xff00) >> 16; ng = (g * ag + ng * (65280 - ag) + 0xff00) >> 16; nb = (b * ab + nb * (65280 - ab) + 0xff00) >> 16; nr = gamma_table[nr]; ng = gamma_table[ng]; nb = gamma_table[nb]; BLEND_WRITE(dst, nr, ng, nb) BLEND_INC(dst) } } static void MPRE(run_opaque) (render_run_t *ri, int num) { #if FORMAT_HOW == DI_16_B5_G5_R5_A1 || FORMAT_HOW == DI_16_B5_G6_R5 unsigned int v; unsigned short *dst = (unsigned short *)ri->dst; COPY_ASSEMBLE_PIXEL(v, ri->r, ri->g, ri->b) v = v + (v << 16); if (((NSUInteger)dst&2) && num) { *dst++ = v; num--; } while (num >= 2) { *((unsigned int *)dst) = v; dst += 2; num -= 2; } if (num) *dst = v; #else COPY_TYPE *dst = (COPY_TYPE *)ri->dst; COPY_TYPE_PIXEL(v) #if FORMAT_HOW == DI_32_RGBA || FORMAT_HOW == DI_32_BGRA || \ FORMAT_HOW == DI_32_ARGB || FORMAT_HOW == DI_32_ABGR if (ri->r == ri->g && ri->r == ri->b) { num *= 4; memset(dst, ri->r, num); return; } #endif COPY_ASSEMBLE_PIXEL(v, ri->r, ri->g, ri->b) for (; num; num--) { COPY_WRITE(dst, v) COPY_INC(dst) } #endif } static void MPRE(run_alpha) (render_run_t *ri, int num) { BLEND_TYPE *dst = (BLEND_TYPE *)ri->dst; int nr, ng, nb; int r, g, b, a; a = ri->a; r = ri->r * a; g = ri->g * a; b = ri->b * a; a = 255 - a; for (; num; num--) { BLEND_READ(dst, nr, ng, nb) nr = (r + nr * a + 0xff) >> 8; ng = (g + ng * a + 0xff) >> 8; nb = (b + nb * a + 0xff) >> 8; BLEND_WRITE(dst, nr, ng, nb) BLEND_INC(dst) } } static void MPRE(run_alpha_a) (render_run_t *ri, int num) { int nr, ng, nb, na; int sr, sg, sb, a; BLEND_TYPE *dst = (BLEND_TYPE *)ri->dst; #ifndef INLINE_ALPHA unsigned char *dst_alpha = ri->dsta; #endif a = ri->a; sr = ri->r * a; sg = ri->g * a; sb = ri->b * a; a = 255 - a; for (; num; num--) { BLEND_READ_ALPHA(dst, dst_alpha, nr, ng, nb, na) nr = (sr + nr * a + 0xff) >> 8; ng = (sg + ng * a + 0xff) >> 8; nb = (sb + nb * a + 0xff) >> 8; na = (na * a + 0xffff - (a << 8)) >> 8; BLEND_WRITE_ALPHA(dst, dst_alpha, nr, ng, nb, na) ALPHA_INC(dst, dst_alpha) } } static void MPRE(run_opaque_a) (render_run_t *ri, int num) { COPY_TYPE *dst = (COPY_TYPE *)ri->dst; COPY_TYPE_PIXEL(v) int n; #ifdef INLINE_ALPHA COPY_ASSEMBLE_PIXEL_ALPHA(v, ri->r, ri->g, ri->b, 0xff) #else COPY_ASSEMBLE_PIXEL(v, ri->r, ri->g, ri->b) #endif for (n = num; n; n--) { COPY_WRITE(dst, v) COPY_INC(dst) } #ifndef INLINE_ALPHA memset(ri->dsta, 0xff, num); #endif } static void MPRE(read_pixels_o) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src; unsigned char *dst = c->dst; int r, g, b; for (; num; num--) { BLEND_READ(s, r, g, b) BLEND_INC(s) dst[0] = r; dst[1] = g; dst[2] = b; dst[3] = 0xff; dst += 4; } } static void MPRE(read_pixels_a) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca; #endif unsigned char *dst = c->dst; int r, g, b, a; for (; num; num--) { BLEND_READ_ALPHA(s, src_alpha, r, g, b, a) ALPHA_INC(s, src_alpha) dst[0] = r; dst[1] = g; dst[2] = b; dst[3] = a; dst += 4; } } /* 1 : 1 - srca */ static void MPRE(sover_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(s, src_alpha, sa) if (!sa) { ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (sa == 255) { BLEND_READ(s, sr, sg, sb) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, 255) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ(s, sr, sg, sb) BLEND_READ_ALPHA(d, dst_alpha, dr, dg, db, da) da = sa + ((da * (255 - sa) + 0xff) >> 8); sa = 255 - sa; dr = sr + ((dr * sa + 0xff) >> 8); dg = sg + ((dg * sa + 0xff) >> 8); db = sb + ((db * sa + 0xff) >> 8); BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(sover_ao) (composite_run_t *c, int num) { #if FORMAT_HOW == DI_16_B5_G6_R5 || FORMAT_HOW == DI_16_B5_G5_R5_A1 BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; unsigned char *src_alpha = c->srca; int sr, sg, sb, sa; #undef i386 #ifndef i386 int dr, dg, db; #endif unsigned int temp; for (; num; num--) { ALPHA_READ(s, src_alpha, sa) if (!sa) { ALPHA_INC(s, src_alpha) BLEND_INC(d) continue; } if (sa == 255) { BLEND_READ(s, sr, sg, sb) BLEND_WRITE(d, sr, sg, sb) ALPHA_INC(s, src_alpha) BLEND_INC(d) continue; } #ifdef i386 /* The basic idea here is to scale all components using one multiply, and to do so without losing any accuracy. To do this, we move the components around so we get 8 empty bits above each component. In a 32-bit word, we don't have enough space for this, but by moving green to the top 6 bits and using ix86 'mul', we'll get the top 32 bits of the multiplication in another register and can later recombine the components relatively easily. Mostly equivalent c (16bpp case): unsigned long long int temp; sa = 255-sa; temp = d[0]; temp = ((temp|(temp<<21))&0xfc00001f)|((temp&0xf800)<<2); temp = temp*sa; temp = temp+0x000000020003e01fLL; temp = temp>>8; temp = (temp&0x1f) | ((temp&0x3e000)>>2) | ((temp&0xfc000000)>>21); d[0]=temp + s[0]; 16bpp: original: 0000 0000 0000 0000 bbbb bggg gggr rrrr after unpacking: gggg gg00 0000 00bb bbb0 0000 000r rrrr after 'mul': .... 0000 0000 gggg gggg gggg ggbb bbbb bbbb bbbr rrrr rrrr rrrr 15bpp: original: 0000 0000 0000 0000 0bbb bbgg gggr rrrr after unpacking: gggg g000 0000 00bb bbb0 0000 000r rrrr after 'mul': .... 0000 0000 gggg gggg gggg g0bb bbbb bbbb bbbr rrrr rrrr rrrr */ temp = d[0]; sa = 255 - sa; asm ( "movl %0,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "shll $21,%%eax\n" #else "shll $22,%%eax\n" #endif "orl %0,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "andl $0xfc00001f,%%eax\n" "andl $0xf800,%0\n" "shll $2,%0\n" #else "andl $0xf800001f,%%eax\n" "andl $0x7c00,%0\n" "shll $3,%0\n" #endif "orl %0,%%eax\n" "mul %2\n" "addl $0x0003e01f,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "addl $0x02,%%edx\n" "andl $0xfc,%%edx\n" "shll $3,%%edx\n" #else "addl $0x01,%%edx\n" "andl $0xf8,%%edx\n" "shll $2,%%edx\n" #endif "shrl $8,%%eax\n" "movl %%eax,%0\n" "andl $0x1f,%0\n" "orl %%edx,%0\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "shrl $2,%%eax\n" "andl $0xf800,%%eax\n" #else "shrl $3,%%eax\n" "andl $0x7c00,%%eax\n" #endif "orl %%eax,%0\n" : "=r" (temp) : "0" (temp), "g" (sa) : "eax", "edx"); d[0] = temp + s[0]; #else /* Generic, non-ix86 code. Can't use the really optimized path, but we can still add in the entire source pixel instead of unpacking it. */ BLEND_READ(d, dr, dg, db) sa = 255 - sa; dr = ((dr * sa + 0xff) >> 8); dg = ((dg * sa + 0xff) >> 8); db = ((db * sa + 0xff) >> 8); COPY_ASSEMBLE_PIXEL(temp, dr, dg, db) d[0] = temp + s[0]; #endif ALPHA_INC(s, src_alpha) BLEND_INC(d) } #else BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca; #endif int sr, sg, sb, sa, dr, dg, db; for (; num; num--) { ALPHA_READ(s, src_alpha, sa) if (!sa) { ALPHA_INC(s, src_alpha) BLEND_INC(d) continue; } if (sa == 255) { BLEND_READ(s, sr, sg, sb) BLEND_WRITE(d, sr, sg, sb) ALPHA_INC(s, src_alpha) BLEND_INC(d) continue; } BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) sa = 255 - sa; dr = sr + ((dr * sa + 0xff) >> 8); dg = sg + ((dg * sa + 0xff) >> 8); db = sb + ((db * sa + 0xff) >> 8); BLEND_WRITE(d, dr, dg, db) ALPHA_INC(s, src_alpha) BLEND_INC(d) } #endif } /* dsta : 0 */ static void MPRE(sin_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) if (!da) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (da == 255) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, sa) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) dr = (sr * da + 0xff) >> 8; dg = (sg * da + 0xff) >> 8; db = (sb * da + 0xff) >> 8; da = (sa * da + 0xff) >> 8; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(sin_oa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *dst_alpha = c->dsta; #endif int sr, sg, sb, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) if (!da) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) BLEND_INC(s) ALPHA_INC(d, dst_alpha) continue; } if (da == 255) { BLEND_READ(s, sr, sg, sb) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, 255) BLEND_INC(s) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ(s, sr, sg, sb) dr = (sr * da + 0xff) >> 8; dg = (sg * da + 0xff) >> 8; db = (sb * da + 0xff) >> 8; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) BLEND_INC(s) ALPHA_INC(d, dst_alpha) } } /* 1 - dsta : 0 */ static void MPRE(sout_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) da = 255 - da; if (!da) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (da == 255) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, sa) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) dr = (sr * da + 0xff) >> 8; dg = (sg * da + 0xff) >> 8; db = (sb * da + 0xff) >> 8; da = (sa * da + 0xff) >> 8; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(sout_oa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *dst_alpha = c->dsta; #endif int sr, sg, sb, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) da = 255 - da; if (!da) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) BLEND_INC(s) ALPHA_INC(d, dst_alpha) continue; } if (da == 255) { BLEND_READ(s, sr, sg, sb) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, 255) BLEND_INC(s) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ(s, sr, sg, sb) dr = (sr * da + 0x80) >> 8; dg = (sg * da + 0x80) >> 8; db = (sb * da + 0x80) >> 8; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) BLEND_INC(s) ALPHA_INC(d, dst_alpha) } } /* dsta : 1 - srca */ /* 0 0 0 1 noop 1 0 0 0 clear, noop 0 1 1 1 noop 1 1 1 0 copy */ static void MPRE(satop_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) ALPHA_READ(s, src_alpha, sa) if (!da || (da == 255 && !sa)) { ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (da == 255 && sa == 255) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, sa) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) sa = 255 - sa; dr = (sr * da + dr * sa + 0xff) >> 8; dg = (sg * da + dg * sa + 0xff) >> 8; db = (sb * da + db * sa + 0xff) >> 8; /* For alpha, satop simplifies to da' = da. */ BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } /* 1 - dsta : 1 */ static void MPRE(dover_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) if (da == 255) { ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (!da) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, sa) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_READ(d, dr, dg, db) sa = da + ((sa * (255 - da) + 0x80) >> 8); da = 255 - da; dr = dr + ((sr * da + 0x80) >> 8); dg = dg + ((sg * da + 0x80) >> 8); db = db + ((sb * da + 0x80) >> 8); BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, sa) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(dover_oa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *dst_alpha = c->dsta; #endif int sr, sg, sb, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) if (da == 255) { BLEND_INC(s) ALPHA_INC(d, dst_alpha) continue; } if (!da) { BLEND_READ(s, sr, sg, sb) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, 255) BLEND_INC(s) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) da = 255 - da; dr = dr + ((sr * da + 0x80) >> 8); dg = dg + ((sg * da + 0x80) >> 8); db = db + ((sb * da + 0x80) >> 8); BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, 255) BLEND_INC(s) ALPHA_INC(d, dst_alpha) } } /* 0 : srca */ static void MPRE(din_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(s, src_alpha, sa) if (!sa) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (sa == 255) { ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ_ALPHA(d, dst_alpha, dr, dg, db, da) dr = (dr * sa + 0x80) >> 8; dg = (dg * sa + 0x80) >> 8; db = (db * sa + 0x80) >> 8; da = (da * sa + 0x80) >> 8; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } /* 0 : 1 - srca */ static void MPRE(dout_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(s, src_alpha, sa) sa = 255 - sa; if (!sa) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (sa == 255) { ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ_ALPHA(d, dst_alpha, dr, dg, db, da) dr = (dr * sa + 0x80) >> 8; dg = (dg * sa + 0x80) >> 8; db = (db * sa + 0x80) >> 8; da = (da * sa + 0x80) >> 8; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } /* 1 - dstA : srcA */ /* 0 0 1 0 clear, noop 1 0 1 1 copy 0 1 0 0 clear 1 1 0 1 noop */ static void MPRE(datop_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(d, dst_alpha, da) ALPHA_READ(s, src_alpha, sa) if ((!da && !sa) || (da == 255 && sa == 255)) { ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (da == 255 && !sa) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (sa == 255 && !da) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, sa) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) da = 255 - da; dr = (dr * sa + sr * da + 0xff) >> 8; dg = (dg * sa + sg * da + 0xff) >> 8; db = (db * sa + sb * da + 0xff) >> 8; /* For alpha, datop simplifies to da' = sa. */ da = sa; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } /* 1 - dsta : 1 - srca */ /* 0 0 1 1 clear, noop 1 0 0 1 noop 0 1 1 0 copy 1 1 0 0 clear */ static void MPRE(xor_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { ALPHA_READ(s, src_alpha, sa) ALPHA_READ(d, dst_alpha, da) if (!sa && (da == 255 || !da)) { ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (sa == 255 && !da) { BLEND_READ(s, sr, sg, sb) BLEND_WRITE_ALPHA(d, dst_alpha, sr, sg, sb, sa) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } if (da == 255 && sa == 255) { BLEND_WRITE_ALPHA(d, dst_alpha, 0, 0, 0, 0) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) continue; } BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) da = 255 - da; sa = 255 - sa; dr = ((dr * sa + sr * da + 0xff) >> 8); dg = ((dg * sa + sg * da + 0xff) >> 8); db = ((db * sa + sb * da + 0xff) >> 8); da = ((da * (255 - sa) + sa * (255 - da) + 0xff) >> 8); BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(plusl_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_READ_ALPHA(d, dst_alpha, dr, dg, db, da) dr += sr; if (dr>255) dr = 255; dg += sg; if (dg>255) dg = 255; db += sb; if (db>255) db = 255; da += sa; if (da>255) da = 255; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(plusl_oa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *dst_alpha = c->dsta; #endif int sr, sg, sb, dr, dg, db; for (; num; num--) { BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) dr += sr; if (dr>255) dr = 255; dg += sg; if (dg>255) dg = 255; db += sb; if (db>255) db = 255; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, 0xff) BLEND_INC(s) ALPHA_INC(d, dst_alpha) } } static void MPRE(plusl_ao_oo) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; int sr, sg, sb, dr, dg, db; for (; num; num--) { BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) dr += sr; if (dr>255) dr = 255; dg += sg; if (dg>255) dg = 255; db += sb; if (db>255) db = 255; BLEND_WRITE(d, dr, dg, db) BLEND_INC(s) BLEND_INC(d) } } static void MPRE(plusd_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; for (; num; num--) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_READ_ALPHA(d, dst_alpha, dr, dg, db, da) dr += sr - 255; if (dr<0) dr = 0; dg += sg - 255; if (dg<0) dg = 0; db += sb - 255; if (db<0) db = 0; da += sa; if (da>255) da = 255; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(plusd_oa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *dst_alpha = c->dsta; #endif int sr, sg, sb, dr, dg, db; for (; num; num--) { BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) dr += sr - 255; if (dr<0) dr = 0; dg += sg - 255; if (dg<0) dg = 0; db += sb - 255; if (db<0) db = 0; BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, 0xff) BLEND_INC(s) ALPHA_INC(d, dst_alpha) } } static void MPRE(plusd_ao_oo) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; int sr, sg, sb, dr, dg, db; for (; num; num--) { BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) dr += sr - 255; if (dr<0) dr = 0; dg += sg - 255; if (dg<0) dg = 0; db += sb - 255; if (db<0) db = 0; BLEND_WRITE(d, dr, dg, db) BLEND_INC(s) BLEND_INC(d) } } static void MPRE(dissolve_aa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca, *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; int fraction = c->fraction; for (; num; num--) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_READ_ALPHA(d, dst_alpha, dr, dg, db, da) sr = (sr * fraction + 0xff) >> 8; sg = (sg * fraction + 0xff) >> 8; sb = (sb * fraction + 0xff) >> 8; sa = (sa * fraction + 0xff) >> 8; da = sa + ((da * (255 - sa) + 0xff) >> 8); sa = 255 - sa; dr = sr + ((dr * sa + 0xff) >> 8); dg = sg + ((dg * sa + 0xff) >> 8); db = sb + ((db * sa + 0xff) >> 8); BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) ALPHA_INC(s, src_alpha) ALPHA_INC(d, dst_alpha) } } static void MPRE(dissolve_ao) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *src_alpha = c->srca; #endif int sr, sg, sb, sa, dr, dg, db; int fraction = c->fraction; for (; num; num--) { BLEND_READ_ALPHA(s, src_alpha, sr, sg, sb, sa) BLEND_READ(d, dr, dg, db) sr = (sr * fraction + 0xff) >> 8; sg = (sg * fraction + 0xff) >> 8; sb = (sb * fraction + 0xff) >> 8; sa = (sa * fraction + 0xff) >> 8; sa = 255 - sa; dr = sr + ((dr * sa + 0xff) >> 8); dg = sg + ((dg * sa + 0xff) >> 8); db = sb + ((db * sa + 0xff) >> 8); BLEND_WRITE(d, dr, dg, db) ALPHA_INC(s, src_alpha) BLEND_INC(d) } } static void MPRE(dissolve_oa) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; #ifndef INLINE_ALPHA unsigned char *dst_alpha = c->dsta; #endif int sr, sg, sb, sa, dr, dg, db, da; int fraction = c->fraction; for (; num; num--) { BLEND_READ(s, sr, sg, sb) BLEND_READ_ALPHA(d, dst_alpha, dr, dg, db, da) sr = (sr * fraction + 0xff) >> 8; sg = (sg * fraction + 0xff) >> 8; sb = (sb * fraction + 0xff) >> 8; sa = fraction; da = sa + ((da * (255 - sa) + 0xff) >> 8); sa = 255 - sa; dr = sr + ((dr * sa + 0xff) >> 8); dg = sg + ((dg * sa + 0xff) >> 8); db = sb + ((db * sa + 0xff) >> 8); BLEND_WRITE_ALPHA(d, dst_alpha, dr, dg, db, da) BLEND_INC(s) ALPHA_INC(d, dst_alpha) } } static void MPRE(dissolve_oo) (composite_run_t *c, int num) { BLEND_TYPE *s = (BLEND_TYPE *)c->src, *d = (BLEND_TYPE *)c->dst; int sr, sg, sb, sa, dr, dg, db; int fraction = c->fraction; for (; num; num--) { BLEND_READ(s, sr, sg, sb) BLEND_READ(d, dr, dg, db) sr = (sr * fraction + 0xff) >> 8; sg = (sg * fraction + 0xff) >> 8; sb = (sb * fraction + 0xff) >> 8; sa = fraction; sa = 255 - sa; dr = sr + ((dr * sa + 0xff) >> 8); dg = sg + ((dg * sa + 0xff) >> 8); db = sb + ((db * sa + 0xff) >> 8); BLEND_WRITE(d, dr, dg, db) BLEND_INC(s) BLEND_INC(d) } } #undef I_NAME #undef BLEND_TYPE #undef BLEND_READ #undef BLEND_READ_ALPHA #undef BLEND_WRITE #undef BLEND_WRITE_ALPHA #undef BLEND_INC #undef ALPHA_READ #undef ALPHA_INC #undef COPY_TYPE #undef COPY_TYPE_PIXEL #undef COPY_ASSEMBLE_PIXEL #undef COPY_ASSEMBLE_PIXEL_ALPHA #undef COPY_WRITE #undef COPY_INC #undef FORMAT_HOW #undef INLINE_ALPHA gnustep-back-0.29.0/Source/art/blit_scrapheap.m000066400000000000000000000204171404163720200213540ustar00rootroot00000000000000/* Copyright (C) 2004 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file is never compiled. It just contains alternate and/or partial implementations of some functions in blit.m that are interesting but not (in their current form) better than the implementations in blit.m . */ /**** blit_alpha_opaque for 16/15 bpp ****/ /* Do two pixels at once. Turned out to be slower than a straight loop. */ const unsigned char *src = asrc; BLEND_TYPE *dst = (BLEND_TYPE *)adst; unsigned int nr, ng, nb, a; /* bbbb bggg gggr rrrr a0 b bbbb gggg ggrr rrr a1 bb bbbg gggg grrr rr a2 bbb bbgg gggg rrrr r a3 bbbb bggg gggr rrrr a4 b bbbb gggg ggrr rrr a5 bb bbbg gggg grrr rr a6 bbb bbgg gggg rrrr r a7 R rrrr rrrr rrrr Ggg gggg gggg ggg Bbbb bbbb bbbb b bbbb b000 0000 0000 bbbb b000 0000 0000 a0 b bbbb 0000 0000 000b bbbb 0000 0000 000 a1 bb bbb0 0000 0000 00bb bbb0 0000 0000 00 a2 bbb bb00 0000 0000 0bbb bb00 0000 0000 0 a3 bbbb b000 0000 0000 bbbb b000 0000 0000 a4 b bbbb 0000 0000 000b bbbb 0000 0000 000 a5 bb bbb0 0000 0000 00bb bbb0 0000 0000 00 a6 bbb bb00 0000 0000 0bbb bb00 0000 0000 0 a7 bbbb b000 0000 0000 bbbb b000 0000 0000 b0 b bbbb 0000 0000 000b bbbb 0000 0000 000 b1 bb bbb0 0000 0000 00bb bbb0 0000 0000 00 b2 bbb bb00 0000 0000 0bbb bb00 0000 0000 0 b3 bbbb b000 0000 0000 bbbb b000 0000 0000 b4 b bbbb 0000 0000 000b bbbb 0000 0000 000 b5 bb bbb0 0000 0000 00bb bbb0 0000 0000 00 b6 bbb bb00 0000 0000 0bbb bb00 0000 0000 0 b7 BBBB BBBB BBBB B000 XXXX XXXX XXXX XXXX XXXX X000 AAAA AAAA AAAA A000 0000 0000 bbbb bbbb 0000 0000 0000 0000 aaaa aaaa */ //printf("call with color=%02x %02x %02x\n",r,g,b); while (num >= 2) { unsigned int v1,v2; unsigned int a1; unsigned int temp; a = *((unsigned short *)src); // printf("alpha=%04x\n",a); a = a&0xffff; /* if (!a) { num -= 2; src += 2; dst += 2; continue; }*/ a = (a|(a<<8))&0xff00ff; // printf("unpack to %08x\n",a); v1 = b*a; v1 = (v1>>11)&0x001f001f; // printf("blue: %08x\n",v1); v2 = g*a; v2 = (v2>> 5)&0x07e007e0; // printf("green: %08x\n",v2); v1 = v1|v2; v2 = r*a; v2 = v2 &0xf800f800; // printf("red: %08x\n",v2); v1 = v1|v2; // printf("result: %08x\n",v1); a = 0xff00ff - a; temp = dst[0]; // printf("p1: %04x\n",temp); asm ( "movl %0,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "shll $21,%%eax\n" #else "shll $22,%%eax\n" #endif "orl %0,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "andl $0xfc00001f,%%eax\n" "andl $0xf800,%0\n" "shll $2,%0\n" #else "andl $0xf800001f,%%eax\n" "andl $0x7c00,%0\n" "shll $3,%0\n" #endif "orl %0,%%eax\n" "mul %2\n" "addl $0x0003e01f,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "addl $0x02,%%edx\n" "andl $0xfc,%%edx\n" "shll $3,%%edx\n" #else "addl $0x01,%%edx\n" "andl $0xf8,%%edx\n" "shll $2,%%edx\n" #endif "shrl $8,%%eax\n" "movl %%eax,%0\n" "andl $0x1f,%0\n" "orl %%edx,%0\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "shrl $2,%%eax\n" "andl $0xf800,%%eax\n" #else "shrl $3,%%eax\n" "andl $0x7c00,%%eax\n" #endif "orl %%eax,%0\n" : "=r" (temp) : "0" (temp), "c" (a&0xff) : "eax", "edx"); // printf("to: %04x\n",temp); v1 += temp; // printf("add in gives: %08x\n",v1); temp = dst[1]; // printf("p2: %04x\n",temp); asm ( "movl %0,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "shll $21,%%eax\n" #else "shll $22,%%eax\n" #endif "orl %0,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "andl $0xfc00001f,%%eax\n" "andl $0xf800,%0\n" "shll $2,%0\n" #else "andl $0xf800001f,%%eax\n" "andl $0x7c00,%0\n" "shll $3,%0\n" #endif "orl %0,%%eax\n" "mul %2\n" "addl $0x0003e01f,%%eax\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "addl $0x02,%%edx\n" "andl $0xfc,%%edx\n" "shll $3,%%edx\n" #else "addl $0x01,%%edx\n" "andl $0xf8,%%edx\n" "shll $2,%%edx\n" #endif "shrl $8,%%eax\n" "movl %%eax,%0\n" "andl $0x1f,%0\n" "orl %%edx,%0\n" #if FORMAT_HOW == DI_16_B5_G6_R5 "shrl $2,%%eax\n" "andl $0xf800,%%eax\n" #else "shrl $3,%%eax\n" "andl $0x7c00,%%eax\n" #endif "orl %%eax,%0\n" : "=r" (temp) : "0" (temp), "c" (a>>16) : "eax", "edx"); // printf("to: %04x\n",temp); v1 += (temp)<<16; // printf("add in gives: %08x\n",v1); *((unsigned int *)dst)=v1; num -= 2; dst += 2; src += 2; } if (num) { a = *src; // if (a) { BLEND_READ(dst, nr, ng, nb) /* nr = inv_gamma_table[nr]; ng = inv_gamma_table[ng]; nb = inv_gamma_table[nb];*/ nr = (r * a + nr * (255 - a) + 0xff) >> 8; ng = (g * a + ng * (255 - a) + 0xff) >> 8; nb = (b * a + nb * (255 - a) + 0xff) >> 8; /* nr = gamma_table[nr]; ng = gamma_table[ng]; nb = gamma_table[nb];*/ BLEND_WRITE(dst, nr, ng, nb) BLEND_INC(dst) } } /**** blit_alpha_opaque for 16/15 bpp ****/ /* use mmx. didn't help */ #if 0 && FORMAT_HOW == DI_32_BGRA static unsigned char constants[24]={0,0,0,0,0,0,0,0, 255,0,255,0,255,0,255,0, 0,0,0,0,0,0,0,0}; constants[16]=b; constants[18]=g; constants[20]=r; asm volatile ( /* " movq (%%eax), %%mm0\n" // hoistable " movq 8(%%eax), %%mm1\n"*/ // hoistable " movq 16(%%eax), %%mm2\n" "1:\n" "movzbl (%%edi), %%eax\n" "testl %%eax,%%eax\n" "jz 2f\n" "movd (%%esi), %%mm4\n" "movl %%eax, %%edx\n" "shll $8, %%edx\n" "orl %%edx, %%eax\n" "punpcklbw %%mm0, %%mm4\n" "movq %%mm1, %%mm5\n" "shll $8, %%edx\n" "orl %%edx, %%eax\n" "movd %%eax, %%mm3\n" "punpcklbw %%mm0, %%mm3\n" "psubw %%mm3, %%mm5\n" "pmullw %%mm2, %%mm3\n" "pmullw %%mm5, %%mm4\n" "paddw %%mm3, %%mm4\n" "paddw %%mm1, %%mm4\n" "psrlw $8,%%mm4\n" "packuswb %%mm0,%%mm4\n" "movd %%mm4,(%%esi)\n" "2:\n" "incl %%edi\n" "addl $4, %%esi\n" "decl %%ecx\n" "jnz 1b\n" // " emms\n" // hoistable : : "a" (&constants), "S" (adst), "D" (asrc), "c" (num)); #else /**** ****/ gnustep-back-0.29.0/Source/art/composite.m000066400000000000000000001027471404163720200204050ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "ARTGState.h" #ifndef RDS #include "x11/XWindowBuffer.h" #endif #include "blit.h" @implementation ARTGState (composite) /* Figure out what blit function we should use. If one or both of the windows are known to be totally opaque, we can optimize in many ways (see big table at the end of blit.m). Will set dst_need_alpha and blit_func if necessary. Returns new operation, or -1 it it's a noop. */ - (int) _composite_func: (BOOL)src_opaque : (BOOL)src_transparent : (BOOL)dst_opaque : (BOOL *)dst_needs_alpha : (int)op : (void (**)(composite_run_t *c, int num))blit_func_r { void (*blit_func)(composite_run_t *c, int num); *dst_needs_alpha = NO; *blit_func_r = blit_func = NULL; if (src_transparent) /* only happens with compositerect */ { switch (op) { case NSCompositeCopy: case NSCompositeSourceIn: case NSCompositeSourceOut: case NSCompositeDestinationIn: case NSCompositeDestinationAtop: case NSCompositePlusDarker: return NSCompositeClear; case NSCompositeSourceOver: case NSCompositeSourceAtop: case NSCompositeDestinationOver: case NSCompositeDestinationOut: case NSCompositeXOR: case NSCompositeHighlight: case NSCompositePlusLighter: return -1; /* noop */ } } else if (src_opaque && dst_opaque) { /* both source and destination are totally opaque */ switch (op) { case NSCompositeSourceOver: case NSCompositeSourceIn: case NSCompositeSourceAtop: case NSCompositeHighlight: return NSCompositeCopy; case NSCompositeSourceOut: case NSCompositeDestinationOut: case NSCompositeXOR: return NSCompositeClear; case NSCompositeDestinationOver: case NSCompositeDestinationIn: case NSCompositeDestinationAtop: return -1; /* noop */ case NSCompositePlusLighter: blit_func = DI.composite_plusl_oo; break; case NSCompositePlusDarker: blit_func = DI.composite_plusd_oo; break; } } else if (src_opaque) { /* source is opaque, destination has alpha */ switch (op) { case NSCompositeSourceOver: case NSCompositeHighlight: return NSCompositeCopy; case NSCompositeSourceIn: case NSCompositeSourceAtop: blit_func = DI.composite_sin_oa; break; case NSCompositeSourceOut: case NSCompositeXOR: blit_func = DI.composite_sout_oa; break; case NSCompositeDestinationOver: case NSCompositeDestinationAtop: blit_func = DI.composite_dover_oa; break; case NSCompositeDestinationIn: return -1; /* noop */ case NSCompositeDestinationOut: return NSCompositeClear; case NSCompositePlusLighter: blit_func = DI.composite_plusl_oa; break; case NSCompositePlusDarker: blit_func = DI.composite_plusd_oa; break; } } else if (dst_opaque) { /* source has alpha, destination is opaque */ switch (op) { case NSCompositeCopy: *dst_needs_alpha = YES; break; case NSCompositeSourceOver: case NSCompositeSourceAtop: case NSCompositeHighlight: blit_func = DI.composite_sover_ao; break; case NSCompositeSourceIn: return NSCompositeCopy; case NSCompositeSourceOut: return NSCompositeClear; case NSCompositeDestinationOver: return -1; /* noop */ case NSCompositeDestinationIn: case NSCompositeDestinationOut: case NSCompositeDestinationAtop: case NSCompositeXOR: *dst_needs_alpha = YES; goto both_have_alpha; case NSCompositePlusLighter: blit_func = DI.composite_plusl_ao; break; case NSCompositePlusDarker: blit_func = DI.composite_plusd_ao; break; } } else { /* both source and destination have alpha */ both_have_alpha: switch (op) { case NSCompositeSourceOver: case NSCompositeHighlight: blit_func = DI.composite_sover_aa; break; case NSCompositeSourceIn: blit_func = DI.composite_sin_aa; break; case NSCompositeSourceOut: blit_func = DI.composite_sout_aa; break; case NSCompositeSourceAtop: blit_func = DI.composite_satop_aa; break; case NSCompositeDestinationOver: blit_func = DI.composite_dover_aa; break; case NSCompositeDestinationIn: blit_func = DI.composite_din_aa; break; case NSCompositeDestinationOut: blit_func = DI.composite_dout_aa; break; case NSCompositeDestinationAtop: blit_func = DI.composite_datop_aa; break; case NSCompositeXOR: blit_func = DI.composite_xor_aa; break; case NSCompositePlusLighter: blit_func = DI.composite_plusl_aa; break; case NSCompositePlusDarker: blit_func = DI.composite_plusd_aa; break; } } *blit_func_r = blit_func; return op; } static void copy_oo(composite_run_t *c, int num) { memcpy(c->dst, c->src, num * DI.bytes_per_pixel); } static void copy_oa(composite_run_t *c, int num) { memcpy(c->dst, c->src, num * DI.bytes_per_pixel); if (DI.inline_alpha) { unsigned char *dsta = c->dst + DI.inline_alpha_ofs; for (; num; num--, dsta += 4) *dsta = 0xff; } else memset(c->dsta, 0xff, num); } static void copy_aa(composite_run_t *c, int num) { memcpy(c->dst,c->src,num*DI.bytes_per_pixel); if (!DI.inline_alpha) memcpy(c->dsta, c->srca, num); } /* Handle compositing in transformed coordinate spaces. _rect_setup sets up the a rect_trace_t structure, and each call to _rect_advance returns YES and the left and right points on the next row, or NO if all rows are done. */ typedef struct { int x[4], y[4]; int cy, ey; int left_delta; int lx, lx_frac, ldx, ldx_frac, l_de, le; int rx, rx_frac, rdx, rdx_frac, r_de, re; int cx0, cx1; } rect_trace_t; static void _rect_setup(rect_trace_t *t, NSRect r, int cx0, int cx1, NSAffineTransform *ctm, int up, int *y0, NSPoint offset) { float fx[4], fy[4]; NSPoint p; t->cx0 = cx0; t->cx1 = cx1; p = r.origin; p = [ctm transformPoint: p]; fx[0] = p.x; fy[0] = p.y; p = r.origin; p.x += r.size.width; p = [ctm transformPoint: p]; fx[1] = p.x; fy[1] = p.y; p = r.origin; p.x += r.size.width; p.y += r.size.height; p = [ctm transformPoint: p]; fx[2] = p.x; fy[2] = p.y; p = r.origin; p.y += r.size.height; p = [ctm transformPoint: p]; fx[3] = p.x; fy[3] = p.y; if (fabs(fx[0] - floor(fx[0] + .5)) < 0.001) fx[0] = floor(fx[0] + .5); if (fabs(fx[1] - floor(fx[1] + .5)) < 0.001) fx[1] = floor(fx[1] + .5); if (fabs(fx[2] - floor(fx[2] + .5)) < 0.001) fx[2] = floor(fx[2] + .5); if (fabs(fx[3] - floor(fx[3] + .5)) < 0.001) fx[3] = floor(fx[3] + .5); if (fabs(fy[0] - floor(fy[0] + .5)) < 0.001) fy[0] = floor(fy[0] + .5); if (fabs(fy[1] - floor(fy[1] + .5)) < 0.001) fy[1] = floor(fy[1] + .5); if (fabs(fy[2] - floor(fy[2] + .5)) < 0.001) fy[2] = floor(fy[2] + .5); if (fabs(fy[3] - floor(fy[3] + .5)) < 0.001) fy[3] = floor(fy[3] + .5); t->x[0] = floor(fx[0]) - offset.x; t->y[0] = offset.y - floor(fy[0]); t->x[1] = floor(fx[1]) - offset.x; t->y[1] = offset.y - floor(fy[1]); t->x[2] = floor(fx[2]) - offset.x; t->y[2] = offset.y - floor(fy[2]); t->x[3] = floor(fx[3]) - offset.x; t->y[3] = offset.y - floor(fy[3]); /* If we're tracing the 'other way', we just flip the y-coordinates and unflip when returning them */ if (up) { t->y[0] = -t->y[0]; t->y[1] = -t->y[1]; t->y[2] = -t->y[2]; t->y[3] = -t->y[3]; } t->cy = t->y[t->le = 0]; if (t->y[1] < t->cy) t->cy = t->y[t->le = 1]; if (t->y[2] < t->cy) t->cy = t->y[t->le = 2]; if (t->y[3] < t->cy) t->cy = t->y[t->le = 3]; t->re = t->le; t->ey = t->y[0]; if (t->y[1] > t->ey) t->ey = t->y[1]; if (t->y[2] > t->ey) t->ey = t->y[2]; if (t->y[3] > t->ey) t->ey = t->y[3]; if (t->x[(t->le + 1) & 3] < t->x[(t->le - 1) & 3]) t->left_delta = 1; else t->left_delta = -1; /* silence the compiler */ t->lx = t->lx_frac = t->ldx = t->ldx_frac = t->l_de = 0; t->rx = t->rx_frac = t->rdx = t->rdx_frac = t->r_de = 0; if (up) *y0 = -t->cy; else *y0 = t->cy; } static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1) { int next; if (t->cy > t->ey) return NO; if (t->cy == t->y[t->le]) { next = (t->le + t->left_delta) & 3; if (t->y[t->le] == t->y[next]) { t->le = next; next = (t->le + t->left_delta) & 3; } t->l_de = t->y[next] - t->y[t->le]; if (!t->l_de) return NO; t->lx = t->x[t->le]; t->lx_frac = 0; t->ldx = (t->x[next] - t->x[t->le]) / t->l_de; t->ldx_frac = (t->x[next] - t->x[t->le]) % t->l_de; t->le = next; } else { t->lx += t->ldx; t->lx_frac += t->ldx_frac; if (t->lx_frac < 0) t->lx--, t->lx_frac += t->l_de; if (t->lx_frac > t->l_de) t->lx++, t->lx_frac -= t->l_de; } if (t->cy == t->y[t->re]) { next = (t->re - t->left_delta) & 3; if (t->y[t->re] == t->y[next]) { t->re = next; next = (t->re - t->left_delta) & 3; } t->r_de = t->y[next] - t->y[t->re]; if (!t->r_de) return NO; t->rx = t->x[t->re]; t->rx_frac = t->r_de - 1; /* TODO? */ t->rdx = (t->x[next] - t->x[t->re]) / t->r_de; t->rdx_frac = (t->x[next] - t->x[t->re]) % t->r_de; t->re = next; } else { t->rx += t->rdx; t->rx_frac += t->rdx_frac; if (t->rx_frac < 0) t->rx--, t->rx_frac += t->r_de; if (t->rx_frac > t->r_de) t->rx++, t->rx_frac -= t->r_de; } if (t->rx > t->lx && t->rx >= t->cx0 && t->lx < t->cx1) { *x0 = t->lx - t->cx0; if (*x0 < 0) *x0 = 0; *x1 = t->rx - t->cx0; if (*x1 > t->cx1 - t->cx0) *x1 = t->cx1 - t->cx0; } else { *x0 = *x1 = 0; } t->cy++; return YES; } - (void) compositeGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)composite_op { ARTGState *ags = (ARTGState *)source; unsigned char *dst, *dst_alpha, *src, *src_alpha; int op; void (*blit_func)(composite_run_t *c, int num) = NULL; NSPoint sp, dp; int cx0,cy0,cx1,cy1; int sx0,sy0; int sbpl, dbpl; int asbpl, adbpl; rect_trace_t state; /* 0 = top->down, 1 = bottom->up */ /* TODO: this does not handle the horizontal case either 0=top->down, left->right, 2=top->down, right->left or keep 0 and add 2=top->down, make temporary copy of source could allocate a temporary array on the stack large enough to hold one row and do the operations on it */ /* currently 2=top->down, be careful with overlapping rows */ /* order=1 is handled generically by flipping sbpl and dbpl and adjusting the pointers. order=2 is handled specially */ int order; int delta; if (!wi || !wi->data || !ags->wi || !ags->wi->data) return; if (all_clipped) return; { BOOL dst_needs_alpha; op = [self _composite_func: !ags->wi->has_alpha : NO : !wi->has_alpha : &dst_needs_alpha : composite_op : &blit_func]; if (op == -1) return; if (dst_needs_alpha) { [wi needsAlpha]; if (!wi->has_alpha) return; } } /* these ignore the source window, so we send them off to compositerect: op: */ if (op == NSCompositeClear || op == GSCompositeHighlight) { [self compositerect: NSMakeRect(aPoint.x, aPoint.y, aRect.size.width, aRect.size.height) op: op]; return; } /* Set up all the pointers and clip things */ dbpl = wi->bytes_per_line; sbpl = ags->wi->bytes_per_line; cx0 = clip_x0; cy0 = clip_y0; cx1 = clip_x1; cy1 = clip_y1; sp = [ags->ctm transformPoint: aRect.origin]; sp.x = floor(sp.x - ags->offset.x); sp.y = floor(ags->offset.y - sp.y); dp = [ctm transformPoint: aPoint]; dp.x = floor(dp.x - offset.x); dp.y = floor(offset.y - dp.y); if (dp.x - cx0 > sp.x) cx0 = dp.x - sp.x; if (dp.y - cy0 > sp.y) cy0 = dp.y - sp.y; if (cx1 - dp.x > ags->wi->sx - sp.x) cx1 = dp.x + ags->wi->sx - sp.x; if (cy1 - dp.y > ags->wi->sy - sp.y) cy1 = dp.y + ags->wi->sy - sp.y; sx0 = sp.x - dp.x + cx0; sy0 = sp.y - dp.y + cy0; dst = wi->data + cx0 * DI.bytes_per_pixel + cy0 * dbpl; src = ags->wi->data + sx0 * DI.bytes_per_pixel + sy0 * sbpl; if (ags->wi->has_alpha && op == NSCompositeCopy) { [wi needsAlpha]; if (!wi->has_alpha) return; } if (ags->wi->has_alpha) { if (DI.inline_alpha) src_alpha = src; else src_alpha = ags->wi->alpha + sx0 + sy0 * ags->wi->sx; asbpl = ags->wi->sx; } else { src_alpha = NULL; asbpl = 0; } if (wi->has_alpha) { if (DI.inline_alpha) dst_alpha = dst; else dst_alpha = wi->alpha + cx0 + cy0 * wi->sx; adbpl = wi->sx; } else { dst_alpha = NULL; adbpl = 0; } cy1 -= cy0; cx1 -= cx0; if (cx0<0 || cy0<0 || cx0+cx1>wi->sx || cy0+cy1>wi->sy || sx0<0 || sy0<0 || sx0+cx1>ags->wi->sx || sy0+cy1>ags->wi->sy) { NSLog(@"Warning: invalid coordinates in composite: (%g %g)+(%g %g) -> (%g %g) got (%i %i) (%i %i) +(%i %i)", aRect.origin.x,aRect.origin.x,aRect.size.width,aRect.size.height,aPoint.x,aPoint.y, cx0,cy0,sx0,sy0,cx1,cy1); return; } if (cx1<=0 || cy1<=0) return; /* To handle overlapping areas properly, we sometimes need to do things bottom-up instead of top-down. If so, we flip the coordinates here. */ order = 0; if (ags->wi == self->wi && sy0 <= cy0) { order = 1; dst += dbpl * (cy1 - 1); src += sbpl * (cy1 - 1); dst_alpha += adbpl * (cy1 - 1); src_alpha += asbpl * (cy1 - 1); dbpl = -dbpl; sbpl = -sbpl; adbpl = -adbpl; asbpl = -asbpl; if (sy0 == cy0) { if ((sx0 >= cx0 && sx0 <= cx0 + cx1) || (cx0 >= sx0 && cx0 <= sx0 + cx1)) { order = 2; } } } if (op == NSCompositeCopy) { if (ags->wi->has_alpha) blit_func = copy_aa; else if (wi->has_alpha) blit_func = copy_oa; else blit_func = copy_oo; } if (!blit_func) { NSLog(@"unimplemented: compositeGState: %p fromRect: (%g %g)+(%g %g) toPoint: (%g %g) op: %i", source, aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height, aPoint.x, aPoint.y, op); return; } { int ry; int x0, x1; _rect_setup(&state, aRect, sx0, sx0 + cx1, ags->ctm, order, &ry, ags->offset); if (order) { if (ry < sy0) return; delta = sy0 + cy1 - ry; } else { if (ry >= sy0 + cy1) return; delta = ry - sy0; } if (delta > 0) { src += sbpl * delta; src_alpha += asbpl * delta; dst += dbpl * delta; dst_alpha += adbpl * delta; } else if (delta < 0) { delta = -delta; while (delta) { if (!_rect_advance(&state,&x0,&x1)) { break; } delta--; } if (delta) return; } } /* this breaks the alpha pointer in some, but that's ok since in all those cases, the alpha pointer isn't used (inline alpha or no alpha) */ if (order == 2) { unsigned char tmpbuf[cx1 * DI.bytes_per_pixel]; unsigned char tmpbufa[cx1]; int y; composite_run_t c; int x0, x1; c.dst = dst; c.dsta = dst_alpha; c.src = tmpbuf; c.srca = tmpbufa; for (y = cy1 - delta - 1; y >= 0; y--) { if (!_rect_advance(&state,&x0,&x1)) break; x1 -= x0; c.dst += x0 * DI.bytes_per_pixel; c.dsta += x0; /* TODO: update c.dst and c.dsta properly when x1==0 */ if (x1) { memcpy(tmpbuf, src + x0 * DI.bytes_per_pixel, x1 * DI.bytes_per_pixel); if (ags->wi->has_alpha && !DI.inline_alpha) memcpy(tmpbufa, src_alpha + x0, x1); if (!clip_span) { blit_func(&c, x1); c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; } else { unsigned int *span, *end; BOOL state = NO; span = &clip_span[clip_index[y + cy0 - clip_y0]]; end = &clip_span[clip_index[y + cy0 - clip_y0 + 1]]; x0 = x0 + cx0 - clip_x0; x1 += x0; while (span != end && *span < x0) { state = !state; span++; if (span == end) break; } if (span != end) { while (span != end && *span < x1) { if (state) blit_func(&c, *span - x0); c.dst += (*span - x0) * DI.bytes_per_pixel; c.dsta += (*span - x0); c.src += (*span - x0) * DI.bytes_per_pixel; c.srca += (*span - x0); x0 = *span; state = !state; span++; if (span == end) break; } if (state) blit_func(&c, x1 - x0); } x0 = x0 - cx0 + clip_x0; c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; c.src = tmpbuf; c.srca = tmpbufa; } } src += sbpl; src_alpha += asbpl; } } else { int y; composite_run_t c; int x0, x1; c.dst = dst; c.dsta = dst_alpha; c.src = src; c.srca = src_alpha; if (order) y = cy1 - delta - 1; else y = delta; for (; y < cy1 && y >= 0; order? y-- : y++) { if (!_rect_advance(&state,&x0,&x1)) break; x1 -= x0; if (x1 <= 0) { c.dst += dbpl; c.dsta += adbpl; c.src += sbpl; c.srca += asbpl; continue; } c.dst += x0 * DI.bytes_per_pixel; c.dsta += x0; c.src += x0 * DI.bytes_per_pixel; c.srca += x0; if (!clip_span) { blit_func(&c, x1); c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; c.src += sbpl - x0 * DI.bytes_per_pixel; c.srca += asbpl - x0; } else { unsigned int *span, *end; BOOL state = NO; span = &clip_span[clip_index[y + cy0 - clip_y0]]; end = &clip_span[clip_index[y + cy0 - clip_y0 + 1]]; x0 = x0 + cx0 - clip_x0; x1 += x0; while (span != end && *span < x0) { state = !state; span++; if (span == end) break; } if (span != end) { while (span != end && *span < x1) { if (state) blit_func(&c, *span - x0); c.dst += (*span - x0) * DI.bytes_per_pixel; c.dsta += (*span - x0); c.src += (*span - x0) * DI.bytes_per_pixel; c.srca += (*span - x0); x0 = *span; state = !state; span++; if (span == end) break; } if (state) blit_func(&c, x1 - x0); } x0 = x0 - cx0 + clip_x0; c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; c.src += sbpl - x0 * DI.bytes_per_pixel; c.srca += asbpl - x0; } } } UPDATE_UNBUFFERED } - (void) dissolveGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint delta: (CGFloat)fraction { /* much setup code shared with compositeGState:... */ ARTGState *ags = (ARTGState *)source; unsigned char *dst, *dst_alpha, *src, *src_alpha; void (*blit_func)(composite_run_t *c, int num) = NULL; NSPoint sp, dp; int cx0,cy0,cx1,cy1; int sx0,sy0; int sbpl, dbpl; int asbpl, adbpl; rect_trace_t state; /* 0 = top->down, 1 = bottom->up */ /* TODO: this does not handle the horizontal case either 0=top->down, left->right, 2=top->down, right->left or keep 0 and add 2=top->down, make temporary copy of source could allocate a temporary array on the stack large enough to hold one row and do the operations on it */ /* currently 2=top->down, be careful with overlapping rows */ /* order=1 is handled generically by flipping sbpl and dbpl and adjusting the pointers. order=2 is handled specially */ int order; int delta; if (!wi || !wi->data || !ags->wi || !ags->wi->data) return; if (all_clipped) return; /* Set up all the pointers and clip things */ dbpl = wi->bytes_per_line; sbpl = ags->wi->bytes_per_line; cx0 = clip_x0; cy0 = clip_y0; cx1 = clip_x1; cy1 = clip_y1; sp = [ags->ctm transformPoint: aRect.origin]; sp.x = floor(sp.x - ags->offset.x); sp.y = floor(ags->offset.y - sp.y); dp = [ctm transformPoint: aPoint]; dp.x = floor(dp.x - offset.x); dp.y = floor(offset.y - dp.y); if (dp.x - cx0 > sp.x) cx0 = dp.x - sp.x; if (dp.y - cy0 > sp.y) cy0 = dp.y - sp.y; if (cx1 - dp.x > ags->wi->sx - sp.x) cx1 = dp.x + ags->wi->sx - sp.x; if (cy1 - dp.y > ags->wi->sy - sp.y) cy1 = dp.y + ags->wi->sy - sp.y; sx0 = sp.x - dp.x + cx0; sy0 = sp.y - dp.y + cy0; dst = wi->data + cx0 * DI.bytes_per_pixel + cy0 * dbpl; src = ags->wi->data + sx0 * DI.bytes_per_pixel + sy0 * sbpl; if (ags->wi->has_alpha) { if (DI.inline_alpha) src_alpha = src; else src_alpha = ags->wi->alpha + sx0 + sy0 * ags->wi->sx; asbpl = ags->wi->sx; } else { src_alpha = NULL; asbpl = 0; } if (wi->has_alpha) { if (DI.inline_alpha) dst_alpha = dst; else dst_alpha = wi->alpha + cx0 + cy0 * wi->sx; adbpl = wi->sx; } else { dst_alpha = NULL; adbpl = 0; } cy1 -= cy0; cx1 -= cx0; if (cx0<0 || cy0<0 || cx0+cx1>wi->sx || cy0+cy1>wi->sy || sx0<0 || sy0<0 || sx0+cx1>ags->wi->sx || sy0+cy1>ags->wi->sy) { NSLog(@"Warning: invalid coordinates in dissolve: (%g %g)+(%g %g) -> (%g %g) got (%i %i) (%i %i) +(%i %i)", aRect.origin.x,aRect.origin.x,aRect.size.width,aRect.size.height,aPoint.x,aPoint.y, cx0,cy0,sx0,sy0,cx1,cy1); return; } if (cx1<=0 || cy1<=0) return; /* To handle overlapping areas properly, we sometimes need to do things bottom-up instead of top-down. If so, we flip the coordinates here. */ order = 0; if (ags->wi == self->wi && sy0 <= cy0) { order = 1; dst += dbpl * (cy1 - 1); src += sbpl * (cy1 - 1); dst_alpha += adbpl * (cy1 - 1); src_alpha += asbpl * (cy1 - 1); dbpl = -dbpl; sbpl = -sbpl; adbpl = -adbpl; asbpl = -asbpl; if (sy0 == cy0) { if ((sx0 >= cx0 && sx0 <= cx0 + cx1) || (cx0 >= sx0 && cx0 <= sx0 + cx1)) { order = 2; } } } if (ags->wi->has_alpha && wi->has_alpha) blit_func = DI.dissolve_aa; else if (wi->has_alpha) blit_func = DI.dissolve_oa; else if (ags->wi->has_alpha) blit_func = DI.dissolve_ao; else blit_func = DI.dissolve_oo; if (!blit_func) { NSLog(@"unimplemented: dissolveGState: %p fromRect: (%g %g)+(%g %g) toPoint: (%g %g) delta: %g", source, aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height, aPoint.x, aPoint.y, fraction); return; } { int ry; int x0, x1; _rect_setup(&state, aRect, sx0, sx0 + cx1, ags->ctm, order, &ry, ags->offset); if (order) { if (ry < sy0) return; delta = sy0 + cy1 - ry; } else { if (ry >= sy0 + cy1) return; delta = ry - sy0; } if (delta > 0) { src += sbpl * delta; src_alpha += asbpl * delta; dst += dbpl * delta; dst_alpha += adbpl * delta; } else if (delta < 0) { delta = -delta; while (delta) { if (!_rect_advance(&state,&x0,&x1)) { break; } delta--; } if (delta) return; } } /* this breaks the alpha pointer in some cases, but that's ok since in all those cases, the alpha pointer isn't used (inline alpha or no alpha) */ if (order == 2) { unsigned char tmpbuf[cx1 * DI.bytes_per_pixel]; unsigned char tmpbufa[cx1]; int y; composite_run_t c; int x0, x1; c.dst = dst; c.dsta = dst_alpha; c.src = tmpbuf; c.srca = tmpbufa; c.fraction = fraction * 255; for (y = cy1 - delta - 1; y >= 0; y--) { if (!_rect_advance(&state,&x0,&x1)) break; x1 -= x0; c.dst += x0 * DI.bytes_per_pixel; c.dsta += x0; if (x1) { memcpy(tmpbuf, src + x0 * DI.bytes_per_pixel, x1 * DI.bytes_per_pixel); if (ags->wi->has_alpha && !DI.inline_alpha) memcpy(tmpbufa, src_alpha + x0, x1); if (!clip_span) { blit_func(&c, x1); c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; } else { unsigned int *span, *end; BOOL state = NO; span = &clip_span[clip_index[y + cy0 - clip_y0]]; end = &clip_span[clip_index[y + cy0 - clip_y0 + 1]]; x0 = x0 + cx0 - clip_x0; x1 += x0; while (span != end && *span < x0) { state = !state; span++; if (span == end) break; } if (span != end) { while (span != end && *span < x1) { if (state) blit_func(&c, *span - x0); c.dst += (*span - x0) * DI.bytes_per_pixel; c.dsta += (*span - x0); c.src += (*span - x0) * DI.bytes_per_pixel; c.srca += (*span - x0); x0 = *span; state = !state; span++; if (span == end) break; } if (state) blit_func(&c, x1 - x0); } x0 = x0 - cx0 + clip_x0; c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; c.src = tmpbuf; c.srca = tmpbufa; } } src += sbpl; src_alpha += asbpl; } } else { int y; composite_run_t c; int x0, x1; c.dst = dst; c.dsta = dst_alpha; c.src = src; c.srca = src_alpha; c.fraction = fraction * 255; if (order) y = cy1 - delta - 1; else y = delta; for (; y < cy1 && y >= 0; order? y-- : y++) { if (!_rect_advance(&state,&x0,&x1)) break; x1 -= x0; if (x1 <= 0) { c.dst += dbpl; c.dsta += adbpl; c.src += sbpl; c.srca += asbpl; continue; } c.dst += x0 * DI.bytes_per_pixel; c.dsta += x0; c.src += x0 * DI.bytes_per_pixel; c.srca += x0; if (!clip_span) { blit_func(&c, x1); c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; c.src += sbpl - x0 * DI.bytes_per_pixel; c.srca += asbpl - x0; } else { unsigned int *span, *end; BOOL state = NO; span = &clip_span[clip_index[y + cy0 - clip_y0]]; end = &clip_span[clip_index[y + cy0 - clip_y0 + 1]]; x0 = x0 + cx0 - clip_x0; x1 += x0; while (span != end && *span < x0) { state = !state; span++; if (span == end) break; } if (span != end) { while (span != end && *span < x1) { if (state) blit_func(&c, *span - x0); c.dst += (*span - x0) * DI.bytes_per_pixel; c.dsta += (*span - x0); c.src += (*span - x0) * DI.bytes_per_pixel; c.srca += (*span - x0); x0 = *span; state = !state; span++; if (span == end) break; } if (state) blit_func(&c, x1 - x0); } x0 = x0 - cx0 + clip_x0; c.dst += dbpl - x0 * DI.bytes_per_pixel; c.dsta += adbpl - x0; c.src += sbpl - x0 * DI.bytes_per_pixel; c.srca += asbpl - x0; } } } UPDATE_UNBUFFERED } - (void) compositeGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { if (op == NSCompositeSourceOver) { [self dissolveGState: source fromRect: aRect toPoint: aPoint delta: delta]; } else { [self compositeGState: source fromRect: aRect toPoint: aPoint op: op]; } } - (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op { /* much setup code shared with compositeGState:... */ unsigned char *dst, *dst_alpha; int dbpl, adbpl; int cx0, cy0, cx1, cy1; void (*blit_func)(composite_run_t *c, int num); rect_trace_t state; int delta; if (!wi || !wi->data) return; if (all_clipped) return; { BOOL dest_needs_alpha; /* TODO: which color? using fill_color for now */ op = [self _composite_func: fill_color[3] == 255 : fill_color[3] == 0 : !wi->has_alpha : &dest_needs_alpha : op : &blit_func]; if (op == -1) return; if (dest_needs_alpha || op == NSCompositeClear) { [wi needsAlpha]; if (!wi->has_alpha) return; } } dbpl = wi->bytes_per_line; adbpl = wi->sx; cx0 = clip_x0; cy0 = clip_y0; cx1 = clip_x1; cy1 = clip_y1; dst = wi->data + cx0 * DI.bytes_per_pixel + cy0 * dbpl; dst_alpha = wi->alpha + cx0 + cy0 * wi->sx; cx1 -= cx0; cy1 -= cy0; { int ry; int x0, x1; _rect_setup(&state, aRect, cx0, cx0 + cx1, ctm, 0, &ry, offset); if (ry >= cy0 + cy1) return; delta = ry - cy0; if (delta > 0) { dst += dbpl * delta; dst_alpha += adbpl * delta; } else if (delta < 0) { delta = -delta; while (delta) { if (!_rect_advance(&state,&x0,&x1)) break; delta--; } if (delta) return; } } #define DO_STUFF(HANDLE_SPAN) \ { \ int y; \ int x0, x1; \ int n; \ \ if (clip_span) \ { \ for (y = delta; y < cy1; y++) \ { \ unsigned int *span, *end; \ BOOL clip_state = NO; \ \ if (!_rect_advance(&state,&x0,&x1)) \ break; \ \ x1 -= x0; \ if (!x1) \ { \ dst += dbpl; \ dst_alpha += adbpl; \ continue; \ } \ \ dst += x0 * DI.bytes_per_pixel; \ dst_alpha += x0; \ \ span = &clip_span[clip_index[y + cy0 - clip_y0]]; \ end = &clip_span[clip_index[y + cy0 - clip_y0 + 1]]; \ \ x0 = x0 + cx0 - clip_x0; \ x1 += x0; \ while (span != end && *span < x0) \ { \ clip_state = !clip_state; \ span++; \ if (span == end) \ break; \ } \ if (span != end) \ { \ while (span != end && *span < x1) \ { \ if (clip_state) \ { \ n = (*span - x0); \ HANDLE_SPAN \ } \ dst += (*span - x0) * DI.bytes_per_pixel; \ dst_alpha += (*span - x0); \ x0 = *span; \ \ clip_state = !clip_state; \ span++; \ if (span == end) \ break; \ } \ if (clip_state) \ { \ n = x1 - x0; \ HANDLE_SPAN \ } \ } \ x0 = x0 - cx0 + clip_x0; \ \ dst += dbpl - x0 * DI.bytes_per_pixel; \ dst_alpha += adbpl - x0; \ } \ } \ else \ { \ for (y = delta; y < cy1; y++) \ { \ if (!_rect_advance(&state,&x0,&x1)) \ break; \ \ x1 -= x0; \ if (!x1) \ { \ dst += dbpl; \ dst_alpha += adbpl; \ continue; \ } \ \ dst += x0 * DI.bytes_per_pixel; \ dst_alpha += x0; \ \ n = x1; \ HANDLE_SPAN \ \ dst += dbpl - x0 * DI.bytes_per_pixel; \ dst_alpha += adbpl - x0; \ } \ } \ } if (op == NSCompositeClear) { DO_STUFF( memset(dst, 0, n * DI.bytes_per_pixel); if (!DI.inline_alpha) memset(dst_alpha, 0, n); ) } else if (op == GSCompositeHighlight) { DO_STUFF( { unsigned char *d = dst; n *= DI.bytes_per_pixel; for (; n; n--, d++) (*d) ^= 0xff; } ) } else if (op == NSCompositeCopy) { render_run_t ri; ri.dst = dst; /* We don't want to blend, so we premultiply and fill the alpha channel manually. */ ri.a = fill_color[3]; ri.r = (fill_color[0] * ri.a + 0xff) >> 8; ri.g = (fill_color[1] * ri.a + 0xff) >> 8; ri.b = (fill_color[2] * ri.a + 0xff) >> 8; if (ri.a != 255 && !wi->has_alpha) return; DO_STUFF( ri.dst = dst; DI.render_run_opaque(&ri, n); if (ri.a != 255) { if (DI.inline_alpha) { /* TODO: needs to change to support inline alpha for non-32-bit modes */ unsigned char *p; for (p = dst; n; n--, p += 4) p[DI.inline_alpha_ofs] = ri.a; } else { memset(dst_alpha, ri.a, n); } } ) } else if (blit_func) { /* this is slightly ugly, but efficient */ unsigned char buf[DI.bytes_per_pixel * cx1]; unsigned char abuf[fill_color[3] == 255? 1 : cx1]; composite_run_t c; c.src = buf; if (fill_color[3] != 255) c.srca = abuf; else c.srca = NULL; { render_run_t ri; ri.dst = buf; ri.dsta = NULL; /* Note that we premultiply _here_ and set the alpha channel manually (for speed; no reason to do slow blending when we just want a straight blit of all channels). */ ri.a = fill_color[3]; ri.r = (fill_color[0] * ri.a + 0xff) >> 8; ri.g = (fill_color[1] * ri.a + 0xff) >> 8; ri.b = (fill_color[2] * ri.a + 0xff) >> 8; DI.render_run_opaque(&ri, cx1); if (fill_color[3] != 255) { if (DI.inline_alpha) { int i; unsigned char *s; /* TODO: needs to change to support inline alpha for non-32-bit modes */ for (i = 0, s = buf + DI.inline_alpha_ofs; i < cx1; i++, s += 4) *s = ri.a; } else memset(abuf, ri.a, cx1); } } DO_STUFF( c.dst = dst; c.dsta = dst_alpha; blit_func(&c, n); ) } else { NSLog(@"unimplemented compositerect: (%g %g)+(%g %g) op: %lu", aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height, op); } UPDATE_UNBUFFERED } @end gnustep-back-0.29.0/Source/art/ftfont.h000066400000000000000000000056511404163720200176720ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ftfont_h #define ftfont_h #import "blit.h" @class NSAffineTransform; @protocol FTFontInfo -(void) drawString: (const char *)s at: (int)x : (int)y to: (int)x0 : (int)y0 : (int)x1 : (int)y1 : (unsigned char *)buf : (int)bpl : (unsigned char *)abuf : (int)abpl color: (unsigned char)r : (unsigned char)g : (unsigned char)b : (unsigned char)alpha transform: (NSAffineTransform *)transform deltas: (const CGFloat *)delta_data : (int)delta_size : (int)delta_flags widthChar: (int) wch drawinfo: (struct draw_info_s *)di; -(void) drawGlyphs: (const NSGlyph *)glyphs : (int)length at: (int)x : (int)y to: (int)x0 : (int)y0 : (int)x1 : (int)y1 : (unsigned char *)buf : (int)bpl color: (unsigned char)r : (unsigned char)g : (unsigned char)b : (unsigned char)alpha transform: (NSAffineTransform *)transform drawinfo: (struct draw_info_s *)di; -(void) drawGlyphs: (const NSGlyph *)glyphs : (int)length at: (int)x : (int)y to: (int)x0 : (int)y0 : (int)x1 : (int)y1 : (unsigned char *)buf : (int)bpl alpha: (unsigned char *)abuf : (int)abpl color: (unsigned char)r : (unsigned char)g : (unsigned char)b : (unsigned char)alpha transform: (NSAffineTransform *)transform drawinfo: (struct draw_info_s *)di; -(void) outlineString: (const char *)s at: (CGFloat)x : (CGFloat)y gstate: (void *)func_param; +(void) initializeBackend; @end #import #import FT_CACHE_H #import #import "FTFaceInfo.h" #define CACHE_SIZE 257 @interface FTFontInfo : GSFontInfo { @public int pix_width, pix_height; FTC_FaceID faceId; FTC_ImageTypeRec imageType; FTC_ScalerRec scaler; int unicodeCmap; BOOL screenFont; FTFaceInfo *face_info; FT_Size ft_size; /* Profiling (2003-11-14) shows that calls to -advancementForGlyph: accounted for roughly 20% of layout time. This cache reduces it to (currently) insignificant levels. */ unsigned int cachedGlyph[CACHE_SIZE]; NSSize cachedSize[CACHE_SIZE]; CGFloat lineHeight; } @end #endif gnustep-back-0.29.0/Source/art/ftfont.m000066400000000000000000002131721404163720200176760ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "gsc/GSGState.h" #import "ftfont.h" #import "FTFontEnumerator.h" #define DI (*di) /** font handling interface **/ #include FT_FREETYPE_H #include FT_CACHE_IMAGE_H #include FT_CACHE_SMALL_BITMAPS_H #include FT_CACHE_CHARMAP_H #include FT_OUTLINE_H /* TODO: finish screen font handling */ /* from the back-art-subpixel-text defaults key 0: normal rendering 1: subpixel, rgb 2: subpixel, bgr */ static int subpixel_text; @interface FTFontInfo_subpixel : FTFontInfo @end static FT_Library ft_library; static FTC_Manager ftc_manager; static FTC_ImageCache ftc_imagecache; static FTC_SBitCache ftc_sbitcache; static FTC_CMapCache ftc_cmapcache; /* * Helper method used inside of FTC_Manager to create an FT_FACE. */ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_Face *pface) { FT_Error err; NSArray *rfi = (NSArray *)fid; int i, c = [rfi count]; const char *face_name = [[rfi objectAtIndex: 0] fileSystemRepresentation]; NSDebugLLog(@"ftfont", @"ft_get_face: %@ '%s'", rfi, face_name); err = FT_New_Face(lib, face_name, 0, pface); if (err) { NSLog(@"Error when loading '%@' (%08x)", [rfi objectAtIndex: 0], err); return err; } for (i = 1; i < c; i++) { face_name = [[rfi objectAtIndex: i] fileSystemRepresentation]; NSDebugLLog(@"ftfont", @" do '%s'", face_name); err = FT_Attach_File(*pface, face_name); if (err) { NSLog(@"Error when loading '%@' (%08x)", [rfi objectAtIndex: i], err); /* pretend it's alright */ } } return 0; } @implementation FTFontInfo - (id) initWithFontName: (NSString *)name matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont { NSArray *rfi; FTFaceInfo *font_entry; FT_Error error; if (subpixel_text) { [self release]; self = [FTFontInfo_subpixel alloc]; } self = [super init]; if (!self) return nil; screenFont = p_screenFont; NSDebugLLog(@"ftfont", @"[%@ -initWithFontName: %@ matrix: (%g %g %g %g %g %g)] %i", self, name, fmatrix[0], fmatrix[1], fmatrix[2], fmatrix[3], fmatrix[4], fmatrix[5], p_screenFont); font_entry = [FTFontEnumerator fontWithName: name]; if (!font_entry) { RELEASE(self); return nil; } face_info = font_entry; weight = font_entry->weight; traits = font_entry->traits; fontName = [name copy]; familyName = [face_info->familyName copy]; memcpy(matrix, fmatrix, sizeof(matrix)); /* Using utf8 is a bit ugly, but it works. Besides, the bulk of the text comes as glyphs anyway. */ mostCompatibleStringEncoding = NSUTF8StringEncoding; encodingScheme = @"iso10646-1"; if (screenFont) { /* Round up; makes the text more legible. */ matrix[0] = ceil(matrix[0]); if (matrix[3] < 0.0) matrix[3] = floor(matrix[3]); else matrix[3] = ceil(matrix[3]); } pix_width = fabs(matrix[0]); pix_height = fabs(matrix[3]); rfi = font_entry->files; if (screenFont && font_entry->num_sizes && pix_width == pix_height) { int i; for (i = 0; i < font_entry->num_sizes; i++) { if (font_entry->sizes[i].pixel_size == pix_width) { rfi = font_entry->sizes[i].files; break; } } } faceId = (FTC_FaceID)rfi; imageType.face_id = faceId; imageType.width = pix_width; imageType.height = pix_height; /* TODO: Flags? */ scaler.face_id = faceId; scaler.width = pix_width; scaler.height = pix_height; scaler.pixel = 1; if ((error = FTC_Manager_LookupSize(ftc_manager, &scaler, &ft_size))) { NSLog(@"FTC_Manager_LookupSize() failed for '%@', error %08x!", name, error); RELEASE(self); return nil; } /* TODO: these are _really_ messed up when fonts are flipped */ /* TODO: need to look carefully at these and make sure they are correct */ ascender = fabs(((int)ft_size->metrics.ascender) / 64.0); descender = fabs(((int)ft_size->metrics.descender) / 64.0); lineHeight = (int)ft_size->metrics.height / 64.0; xHeight = (int)ft_size->metrics.y_ppem / 64.0; maximumAdvancement = NSMakeSize((ft_size->metrics.max_advance / 64.0), 0.0); fontBBox = NSMakeRect(0, -descender, maximumAdvancement.width, ascender + descender); descender = -descender; /* printf("(%@) h=%g a=%g d=%g max=(%g %g) (%g %g)+(%g %g)\n",name, xHeight, ascender, descender, maximumAdvancement.width, maximumAdvancement.height, fontBBox.origin.x, fontBBox.origin.y, fontBBox.size.width, fontBBox.size.height);*/ { int i; FT_Face face = ft_size->face; FT_CharMap cmap; FT_Encoding e; unicodeCmap = -1; if (!face) { NSLog(@"Found no face for font '%@'", name); RELEASE(self); return nil; } for (i = 0; i < face->num_charmaps; i++) { cmap = face->charmaps[i]; e = cmap->encoding; if (e == FT_ENCODING_UNICODE) { unicodeCmap = i; break; } } } if (screenFont) { int flags; if (pix_width == pix_height && pix_width < 16 && pix_height >= 8) { int rh = face_info->render_hints_hack; if (rh & 0x10000) { flags = FT_LOAD_TARGET_NORMAL; rh = (rh >> 8) & 0xff; } else { flags = FT_LOAD_TARGET_MONO; rh = rh & 0xff; } if (rh & 1) flags |= FT_LOAD_FORCE_AUTOHINT; if (!(rh & 2)) flags |= FT_LOAD_NO_HINTING; } else if (pix_width < 8) flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING; else flags = FT_LOAD_TARGET_NORMAL; imageType.flags = flags; } else { imageType.flags = FT_LOAD_NO_HINTING; } /* Here, we simply need to make sure that we don't get any false matches the first time a particular cache entry is used. Thus, we only need to initialize the first entry. For all other entries, cachedGlyph[i] will be 0, and that's a glyph that can't possibly hash to any entry except entry #0, so it won't cause any false matches. */ cachedGlyph[0] = 1; return self; } - (NSString*) displayName { return face_info->displayName; } - (void) set { NSLog(@"ignore -set method of font '%@'", fontName); } - (NSCharacterSet*) coveredCharacterSet { if (coveredCharacterSet == nil) { NSMutableCharacterSet *m = [NSMutableCharacterSet new]; unsigned count = 0; FT_Face face; FT_ULong charcode; FT_UInt glyphindex; FT_Size size; if (FTC_Manager_LookupSize(ftc_manager, &scaler, &size)) return nil; face = size->face; charcode = FT_Get_First_Char(face, &glyphindex); if (glyphindex != 0) { NSRange range; range.location = charcode; range.length = 1; while (glyphindex != 0) { count++; if (charcode >= 1114112) { break; } if (charcode == NSMaxRange(range)) { range.length++; } else { [m addCharactersInRange: range]; range.location = charcode; range.length = 1; } charcode = FT_Get_Next_Char(face, charcode, &glyphindex); } if (range.length > 0) { [m addCharactersInRange: range]; } } coveredCharacterSet = [m copy]; numberOfGlyphs = count; RELEASE(m); } return coveredCharacterSet; } - (CGFloat) defaultLineHeightForFont { return lineHeight; } - (NSUInteger) numberOfGlyphs { if (coveredCharacterSet == nil) { [self coveredCharacterSet]; } return numberOfGlyphs; } /* TODO: the current point probably needs updating after drawing is done */ /* draw string at point, clipped, w/given color and alpha, and possible deltas: flags & 0x1: data contains x offsets, use instead of glyph x advance flags & 0x2: data contains y offsets, use instead of glyph y advance flags & 0x4: data contains a single x and y offset, which should be added to font's advancements for each glyph; results are undefined if this option is combined with either x or y offsets (0x1,0x2) flags & 0x8: data contains a single x and y offset, which should be added to font's advancement for glyph identified by 'wch'; if combined with 0x4 deltas contain exactly two offsets for x and y, the first for every character, the second for 'wch'; results are undefined if 0x8 is combined with 0x2 or 0x1 */ - (void) drawString: (const char *)s at: (int)x : (int)y to: (int)x0 : (int)y0 : (int)x1 : (int)y1 : (unsigned char *)buf : (int)bpl : (unsigned char *)abuf : (int)abpl color: (unsigned char)r : (unsigned char)g : (unsigned char)b : (unsigned char)alpha transform: (NSAffineTransform *)transform deltas: (const CGFloat *)delta_data : (int)delta_size : (int)delta_flags widthChar: (int) wch drawinfo: (draw_info_t *)di { const unsigned char *c; unsigned char ch; unsigned int uch; int d; unsigned int glyph; int use_sbit; FTC_SBit sbit; FT_Matrix ftmatrix; FT_Vector ftdelta; FT_Error error; NSAffineTransformStruct ts; if (!alpha) return; /* TODO: if we had guaranteed upper bounds on glyph image size we could do some basic clipping here */ x1 -= x0; y1 -= y0; x -= x0; y -= y0; ts = [transform transformStruct]; /* NSLog(@"[%@ draw using matrix: (%g %g %g %g %g %g)] transform=%@", self, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], transform );*/ { float xx, xy, yx, yy; xx = matrix[0] * ts.m11 + matrix[1] * ts.m21; yx = matrix[0] * ts.m12 + matrix[1] * ts.m22; xy = matrix[2] * ts.m11 + matrix[3] * ts.m21; yy = matrix[2] * ts.m12 + matrix[3] * ts.m22; /* If we're drawing 'normal' text (unscaled, unrotated, reasonable size), we can and should use the sbit cache for screen fonts. */ if (screenFont && fabs(xx - ((int)xx)) < 0.01 && fabs(yy - ((int)yy)) < 0.01 && fabs(xy) < 0.01 && fabs(yx) < 0.01 && xx < 72 && yy < 72 && xx > 0.5 && yy > 0.5) { use_sbit = 1; } else { float f; use_sbit = 0; /* TODO: Think hard about this. Fancy truetype magic can significantly change the outline, e.g. by adding fancy adornments at large sizes. If the font is then scaled down, we should probably set the font size to the original size and scale down using the matrix. This ensures that adornments and such are still present, just scaled down. This is somewhat complicated by the fact that we don't have any real size, just a matrix. Thus, we average pix_width and pix_height; we'll get the right answer for normal cases, and we can't really do anything about the weird cases. */ f = abs(pix_width) + abs(pix_height); if (f > 1) f = f / 2.0; else f = 1.0; f = (int)f; scaler.width = scaler.height = f; ftmatrix.xx = xx / f * 65536.0; ftmatrix.xy = xy / f * 65536.0; ftmatrix.yx = yx / f * 65536.0; ftmatrix.yy = yy / f * 65536.0; ftdelta.x = ftdelta.y = 0; } } /* NSLog(@"drawString: '%s' at: %i:%i to: %i:%i:%i:%i:%p", s, x, y, x0, y0, x1, y1, buf);*/ d=0; for (c = (const unsigned char *)s; *c; c++) { /* TODO: do the same thing in outlineString:... */ ch = *c; if (ch < 0x80) { uch = ch; } else if (ch < 0xc0) { uch = 0xfffd; } else if (ch < 0xe0) { #define ADD_UTF_BYTE(shift, internal) \ ch = *++c; \ if (ch >= 0x80 && ch < 0xc0) \ { \ uch |= (ch & 0x3f) << shift; \ internal \ } \ else \ { \ uch = 0xfffd; \ c--; \ } uch = (ch & 0x1f) << 6; ADD_UTF_BYTE(0,) } else if (ch < 0xf0) { uch = (ch & 0x0f) << 12; ADD_UTF_BYTE(6, ADD_UTF_BYTE(0,)) } else if (ch < 0xf8) { uch = (ch & 0x07) << 18; ADD_UTF_BYTE(12, ADD_UTF_BYTE(6, ADD_UTF_BYTE(0,))) } else if (ch < 0xfc) { uch = (ch & 0x03) << 24; ADD_UTF_BYTE(18, ADD_UTF_BYTE(12, ADD_UTF_BYTE(6, ADD_UTF_BYTE(0,)))) } else if (ch < 0xfe) { uch = (ch & 0x01) << 30; ADD_UTF_BYTE(24, ADD_UTF_BYTE(18, ADD_UTF_BYTE(12, ADD_UTF_BYTE(6, ADD_UTF_BYTE(0,))))) } else { uch = 0xfffd; } #undef ADD_UTF_BYTE glyph = FTC_CMapCache_Lookup(ftc_cmapcache, faceId, unicodeCmap, uch); if (use_sbit) { if ((error = FTC_SBitCache_Lookup(ftc_sbitcache, &imageType, glyph, &sbit, NULL))) { NSLog(@"FTC_SBitCache_Lookup() failed with error %08x " @"(%08x, %08x, %ix%i, %08x)", error, glyph, (unsigned)imageType.face_id, imageType.width, imageType.height, imageType.flags); continue; } if (!sbit->buffer) { if (!delta_flags) { x += sbit->xadvance; } else { if (delta_flags & 0x1) x += delta_data[d++]; if (delta_flags & 0x2) y += (ts.m22 < 0) ? delta_data[d++] : -delta_data[d++]; if (delta_flags & 0x4) { x += sbit->xadvance + delta_data[0]; y += /*sbit->yadvance +*/ (ts.m22 < 0) ? delta_data[1] : -delta_data[1]; if ((delta_flags & 0x8) && (uch == wch)) { x += delta_data[2]; y += (ts.m22 < 0) ? delta_data[3] : -delta_data[3]; } } else if (delta_flags & 0x8) { if (uch == wch) { x += sbit->xadvance + delta_data[0]; y += /*sbit->yadvance +*/ (ts.m22 < 0) ? delta_data[1] : -delta_data[1]; } else { x += sbit->xadvance; /*y += sbit->yadvance;*/ } } } continue; } if (sbit->format == ft_pixel_mode_grays) { int gx = x + sbit->left, gy = y - sbit->top; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA_OPAQUE(dst, src, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA(dst, src, r, g, b, alpha, sx); } } else if (sbit->format == ft_pixel_mode_mono) { int gx = x + sbit->left, gy = y - sbit->top; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; int src_ofs = 0; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx / 8; src_ofs = (-gx) & 7; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_MONO_OPAQUE(dst, src, src_ofs, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_MONO(dst, src, src_ofs, r, g, b, alpha, sx); } } else { NSLog(@"unhandled font bitmap format %i", sbit->format); } if (!delta_flags) { x += sbit->xadvance; } else { if (delta_flags & 0x1) x += delta_data[d++]; if (delta_flags & 0x2) y += (ts.m22 < 0) ? delta_data[d++] : -delta_data[d++]; if (delta_flags & 0x4) { x += sbit->xadvance + delta_data[0]; y += /*sbit->yadvance +*/ (ts.m22 < 0) ? delta_data[1] : -delta_data[1]; if ((delta_flags & 0x8) && (uch == wch)) { x += delta_data[2]; y += (ts.m22 < 0) ? delta_data[3] : -delta_data[3]; } } else if (delta_flags & 0x8) { if (uch == wch) { x += sbit->xadvance + delta_data[0]; y += /*sbit->yadvance +*/ (ts.m22 < 0) ? delta_data[1] : -delta_data[1]; } else { x += sbit->xadvance; /*y += sbit->yadvance;*/ } } } } else { FT_Face face; FT_Glyph gl; FT_Size size; FT_BitmapGlyph gb; if ((error=FTC_Manager_LookupSize(ftc_manager, &scaler, &size))) { NSLog(@"FTC_Manager_Lookup_Size() failed with error %08x", error); continue; } face = size->face; /* TODO: for screen fonts we should probably still hint */ if ((error=FT_Load_Glyph(face, glyph, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP))) { NSLog(@"FT_Load_Glyph() failed with error %08x", error); continue; } if ((error=FT_Get_Glyph(face->glyph, &gl))) { NSLog(@"FT_Get_Glyph() failed with error %08x", error); continue; } if ((error=FT_Glyph_Transform(gl, &ftmatrix, &ftdelta))) { NSLog(@"FT_Glyph_Transform() failed with error %08x", error); continue; } if ((error=FT_Glyph_To_Bitmap(&gl, ft_render_mode_normal, 0, 1))) { NSLog(@"FT_Glyph_To_Bitmap() failed with error %08x", error); FT_Done_Glyph(gl); continue; } gb = (FT_BitmapGlyph)gl; if (gb->bitmap.pixel_mode == ft_pixel_mode_grays) { int gx = x + gb->left, gy = y - gb->top; int sbpl = gb->bitmap.pitch; int sx = gb->bitmap.width, sy = gb->bitmap.rows; const unsigned char *src = gb->bitmap.buffer; unsigned char *dst = buf; unsigned char *dsta = abuf; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; if (dsta) dsta += abpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; if (dsta) dsta += gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (dsta) for (; gy < sy; gy++, src += sbpl, dst += bpl, dsta += abpl) RENDER_BLIT_ALPHA_A(dst, dsta, src, r, g, b, alpha, sx); else if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA_OPAQUE(dst, src, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA(dst, src, r, g, b, alpha, sx); } } /* TODO: will this case ever appear? */ /* else if (gb->bitmap.pixel_mode==ft_pixel_mode_mono)*/ else { NSLog(@"unhandled font bitmap format %i", gb->bitmap.pixel_mode); } if (!delta_flags) { ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; } else { if (delta_flags & 0x1) ftdelta.x += delta_data[d++] * 64.0; if (delta_flags & 0x2) ftdelta.y += delta_data[d++] * 64.0; if (delta_flags & 0x4) { ftdelta.x += (gl->advance.x >> 10) + delta_data[0] * 64.0; ftdelta.y += (gl->advance.y >> 10) + delta_data[1] * 64.0; if ((delta_flags & 0x8) && (uch == wch)) { ftdelta.x += delta_data[2] * 64.0; ftdelta.y += delta_data[3] * 64.0; } } else if (delta_flags & 0x8) { if (uch == wch) { ftdelta.x += (gl->advance.x >> 10) + delta_data[0] * 64.0; ftdelta.y += (gl->advance.y >> 10) + delta_data[1] * 64.0; } else { ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; } } } FT_Done_Glyph(gl); } } } - (void) drawGlyphs: (const NSGlyph *)glyphs : (int)length at: (int)x : (int)y to: (int)x0 : (int)y0 : (int)x1 : (int)y1 : (unsigned char *)buf : (int)bpl color: (unsigned char)r : (unsigned char)g : (unsigned char)b : (unsigned char)alpha transform: (NSAffineTransform *)transform drawinfo: (struct draw_info_s *)di { unsigned int glyph; int use_sbit; FTC_SBit sbit; FT_Matrix ftmatrix; FT_Vector ftdelta; FT_Error error; NSAffineTransformStruct ts; if (!alpha) return; /* TODO: if we had guaranteed upper bounds on glyph image size we could do some basic clipping here */ x1 -= x0; y1 -= y0; x -= x0; y -= y0; ts = [transform transformStruct]; /* NSLog(@"[%@ draw using matrix: (%g %g %g %g %g %g)] transform=%@", self, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], transform );*/ { float xx, xy, yx, yy; xx = matrix[0] * ts.m11 + matrix[1] * ts.m21; yx = matrix[0] * ts.m12 + matrix[1] * ts.m22; xy = matrix[2] * ts.m11 + matrix[3] * ts.m21; yy = matrix[2] * ts.m12 + matrix[3] * ts.m22; /* If we're drawing 'normal' text (unscaled, unrotated, reasonable size), we can and should use the sbit cache for screen fonts. */ if (screenFont && fabs(xx - ((int)xx)) < 0.01 && fabs(yy - ((int)yy)) < 0.01 && fabs(xy) < 0.01 && fabs(yx) < 0.01 && xx < 72 && yy < 72 && xx > 0.5 && yy > 0.5) { use_sbit = 1; } else { float f; use_sbit = 0; f = abs(pix_width) + abs(pix_height); if (f > 1) f = f / 2.0; else f = 1.0; f = (int)f; scaler.width = scaler.height = f; ftmatrix.xx = xx / f * 65536.0; ftmatrix.xy = xy / f * 65536.0; ftmatrix.yx = yx / f * 65536.0; ftmatrix.yy = yy / f * 65536.0; ftdelta.x = ftdelta.y = 0; } } /* NSLog(@"drawGlyphs: '%p' at: %i:%i to: %i:%i:%i:%i:%p", glyphs, x, y, x0, y0, x1, y1, buf);*/ for (; length; length--, glyphs++) { glyph = *glyphs - 1; if (use_sbit) { if ((error = FTC_SBitCache_Lookup(ftc_sbitcache, &imageType, glyph, &sbit, NULL))) { NSLog(@"FTC_SBitCache_Lookup() failed with error %08x " @"(%08x, %08x, %ix%i, %08x)", error, glyph, (unsigned)imageType.face_id, imageType.width, imageType.height, imageType.flags); continue; } if (!sbit->buffer) { x += sbit->xadvance; continue; } if (sbit->format == ft_pixel_mode_grays) { int gx = x + sbit->left, gy = y - sbit->top; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA_OPAQUE(dst, src, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA(dst, src, r, g, b, alpha, sx); } } else if (sbit->format == ft_pixel_mode_mono) { int gx = x + sbit->left, gy = y - sbit->top; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; int src_ofs = 0; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx / 8; src_ofs = (-gx) & 7; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_MONO_OPAQUE(dst, src, src_ofs, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_MONO(dst, src, src_ofs, r, g, b, alpha, sx); } } else { NSLog(@"unhandled font bitmap format %i", sbit->format); } x += sbit->xadvance; } else { FT_Face face; FT_Size size; FT_Glyph gl; FT_BitmapGlyph gb; if ((error=FTC_Manager_LookupSize(ftc_manager, &scaler, &size))) { NSLog(@"FTC_Manager_Lookup_Size() failed with error %08x",error); continue; } face = size->face; /* TODO: for screen fonts ...see above... rotations of 90, 180, 270, * and integer scales hinting might still be a good idea. */ if ((error = FT_Load_Glyph(face, glyph, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP))) { NSLog(@"FT_Load_Glyph() failed with error %08x", error); continue; } if ((error=FT_Get_Glyph(face->glyph, &gl))) { NSLog(@"FT_Get_Glyph() failed with error %08x", error); continue; } if ((error=FT_Glyph_Transform(gl, &ftmatrix, &ftdelta))) { NSLog(@"FT_Glyph_Transform() failed with error %08x", error); continue; } if ((error=FT_Glyph_To_Bitmap(&gl, ft_render_mode_normal, 0, 1))) { NSLog(@"FT_Glyph_To_Bitmap() failed with error %08x", error); FT_Done_Glyph(gl); continue; } gb = (FT_BitmapGlyph)gl; if (gb->bitmap.pixel_mode == ft_pixel_mode_grays) { int gx = x + gb->left, gy = y - gb->top; int sbpl = gb->bitmap.pitch; int sx = gb->bitmap.width, sy = gb->bitmap.rows; const unsigned char *src = gb->bitmap.buffer; unsigned char *dst = buf; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA_OPAQUE(dst, src, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA(dst, src, r, g, b, alpha, sx); } } /* TODO: will this case ever appear? */ /* else if (gb->bitmap.pixel_mode==ft_pixel_mode_mono)*/ else { NSLog(@"unhandled font bitmap format %i", gb->bitmap.pixel_mode); } ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; FT_Done_Glyph(gl); } } } - (void) drawGlyphs: (const NSGlyph *)glyphs : (int)length at: (int)x : (int)y to: (int)x0 : (int)y0 : (int)x1 : (int)y1 : (unsigned char *)buf : (int)bpl alpha: (unsigned char *)abuf : (int)abpl color: (unsigned char)r : (unsigned char)g : (unsigned char)b : (unsigned char)alpha transform: (NSAffineTransform *)transform drawinfo: (struct draw_info_s *)di { unsigned int glyph; int use_sbit; FTC_SBit sbit; FT_Matrix ftmatrix; FT_Vector ftdelta; FT_Error error; NSAffineTransformStruct ts; if (!alpha) return; /* TODO: if we had guaranteed upper bounds on glyph image size we could do some basic clipping here */ x1 -= x0; y1 -= y0; x -= x0; y -= y0; ts = [transform transformStruct]; /* NSLog(@"[%@ draw using matrix: (%g %g %g %g %g %g)] transform=%@", self, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], transform );*/ { float xx, xy, yx, yy; xx = matrix[0] * ts.m11 + matrix[1] * ts.m21; yx = matrix[0] * ts.m12 + matrix[1] * ts.m22; xy = matrix[2] * ts.m11 + matrix[3] * ts.m21; yy = matrix[2] * ts.m12 + matrix[3] * ts.m22; /* If we're drawing 'normal' text (unscaled, unrotated, reasonable size), we can and should use the sbit cache for screen fonts. */ if (screenFont && fabs(xx - ((int)xx)) < 0.01 && fabs(yy - ((int)yy)) < 0.01 && fabs(xy) < 0.01 && fabs(yx) < 0.01 && xx < 72 && yy < 72 && xx > 0.5 && yy > 0.5) { use_sbit = 1; } else { float f; use_sbit = 0; f = abs(pix_width) + abs(pix_height); if (f > 1) f = f / 2.0; else f = 1.0; f = (int)f; scaler.width = scaler.height = f; ftmatrix.xx = xx / f * 65536.0; ftmatrix.xy = xy / f * 65536.0; ftmatrix.yx = yx / f * 65536.0; ftmatrix.yy = yy / f * 65536.0; ftdelta.x = ftdelta.y = 0; } } /* NSLog(@"drawString: '%s' at: %i:%i to: %i:%i:%i:%i:%p", s, x, y, x0, y0, x1, y1, buf);*/ for (; length; length--, glyphs++) { glyph = *glyphs - 1; if (use_sbit) { if ((error = FTC_SBitCache_Lookup(ftc_sbitcache, &imageType, glyph, &sbit, NULL))) { if (glyph != 0xffffffff) NSLog(@"FTC_SBitCache_Lookup() failed with error %08x (%08x, %08x, %ix%i, %08x)", error, glyph, (unsigned)imageType.face_id, imageType.width, imageType.height, imageType.flags ); continue; } if (!sbit->buffer) { x += sbit->xadvance; continue; } if (sbit->format == ft_pixel_mode_grays) { int gx = x + sbit->left, gy = y - sbit->top; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; unsigned char *adst = abuf; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; adst += abpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; adst += gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { for (; gy < sy; gy++, src += sbpl, dst += bpl, adst += abpl) RENDER_BLIT_ALPHA_A(dst, adst, src, r, g, b, alpha, sx); } } else if (sbit->format == ft_pixel_mode_mono) { int gx = x + sbit->left, gy = y - sbit->top; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; unsigned char *adst = abuf; int src_ofs = 0; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; adst += abpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx / 8; src_ofs = (-gx) & 7; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; adst += gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { for (; gy < sy; gy++, src += sbpl, dst += bpl, adst += bpl) RENDER_BLIT_MONO_A(dst, adst, src, src_ofs, r, g, b, alpha, sx); } } else { NSLog(@"unhandled font bitmap format %i", sbit->format); } x += sbit->xadvance; } else { FT_Face face; FT_Size size; FT_Glyph gl; FT_BitmapGlyph gb; if ((error=FTC_Manager_LookupSize(ftc_manager, &scaler, &size))) { NSLog(@"FTC_Manager_Lookup_Size() failed with error %08x", error); continue; } face = size->face; /* TODO: for screen fonts, see above, etc., rotations of 90, 180, 270, and integer scales hinting might still be a good idea. */ if ((error=FT_Load_Glyph(face, glyph, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP))) { NSLog(@"FT_Load_Glyph() failed with error %08x", error); continue; } if ((error=FT_Get_Glyph(face->glyph, &gl))) { NSLog(@"FT_Get_Glyph() failed with error %08x", error); continue; } if ((error=FT_Glyph_Transform(gl, &ftmatrix, &ftdelta))) { NSLog(@"FT_Glyph_Transform() failed with error %08x", error); continue; } if ((error=FT_Glyph_To_Bitmap(&gl, ft_render_mode_normal, 0, 1))) { NSLog(@"FT_Glyph_To_Bitmap() failed with error %08x", error); FT_Done_Glyph(gl); continue; } gb = (FT_BitmapGlyph)gl; if (gb->bitmap.pixel_mode == ft_pixel_mode_grays) { int gx = x + gb->left, gy = y - gb->top; int sbpl = gb->bitmap.pitch; int sx = gb->bitmap.width, sy = gb->bitmap.rows; const unsigned char *src = gb->bitmap.buffer; unsigned char *dst = buf; unsigned char *adst = abuf; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; adst += abpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; adst += gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { for (; gy < sy; gy++, src += sbpl, dst += bpl, adst += bpl) RENDER_BLIT_ALPHA_A(dst, adst, src, r, g, b, alpha, sx); } } /* TODO: will this case ever appear? */ /* else if (gb->bitmap.pixel_mode==ft_pixel_mode_mono)*/ else { NSLog(@"unhandled font bitmap format %i", gb->bitmap.pixel_mode); } ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; FT_Done_Glyph(gl); } } } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { FT_Face face; FT_Size size; FT_Error error; glyph--; if ((error=FTC_Manager_LookupSize(ftc_manager, &scaler, &size))) { NSLog(@"FTC_Manager_Lookup_Size() failed with error %08x",error); return NO; } face = size->face; if ((error=FT_Load_Glyph(face, glyph, 0))) { NSLog(@"FT_Load_Glyph() failed with error %08x",error); return NO; } return YES; } - (NSSize) advancementForGlyph: (NSGlyph)glyph { FT_Error error; if (glyph == NSControlGlyph || glyph == GSAttachmentGlyph) return NSZeroSize; if (glyph != NSNullGlyph) glyph--; if (screenFont) { int entry = glyph % CACHE_SIZE; FTC_SBit sbit; if (cachedGlyph[entry] == glyph) return cachedSize[entry]; if ((error = FTC_SBitCache_Lookup(ftc_sbitcache, &imageType, glyph, &sbit, NULL))) { NSLog(@"FTC_SBitCache_Lookup() failed with error %08x (%08x, %08x, %ix%i, %08x)", error, glyph, (unsigned)imageType.face_id, imageType.width, imageType.height, imageType.flags ); return NSZeroSize; } cachedGlyph[entry] = glyph; cachedSize[entry] = NSMakeSize(sbit->xadvance, sbit->yadvance); return cachedSize[entry]; } else { FT_Face face; FT_Size size; FT_Glyph gl; FT_Matrix ftmatrix; FT_Vector ftdelta; float f; NSSize s; f = fabs(matrix[0] * matrix[3] - matrix[1] * matrix[2]); if (f > 1) f = sqrt(f); else f = 1.0; f = (int)f; /* TODO? scalers and stuff, need to review */ ftmatrix.xx = matrix[0] / f * 65536.0; ftmatrix.xy = matrix[1] / f * 65536.0; ftmatrix.yx = matrix[2] / f * 65536.0; ftmatrix.yy = matrix[3] / f * 65536.0; ftdelta.x = ftdelta.y = 0; if (FTC_Manager_LookupSize(ftc_manager, &scaler, &size)) return NSZeroSize; face = size->face; if (FT_Load_Glyph(face, glyph, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP)) return NSZeroSize; if (FT_Get_Glyph(face->glyph, &gl)) return NSZeroSize; if (FT_Glyph_Transform(gl, &ftmatrix, &ftdelta)) return NSZeroSize; s = NSMakeSize(gl->advance.x / 65536.0, gl->advance.y / 65536.0); FT_Done_Glyph(gl); return s; } } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { FT_BBox bbox; FT_Glyph g; FT_Error error; glyph--; /* TODO: this is ugly */ if ((error=FTC_ImageCache_Lookup(ftc_imagecache, &imageType, glyph, &g, NULL))) { NSLog(@"FTC_ImageCache_Lookup() failed with error %08x",error); // NSLog(@"boundingRectForGlyph: %04x -> %i", aGlyph, glyph); return fontBBox; } FT_Glyph_Get_CBox(g, ft_glyph_bbox_gridfit, &bbox); /* printf("got cbox for %04x: %i, %i - %i, %i", aGlyph, bbox.xMin, bbox.yMin, bbox.xMax, bbox.yMax);*/ return NSMakeRect(bbox.xMin / 64.0, bbox.yMin / 64.0, (bbox.xMax - bbox.xMin) / 64.0, (bbox.yMax - bbox.yMin) / 64.0); } - (NSPoint) positionOfGlyph: (NSGlyph)g precededByGlyph: (NSGlyph)prev isNominal: (BOOL *)nominal { NSPoint a; FT_Face face; FT_Size size; FT_Vector vec; FT_GlyphSlot glyph; if (nominal) *nominal = YES; if (g == NSControlGlyph || prev == NSControlGlyph) return NSZeroPoint; g--; prev--; if (FTC_Manager_LookupSize(ftc_manager, &scaler, &size)) return NSZeroPoint; face = size->face; if (FT_Load_Glyph(face, prev, FT_LOAD_DEFAULT)) return NSZeroPoint; glyph = face->glyph; a = NSMakePoint(glyph->advance.x / 64.0, glyph->advance.y / 64.0); if (FT_Get_Kerning(face, prev, g, ft_kerning_default, &vec)) return a; if (vec.x == 0 && vec.y == 0) return a; if (nominal) *nominal = NO; a.x += vec.x / 64.0; a.y += vec.y / 64.0; return a; } - (CGFloat) widthOfString: (NSString*)string { unichar ch; int i, c = [string length]; int total; unsigned int glyph; FTC_SBit sbit; total = 0; for (i = 0; i < c; i++) { ch = [string characterAtIndex: i]; glyph = FTC_CMapCache_Lookup(ftc_cmapcache, faceId, unicodeCmap, ch); /* TODO: shouldn't use sbit cache for this */ if (1) { if (FTC_SBitCache_Lookup(ftc_sbitcache, &imageType, glyph, &sbit, NULL)) continue; total += sbit->xadvance; } else { NSLog(@"non-sbit code not implemented"); } } return total; } - (NSGlyph) glyphWithName: (NSString *)glyphName { FT_Face face; FT_Size size; NSGlyph g; if (FTC_Manager_LookupSize(ftc_manager, &scaler, &size)) return NSNullGlyph; face = size->face; g = FT_Get_Name_Index(face, (FT_String *)[glyphName lossyCString]); if (g) return g + 1; return NSNullGlyph; } /* conic: (a,b,c) p=(1-t)^2*a + 2*(1-t)*t*b + t^2*c cubic: (a,b,c,d) p=(1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d p(t)=(1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d t=m+ns= n=l-m q(s)=p(m+ns)= (d-3c+3b-a)*n^3 * s^3 + ((3d-9c+9b-3a)*m+3c-6b+3a)*n^2 * s^2 + ((3d-9c+9b-3a)*m^2+(6c-12b+6a)*m+3b-3a)*n * s + (d-3c+3b-a)*m^3+(3c-6b+3a)*m^2+(3b-3a)m+a q(t)=(1-t)^3*aa + 3*(1-t)^2*t*bb + 3*(1-t)*t^2*cc + t^3*dd = (dd-3cc+3bb-aa)*t^3 + (3cc-6bb+3aa)*t^2 + (3bb-3aa)*t + aa aa = (d-3*c+3*b-a)*m^3+(3*c-6*b+3*a)*m^2+(3*b-3*a)*m+a 3*bb-3*aa = ((3*d-9*c+9*b-3*a)*m^2+(6*c-12*b+6*a)*m+3*b-3*a)*n 3*cc-6*bb+3*aa = ((3*d-9*c+9*b-3*a)*m+3*c-6*b+3*a)*n^2 dd-3*cc+3*bb-aa = (d-3*c+3*b-a)*n^3 aa= (d - 3c + 3b - a) m^3 + (3c - 6b + 3a) m^2 + (3b - 3a) m + a bb= ((d - 3c + 3b - a) m^2 + (2c - 4b + 2a) m + b - a) n + aa cc= ((d - 3c + 3b - a) m + c - 2b + a) n^2 + 2*bb + aa dd= (d - 3c + 3b - a) n^3 + 3*cc + 3*bb + aa p(t) = (1-t)^2*e + 2*(1-t)*t*f + t^2*g ~= q(t) = (1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d p(0)=q(0) && p(1)=q(1) -> a=e d=g p(0.5) = 1/8*(2a + 4f + 2d) q(0.5) = 1/8*(a + 3*b + 3*c + d) b+c=1/3*(a+4f+d) p(1/4) = 1/64* p(3/4) = 1/64*(4e+24f+36g) q(1/4) = 1/64* q(3/4) = 1/64*(a + 9b + 27c + 27d) 3b+c=1/3*(3a+8f+d) 3b+c=1/3*(3a+8f+d) b+c=1/3*(a+4f+d) b=1/3*(e+2f) c=1/3*(2f+g) q(t) = (1-t)^3*e + (1-t)^2*t*(e+2f) + (1-t)*t^2*(2f+g) + t^3*g = ((1-t)^3+(1-t)^2*t)*e + (1-t)^2*t*2f + (1-t)*t^2*2f + (t^3+(1-t)*t^2)*g = ((1-t)^3+(1-t)^2*t)*e + 2f*(t*(1-t)*((1-t)+t)) + (t^3+(1-t)*t^2)*g = ((1-t)^3+(1-t)^2*t)*e + 2*(1-t)*t*f + (t^3+(1-t)*t^2)*g = (1-t)^2*e + 2*(1-t)*t*f + t^2*g p(t)=q(t) */ /* TODO: try to combine charpath and NSBezierPath handling? */ #if 0 static int charpath_move_to(const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint d; d.x = to->x / 65536.0; d.y = to->y / 65536.0; [self DPSclosepath]; /* TODO: this isn't completely correct */ [self DPSmoveto: d.x:d.y]; return 0; } static int charpath_line_to(const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint d; d.x = to->x / 65536.0; d.y = to->y / 65536.0; [self DPSlineto: d.x:d.y]; return 0; } static int charpath_conic_to(const FT_Vector *c1, const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint a, b, c, d; [self DPScurrentpoint: &a.x:&a.y]; d.x = to->x / 65536.0; d.y = to->y / 65536.0; b.x = c1->x / 65536.0; b.y = c1->y / 65536.0; c.x = (b.x * 2 + d.x) / 3.0; c.y = (b.y * 2 + d.y) / 3.0; b.x = (b.x * 2 + a.x) / 3.0; b.y = (b.y * 2 + a.y) / 3.0; [self DPScurveto: b.x:b.y : c.x:c.y : d.x:d.y]; return 0; } static int charpath_cubic_to(const FT_Vector *c1, const FT_Vector *c2, const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint b, c, d; b.x = c1->x / 65536.0; b.y = c1->y / 65536.0; c.x = c2->x / 65536.0; c.y = c2->y / 65536.0; d.x = to->x / 65536.0; d.y = to->y / 65536.0; [self DPScurveto: b.x:b.y : c.x:c.y : d.x:d.y]; return 0; } static FT_Outline_Funcs charpath_funcs = { move_to:charpath_move_to, line_to:charpath_line_to, conic_to:charpath_conic_to, cubic_to:charpath_cubic_to, shift:10, delta:0, }; #endif static int bezierpath_move_to(const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint d; d.x = to->x / 65536.0; d.y = to->y / 65536.0; [path closePath]; /* TODO: this isn't completely correct */ [path moveToPoint: d]; return 0; } static int bezierpath_line_to(const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint d; d.x = to->x / 65536.0; d.y = to->y / 65536.0; [path lineToPoint: d]; return 0; } static int bezierpath_conic_to(const FT_Vector *c1, const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint a, b, c, d; a = [path currentPoint]; d.x = to->x / 65536.0; d.y = to->y / 65536.0; b.x = c1->x / 65536.0; b.y = c1->y / 65536.0; c.x = (b.x * 2 + d.x) / 3.0; c.y = (b.y * 2 + d.y) / 3.0; b.x = (b.x * 2 + a.x) / 3.0; b.y = (b.y * 2 + a.y) / 3.0; [path curveToPoint: d controlPoint1: b controlPoint2: c]; return 0; } static int bezierpath_cubic_to(const FT_Vector *c1, const FT_Vector *c2, const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint b, c, d; b.x = c1->x / 65536.0; b.y = c1->y / 65536.0; c.x = c2->x / 65536.0; c.y = c2->y / 65536.0; d.x = to->x / 65536.0; d.y = to->y / 65536.0; [path curveToPoint: d controlPoint1: b controlPoint2: c]; return 0; } static FT_Outline_Funcs bezierpath_funcs = { .move_to = bezierpath_move_to, .line_to = bezierpath_line_to, .conic_to = bezierpath_conic_to, .cubic_to = bezierpath_cubic_to, .shift = 10, .delta = 0, }; /* TODO: sometimes gets 'glyph transformation failed', probably need to add code to avoid loading bitmaps for glyphs */ - (void) outlineString: (const char *)s at: (CGFloat)x : (CGFloat)y gstate: (void *)func_param { #if 0 unichar *c; int i; FTC_CMapDescRec cmap; unsigned int glyph; unichar *uch; int ulen; FTC_ImageTypeRec cur; FT_Matrix ftmatrix; FT_Vector ftdelta; ftmatrix.xx = 65536; ftmatrix.xy = 0; ftmatrix.yx = 0; ftmatrix.yy = 65536; ftdelta.x = x * 64.0; ftdelta.y = y * 64.0; uch = NULL; ulen = 0; GSToUnicode(&uch, &ulen, s, strlen(s), NSUTF8StringEncoding, NSDefaultMallocZone(), 0); cur = imgd; cmap.face_id = imgd.font.face_id; cmap.u.encoding = ft_encoding_unicode; cmap.type = FTC_CMAP_BY_ENCODING; for (c = uch, i = 0; i < ulen; i++, c++) { FT_Face face; FT_Glyph gl; FT_OutlineGlyph og; glyph = FTC_CMapCache_Lookup(ftc_cmapcache, &cmap, *c); cur.font.face_id = imgd.font.face_id; if (FTC_Manager_Lookup_Size(ftc_manager, &cur.font, &face, 0)) continue; if (FT_Load_Glyph(face, glyph, FT_LOAD_DEFAULT)) continue; if (FT_Get_Glyph(face->glyph, &gl)) continue; if (FT_Glyph_Transform(gl, &ftmatrix, &ftdelta)) { NSLog(@"glyph transformation failed!"); continue; } og = (FT_OutlineGlyph)gl; ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; FT_Outline_Decompose(&og->outline, &charpath_funcs, func_param); FT_Done_Glyph(gl); } if (ulen) { [(GSGState *)func_param DPSmoveto: ftdelta.x / 64.0 : ftdelta.y / 64.0]; } free(uch); #endif } - (void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs count: (int)count toBezierPath: (NSBezierPath *)path { int i; NSGlyph glyph; FT_Matrix ftmatrix; FT_Vector ftdelta; NSPoint p = [path currentPoint]; ftmatrix.xx = 65536; ftmatrix.xy = 0; ftmatrix.yx = 0; ftmatrix.yy = 65536; ftdelta.x = p.x * 64.0; ftdelta.y = p.y * 64.0; for (i = 0; i < count; i++, glyphs++) { FT_Face face; FT_Glyph gl; FT_OutlineGlyph og; FT_Size size; glyph = *glyphs - 1; if (FTC_Manager_LookupSize(ftc_manager, &scaler, &size)) continue; face = size->face; if (FT_Load_Glyph(face, glyph, FT_LOAD_DEFAULT)) continue; if (FT_Get_Glyph(face->glyph, &gl)) continue; if (FT_Glyph_Transform(gl, &ftmatrix, &ftdelta)) { NSLog(@"glyph transformation failed!"); continue; } og = (FT_OutlineGlyph)gl; ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; FT_Outline_Decompose(&og->outline, &bezierpath_funcs, path); FT_Done_Glyph(gl); } if (count) { [path moveToPoint: NSMakePoint(ftdelta.x / 64.0, ftdelta.y / 64.0)]; } } static int filters[3][7]= { { 0*65536/9, 1*65536/9, 2*65536/9, 3*65536/9, 2*65536/9, 1*65536/9, 0*65536/9}, { 0*65536/9, 1*65536/9, 2*65536/9, 3*65536/9, 2*65536/9, 1*65536/9, 0*65536/9}, { 0*65536/9, 1*65536/9, 2*65536/9, 3*65536/9, 2*65536/9, 1*65536/9, 0*65536/9} }; + (void) initializeBackend { [GSFontEnumerator setDefaultClass: [FTFontEnumerator class]]; [GSFontInfo setDefaultClass: [FTFontInfo class]]; if (FT_Init_FreeType(&ft_library)) NSLog(@"FT_Init_FreeType failed"); if (FTC_Manager_New(ft_library, 0, 0, 4096 * 24, ft_get_face, 0, &ftc_manager)) NSLog(@"FTC_Manager_New failed"); if (FTC_SBitCache_New(ftc_manager, &ftc_sbitcache)) NSLog(@"FTC_SBitCache_New failed"); if (FTC_ImageCache_New(ftc_manager, &ftc_imagecache)) NSLog(@"FTC_ImageCache_New failed"); if (FTC_CMapCache_New(ftc_manager, &ftc_cmapcache)) NSLog(@"FTC_CMapCache_New failed"); { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSString *s; NSArray *a; int i; subpixel_text = [ud integerForKey: @"back-art-subpixel-text"]; /* To make it easier to find an optimal (or at least good) filter, the filters are configurable (for now). */ for (i = 0; i < 3; i++) { s = [ud stringForKey: [NSString stringWithFormat: @"back-art-subpixel-filter-%i",i]]; if (s) { int j, c, sum, v; a = [s componentsSeparatedByString: @" "]; c = [a count]; if (!c) continue; if (!(c & 1) || c > 7) { NSLog(@"invalid number of components in filter (must be odd number, 1<=n<=7)"); continue; } memset(filters[i], 0, sizeof(filters[0])); sum = 0; for (j = 0; j < c; j++) { v = [[a objectAtIndex: j] intValue]; sum += v; filters[i][j + (7 - c) / 2] = v * 65536; } if (sum) { for (j = 0; j < 7; j++) { filters[i][j] /= sum; } } NSLog(@"filter %i: %04x %04x %04x %04x %04x %04x %04x", i, filters[i][0],filters[i][1],filters[i][2],filters[i][3], filters[i][4],filters[i][5],filters[i][6]); } } } } - (NSGlyph) glyphForCharacter: (unichar)ch { NSGlyph g; g = FTC_CMapCache_Lookup(ftc_cmapcache, faceId, unicodeCmap, ch); if (g) return g + 1; else return NSNullGlyph; } - (NSMultibyteGlyphPacking) glyphPacking { return NSFourByteGlyphPacking; } @end /* TODO: this whole thing needs cleaning up */ @implementation FTFontInfo_subpixel #if 0 - (void) drawGlyphs: (const NSGlyph *)glyphs : (int)length at: (int)x : (int)y to: (int)x0 : (int)y0 : (int)x1 : (int)y1 : (unsigned char *)buf : (int)bpl color: (unsigned char)r : (unsigned char)g : (unsigned char)b : (unsigned char)alpha transform: (NSAffineTransform *)transform drawinfo: (struct draw_info_s *)di { FTC_CMapDescRec cmap; unsigned int glyph; int use_sbit; FTC_SBit sbit; FTC_ImageTypeRec cur; FT_Matrix ftmatrix; FT_Vector ftdelta; NSAffineTransformStruct ts; BOOL subpixel = NO; if (!alpha) return; /* TODO: if we had guaranteed upper bounds on glyph image size we could do some basic clipping here */ x1 -= x0; y1 -= y0; x -= x0; y -= y0; ts = [transform transformStruct]; /* NSLog(@"[%@ draw using matrix: (%g %g %g %g %g %g)]", self, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] );*/ cur = imgd; { float xx, xy, yx, yy; xx = matrix[0] * ts.m11 + matrix[1] * ts.m21; yx = matrix[0] * ts.m12 + matrix[1] * ts.m22; xy = matrix[2] * ts.m11 + matrix[3] * ts.m21; yy = matrix[2] * ts.m12 + matrix[3] * ts.m22; /* if we're drawing 'normal' text (unscaled, unrotated, reasonable size), we can and should use the sbit cache */ if (fabs(xx - ((int)xx)) < 0.01 && fabs(yy - ((int)yy)) < 0.01 && fabs(xy) < 0.01 && fabs(yx) < 0.01 && xx < 72 && yy < 72 && xx > 0.5 && yy > 0.5) { use_sbit = 1; cur.font.pix_width = xx; cur.font.pix_height = yy; /* if (cur.font.pix_width < 16 && cur.font.pix_height < 16 && cur.font.pix_width > 6 && cur.font.pix_height > 6) cur.type = ftc_image_mono; else*/ cur.flags = FT_LOAD_TARGET_LCD, subpixel = YES; // imgd.type|=|ftc_image_flag_unhinted; /* TODO? when? */ } else { float f; use_sbit = 0; f = fabs(xx * yy - xy * yx); if (f > 1) f = sqrt(f); else f = 1.0; f = (int)f; cur.font.pix_width = cur.font.pix_height = f; ftmatrix.xx = xx / f * 65536.0; ftmatrix.xy = xy / f * 65536.0; ftmatrix.yx = yx / f * 65536.0; ftmatrix.yy = yy / f * 65536.0; ftdelta.x = ftdelta.y = 0; } } /* NSLog(@"drawString: '%s' at: %i:%i to: %i:%i:%i:%i:%p", s, x, y, x0, y0, x1, y1, buf);*/ cmap.face_id = imgd.font.face_id; cmap.u.encoding = ft_encoding_unicode; cmap.type = FTC_CMAP_BY_ENCODING; for (; length; length--, glyphs++) { glyph = *glyphs - 1; if (use_sbit) { if (FTC_SBitCache_Lookup(ftc_sbitcache, &cur, glyph, &sbit, NULL)) continue; if (!sbit->buffer) { x += sbit->xadvance; continue; } if (sbit->format == FT_PIXEL_MODE_LCD) { int gx = 3 * x + sbit->left, gy = y - sbit->top; int px0 = (gx - 2 < 0? gx - 4 : gx - 2) / 3; int px1 = (gx + sbit->width + 2 < 0? gx + sbit->width + 2: gx + sbit->width + 4) / 3; int llip = gx - px0 * 3; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; int psx = px1 - px0; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; unsigned char scratch[psx * 3]; int mode = subpixel_text == 2? 2 : 0; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (px1 > x1) px1 = x1; if (px0 < 0) { px0 = -px0; } else { px1 -= px0; dst += px0 * DI.bytes_per_pixel; px0 = 0; } if (px1 <= 0) { x += sbit->xadvance; continue; } for (; gy < sy; gy++, src += sbpl, dst += bpl) { int i, j; int v0, v1, v2; for (i = 0, j = -llip; i < psx * 3; i+=3) { v0 = (0 + + (j > 2 && j 1 && j 0 && j -1 && j -2 && j -3 && j -4 && j 2 && j 1 && j 0 && j -1 && j -2 && j -3 && j -4 && j 2 && j 1 && j 0 && j -1 && j -2 && j -3 && j -4 && j0?v0:0; scratch[i + 1] = v1>0?v1:0; scratch[i + (mode ^ 2)] = v2>0?v2:0; } DI.render_blit_subpixel(dst, scratch + px0 * 3, r, g, b, alpha, px1); } } else if (sbit->format == ft_pixel_mode_mono) { int gx = x + sbit->left, gy = y - sbit->top; int sbpl = sbit->pitch; int sx = sbit->width, sy = sbit->height; const unsigned char *src = sbit->buffer; unsigned char *dst = buf; int src_ofs = 0; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx / 8; src_ofs = (-gx) & 7; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_MONO_OPAQUE(dst, src, src_ofs, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_MONO(dst, src, src_ofs, r, g, b, alpha, sx); } } else { NSLog(@"unhandled font bitmap format %i", sbit->format); } x += sbit->xadvance; } else { FT_Face face; FT_Glyph gl; FT_BitmapGlyph gb; if (FTC_Manager_Lookup_Size(ftc_manager, &cur.font, &face, 0)) continue; /* TODO: for rotations of 90, 180, 270, and integer scales hinting might still be a good idea. */ if (FT_Load_Glyph(face, glyph, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP)) continue; if (FT_Get_Glyph(face->glyph, &gl)) continue; if (FT_Glyph_Transform(gl, &ftmatrix, &ftdelta)) { NSLog(@"glyph transformation failed!"); continue; } if (FT_Glyph_To_Bitmap(&gl, ft_render_mode_normal, 0, 1)) { FT_Done_Glyph(gl); continue; } gb = (FT_BitmapGlyph)gl; if (gb->bitmap.pixel_mode == ft_pixel_mode_grays) { int gx = x + gb->left, gy = y - gb->top; int sbpl = gb->bitmap.pitch; int sx = gb->bitmap.width, sy = gb->bitmap.rows; const unsigned char *src = gb->bitmap.buffer; unsigned char *dst = buf; if (gy < 0) { sy += gy; src -= sbpl * gy; gy = 0; } else if (gy > 0) { dst += bpl * gy; } sy += gy; if (sy > y1) sy = y1; if (gx < 0) { sx += gx; src -= gx; gx = 0; } else if (gx > 0) { dst += DI.bytes_per_pixel * gx; } sx += gx; if (sx > x1) sx = x1; sx -= gx; if (sx > 0) { if (alpha >= 255) for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA_OPAQUE(dst, src, r, g, b, sx); else for (; gy < sy; gy++, src += sbpl, dst += bpl) RENDER_BLIT_ALPHA(dst, src, r, g, b, alpha, sx); } } /* TODO: will this case ever appear? */ /* else if (gb->bitmap.pixel_mode==ft_pixel_mode_mono)*/ else { NSLog(@"unhandled font bitmap format %i", gb->bitmap.pixel_mode); } ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; FT_Done_Glyph(gl); } } } #endif @end @interface FTFontInfo (experimental_glyph_printing_extension) - (const char *) nameOfGlyph: (NSGlyph)g; @end @implementation FTFontInfo (experimental_glyph_printing_extension) - (const char *) nameOfGlyph: (NSGlyph)g { static char buf[1024]; /* !!TODO!! */ FT_Size size; FT_Face face; g--; if (FTC_Manager_LookupSize(ftc_manager, &scaler, &size)) return ".notdef"; face = size->face; if (FT_Get_Glyph_Name(face, g, buf, sizeof(buf))) return ".notdef"; return buf; } @end gnustep-back-0.29.0/Source/art/image.m000066400000000000000000000522001404163720200174510ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Image drawing. DPSimage and helpers. */ #include #include #include #include "ARTGState.h" #ifndef RDS #include "x11/XWindowBuffer.h" #endif #include "blit.h" static unsigned int _get_8_bits(const unsigned char *ptr, int bit_ofs, int num_bits) { /* TODO: if we get values with more than 8 bits, we should round properly and not just discard the extra bits */ int i; unsigned int v; ptr += bit_ofs / 8; bit_ofs %= 8; v = 0; /* if we are handling 16 bit values we optimize */ if (num_bits == 16) { #if (GS_WORDS_BIGENDIAN==0) ptr++; #endif v = *ptr; return v; } for (i = 0; i < 8 && i < num_bits; i++) { v <<= 1; if ((*ptr) & (128 >> bit_ofs)) v |= 1; bit_ofs++; if (bit_ofs == 8) { ptr++; bit_ofs = 0; } } /* extend what we've got to 8 bits */ switch (num_bits) { case 1: v *= 255; break; case 2: v *= 85; break; case 3: v = (v << 5) | (v << 2) | (v >> 1); break; case 4: v = (v << 4) | v; break; case 5: v = (v << 3) | (v >> 2); break; case 6: v = (v << 2) | (v >> 4); break; case 7: v = (v << 1) | (v >> 6); break; } return v; } typedef struct { int width, height; int bits_per_sample, samples_per_pixel, bits_per_pixel, bytes_per_row; BOOL is_planar, has_alpha; const unsigned char **data; /* 0 unknown, use colorspacename 1 rgb 2 cmyk 3 gray, 1=white 4 gray, 1=black */ int colorspace; NSString *colorspacename; } image_info_t; static void _image_get_color_rgb_8(image_info_t *ii, render_run_t *ri, int x, int y) { int ofs; if (x < 0) x = 0; if (y < 0) y = 0; if (x >= ii->width) x = ii->width - 1; if (y >= ii->height) y = ii->height - 1; ofs = ii->bytes_per_row * y + x * ii->bits_per_pixel / 8; if (ii->is_planar) { ri->r = ii->data[0][ofs]; ri->g = ii->data[1][ofs]; ri->b = ii->data[2][ofs]; if (ii->has_alpha) ri->a = ii->data[3][ofs]; else ri->a = 255; } else { ri->r = ii->data[0][ofs]; ri->g = ii->data[0][ofs + 1]; ri->b = ii->data[0][ofs + 2]; if (ii->has_alpha) ri->a = ii->data[0][ofs + 3]; else ri->a = 255; } /* Undo premultiply */ if (ri->a && ri->a != 255) { ri->r = (255 * ri->r) / ri->a; ri->g = (255 * ri->g) / ri->a; ri->b = (255 * ri->b) / ri->a; } } static void _image_get_color_rgb_cmyk_gray(image_info_t *ii, render_run_t *ri, int x, int y) { int ofs, bit_ofs; int values[5]; int i, j; if (x < 0) x = 0; if (y < 0) y = 0; if (x >= ii->width) x = ii->width - 1; if (y >= ii->height) y = ii->height - 1; ofs = y * ii->bytes_per_row; bit_ofs = x * ii->bits_per_pixel; for (i = j = 0; i < ii->samples_per_pixel; i++) { values[i] = _get_8_bits(ii->data[j] + ofs, bit_ofs, ii->bits_per_sample); if (ii->is_planar) j++; else bit_ofs += ii->bits_per_sample; } if (ii->has_alpha) ri->a = values[i - 1]; else ri->a = 255; if (ii->colorspace == 1) { ri->r = values[0]; ri->g = values[1]; ri->b = values[2]; } else if (ii->colorspace == 2) { j = 255 - values[0] - values[3]; ri->r = j < 0?0:j; j = 255 - values[1] - values[3]; ri->g = j < 0?0:j; j = 255 - values[2] - values[3]; ri->b = j < 0?0:j; } else if (ii->colorspace == 3) { ri->r = ri->g = ri->b = values[0]; } else if (ii->colorspace == 4) { ri->r = ri->g = ri->b = 255 - values[0]; } /* Undo premultiply */ if (ri->a && ri->a != 255) { ri->r = (255 * ri->r) / ri->a; ri->g = (255 * ri->g) / ri->a; ri->b = (255 * ri->b) / ri->a; } } @implementation ARTGState (image) -(void) _image_do_rgb_transform: (image_info_t *)ii : (NSAffineTransform *)matrix : (void (*)(image_info_t *ii, render_run_t *ri, int x, int y))ifunc { /* TODO: seems to have problems with rotations. 0, 90, 180, 270 work fine, but others seem to cause edges to be off by a pixel */ int x[4], y[4]; int tx[4], ty[4]; float fx[4], fy[4]; int cy, ey; int left_delta, next; int lx, lx_frac, ldx, ldx_frac, l_de, le; int rx, rx_frac, rdx, rdx_frac, r_de, re; int ltx, lty, ltx_frac, lty_frac, ldtx, ldty, ldtx_frac, ldty_frac; int rtx, rty, rtx_frac, rty_frac, rdtx, rdty, rdtx_frac, rdty_frac; NSPoint p; void (*render_run)(render_run_t *ri, int num); if (wi->has_alpha) render_run = RENDER_RUN_ALPHA_A; else render_run = RENDER_RUN_ALPHA; p = [matrix transformPoint: NSMakePoint(0, 0)]; fx[0] = p.x; fy[0] = p.y; p = [matrix transformPoint: NSMakePoint(ii->width, 0)]; fx[1] = p.x; fy[1] = p.y; p = [matrix transformPoint: NSMakePoint(ii->width, ii->height)]; fx[2] = p.x; fy[2] = p.y; p = [matrix transformPoint: NSMakePoint(0, ii->height)]; fx[3] = p.x; fy[3] = p.y; if (fabs(fx[0] - floor(fx[0] + .5)) < 0.001) fx[0] = floor(fx[0] + .5); if (fabs(fx[1] - floor(fx[1] + .5)) < 0.001) fx[1] = floor(fx[1] + .5); if (fabs(fx[2] - floor(fx[2] + .5)) < 0.001) fx[2] = floor(fx[2] + .5); if (fabs(fx[3] - floor(fx[3] + .5)) < 0.001) fx[3] = floor(fx[3] + .5); if (fabs(fy[0] - floor(fy[0] + .5)) < 0.001) fy[0] = floor(fy[0] + .5); if (fabs(fy[1] - floor(fy[1] + .5)) < 0.001) fy[1] = floor(fy[1] + .5); if (fabs(fy[2] - floor(fy[2] + .5)) < 0.001) fy[2] = floor(fy[2] + .5); if (fabs(fy[3] - floor(fy[3] + .5)) < 0.001) fy[3] = floor(fy[3] + .5); x[0] = floor(fx[0]) - offset.x; y[0] = offset.y - floor(fy[0]); x[1] = floor(fx[1]) - offset.x; y[1] = offset.y - floor(fy[1]); x[2] = floor(fx[2]) - offset.x; y[2] = offset.y - floor(fy[2]); x[3] = floor(fx[3]) - offset.x; y[3] = offset.y - floor(fy[3]); tx[0] = 0; ty[0] = ii->height; tx[1] = ii->width; ty[1] = ii->height; tx[2] = ii->width; ty[2] = 0; tx[3] = 0; ty[3] = 0; cy = y[le = 0]; if (y[1] < cy) cy = y[le = 1]; if (y[2] < cy) cy = y[le = 2]; if (y[3] < cy) cy = y[le = 3]; re = le; ey = y[0]; if (y[1] > ey) ey = y[1]; if (y[2] > ey) ey = y[2]; if (y[3] > ey) ey = y[3]; if (x[(le + 1) & 3] < x[(le - 1) & 3]) left_delta = 1; else left_delta = -1; /* printf("x/y (%i %i) (%i %i) (%i %i) (%i %i) t (%i %i) (%i %i) (%i %i) (%i %i) le=%i\n", x[0],y[0], x[1],y[1], x[2],y[2], x[3],y[3], tx[0],ty[0], tx[1],ty[1], tx[2],ty[2], tx[3],ty[3], le);*/ /* silence the compiler */ lx = lx_frac = ldx = ldx_frac = l_de = 0; rx = rx_frac = rdx = rdx_frac = r_de = 0; ltx = lty = ltx_frac = lty_frac = ldtx = ldty = ldtx_frac = ldty_frac = 0; rtx = rty = rtx_frac = rty_frac = rdtx = rdty = rdtx_frac = rdty_frac = 0; while (cy <= ey && cy < clip_y1) { if (cy == y[le]) { next = (le + left_delta) & 3; while (y[le] == y[next]) { le = next; next = (le + left_delta) & 3; } l_de = y[next] - y[le]; lx = x[le]; lx_frac = 0; ldx = (x[next] - x[le]) / l_de; ldx_frac = (x[next] - x[le]) % l_de; ltx = tx[le]; lty = ty[le]; ltx_frac = 0; lty_frac = 0; ldtx = (tx[next] - tx[le]) / l_de; ldty = (ty[next] - ty[le]) / l_de; ldtx_frac = (tx[next] - tx[le]) % l_de; ldty_frac = (ty[next] - ty[le]) % l_de; le = next; } else { lx += ldx; lx_frac += ldx_frac; if (lx_frac < 0) lx--, lx_frac += l_de; if (lx_frac > l_de) lx++, lx_frac -= l_de; ltx += ldtx; ltx_frac += ldtx_frac; if (ltx_frac < 0) ltx--, ltx_frac += l_de; if (ltx_frac > l_de) ltx++, ltx_frac -= l_de; lty += ldty; lty_frac += ldty_frac; if (lty_frac < 0) lty--, lty_frac += l_de; if (lty_frac > l_de) lty++, lty_frac -= l_de; } if (cy == y[re]) { next = (re - left_delta) & 3; while (y[re] == y[next]) { re = next; next = (re - left_delta) & 3; } r_de = y[next] - y[re]; rx = x[re]; rx_frac = r_de - 1; /* TODO? */ rdx = (x[next] - x[re]) / r_de; rdx_frac = (x[next] - x[re]) % r_de; rtx = tx[re]; rty = ty[re]; rtx_frac = 0; rty_frac = 0; rdtx = (tx[next] - tx[re]) / r_de; rdty = (ty[next] - ty[re]) / r_de; rdtx_frac = (tx[next] - tx[re]) % r_de; rdty_frac = (ty[next] - ty[re]) % r_de; re = next; } else { rx += rdx; rx_frac += rdx_frac; if (rx_frac < 0) rx--, rx_frac += r_de; if (rx_frac > r_de) rx++, rx_frac -= r_de; rtx += rdtx; rtx_frac += rdtx_frac; if (rtx_frac < 0) rtx--, rtx_frac += r_de; if (rtx_frac > r_de) rtx++, rtx_frac -= r_de; rty += rdty; rty_frac += rdty_frac; if (rty_frac < 0) rty--, rty_frac += r_de; if (rty_frac > r_de) rty++, rty_frac -= r_de; } /* printf("cy=%i left(x=%i, tx=%i, ty=%i) right(x=%i, tx=%i, ty=%i)\n", cy, lx,ltx,lty, rx,rtx,rty);*/ if (cy >= clip_y0 && rx > lx) { render_run_t ri; int x0, x1, de; int tx, ty, tx_frac, ty_frac, dtx, dty, dtx_frac, dty_frac; int delta; int scale_factor; x0 = lx; x1 = rx; de = x1 - x0; tx = ltx; ty = lty; if (r_de * l_de > 0x10000) { /* If the numbers involved are really large, scale things down a bit. This loses some accuracy, but should keep things in range. */ scale_factor = 10; tx_frac = ltx_frac * ((de * r_de) >> scale_factor); ty_frac = lty_frac * ((de * r_de) >> scale_factor); de *= (r_de * l_de) >> scale_factor; } else { tx_frac = ltx_frac * de * r_de; ty_frac = lty_frac * de * r_de; scale_factor = 0; de *= r_de * l_de; } delta = ((rtx * r_de + rtx_frac) >> scale_factor) * l_de - ((ltx * l_de + ltx_frac) >> scale_factor) * r_de; dtx = delta / de; dtx_frac = delta % de; delta = ((rty * r_de + rty_frac) >> scale_factor) * l_de - ((lty * l_de + lty_frac) >> scale_factor) * r_de; dty = delta / de; dty_frac = delta % de; /* printf("r_de=%i l_de=%i de=%i dtx=%i dtx_frac=%i dty=%i dty_frac=%i\n", r_de,l_de,de,dtx,dtx_frac,dty,dty_frac); printf(" start at x(%i %i) y(%i %i)\n", tx,tx_frac,ty,ty_frac);*/ /* x0 x1 / x2 -> y0 y1 / y2 z ((y0 * y2 + y1) * x2 - (x0 * x2 + x1) * y2) / (x2 * y2 * z) */ /* TODO: Would like to use this code instead for speed, but the multiplications dtx*(clip_x0-x0) may overflow. Need to figure out a way of doing this safely, or add checks for 'large numbers' so we can use this in most cases, at least. */ /* if (x0 < clip_x0) { tx += dtx * (clip_x0 - x0); ty += dty * (clip_x0 - x0); tx_frac += dtx_frac * (clip_x0 - x0); while (tx_frac < 0) tx--, tx_frac += de; while (tx_frac >= de) tx++, tx_frac -= de; ty_frac += dty_frac * (clip_x0 - x0); while (ty_frac < 0) ty--, ty_frac += de; while (ty_frac >= de) ty++, ty_frac -= de; x0 = clip_x0; }*/ if (x0 < clip_x0) { tx += dtx * (clip_x0 - x0); ty += dty * (clip_x0 - x0); while (x0 < clip_x0) { tx_frac += dtx_frac; if (tx_frac < 0) tx--, tx_frac += de; if (tx_frac >= de) tx++, tx_frac -= de; ty_frac += dty_frac; if (ty_frac < 0) ty--, ty_frac += de; if (ty_frac >= de) ty++, ty_frac -= de; x0++; } } if (x1 > clip_x1) x1 = clip_x1; ri.dst = wi->data + x0 * DI.bytes_per_pixel + cy * wi->bytes_per_line; ri.dsta = wi->alpha + x0 + cy * wi->sx; if (!clip_span) { for (; x0 < x1; x0++, ri.dst += DI.bytes_per_pixel, ri.dsta++) { ifunc(ii, &ri, tx, ty); render_run(&ri, 1); tx += dtx; ty += dty; tx_frac += dtx_frac; if (tx_frac < 0) tx--, tx_frac += de; if (tx_frac >= de) tx++, tx_frac -= de; ty_frac += dty_frac; if (ty_frac < 0) ty--, ty_frac += de; if (ty_frac >= de) ty++, ty_frac -= de; } } else { unsigned int *span, *end; BOOL state = NO; span = &clip_span[clip_index[cy - clip_y0]]; end = &clip_span[clip_index[cy - clip_y0 + 1]]; x0 -= clip_x0; x1 -= clip_x0; while (span != end && *span < x0) { state = !state; span++; if (span == end) break; } if (span != end) { for (; x0 < x1; x0++, ri.dst += DI.bytes_per_pixel, ri.dsta++) { if (x0 == *span) { span++; state = !state; if (span == end) break; } if (state) { ifunc(ii, &ri, tx, ty); render_run(&ri, 1); } tx += dtx; ty += dty; tx_frac += dtx_frac; if (tx_frac < 0) tx--, tx_frac += de; if (tx_frac >= de) tx++, tx_frac -= de; ty_frac += dty_frac; if (ty_frac < 0) ty--, ty_frac += de; if (ty_frac >= de) ty++, ty_frac -= de; } } } } cy++; } } - (void)DPSimage: (NSAffineTransform *) matrix : (NSInteger) pixelsWide : (NSInteger) pixelsHigh : (NSInteger) bitsPerSample : (NSInteger) samplesPerPixel : (NSInteger) bitsPerPixel : (NSInteger) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data { BOOL identity_transform, is_rgb; image_info_t ii; NSAffineTransformStruct ts; if (!wi || !wi->data) return; if (all_clipped) return; [matrix prependTransform: ctm]; ts = [matrix transformStruct]; if (fabs(ts.m11 - 1.0) < 0.001 && fabs(ts.m12) < 0.001 && fabs(ts.m22 - 1.0) < 0.001 && fabs(ts.m21) < 0.001) identity_transform = YES; else identity_transform = NO; if (colorSpaceName == NSDeviceRGBColorSpace || colorSpaceName == NSCalibratedRGBColorSpace) is_rgb = YES; else is_rgb = NO; /* optimize common case */ if (identity_transform && is_rgb && !clip_span && bitsPerSample == 8 && !isPlanar && bytesPerRow == samplesPerPixel * pixelsWide && ((samplesPerPixel == 3 && bitsPerPixel == 24 && !hasAlpha) || (samplesPerPixel == 4 && bitsPerPixel == 32 && hasAlpha))) { int x, y, ox, oy; const unsigned char *src = data[0]; unsigned char *alpha_dest; render_run_t ri; if (wi->has_alpha) { if (DI.inline_alpha) alpha_dest = wi->data + DI.inline_alpha_ofs; else alpha_dest = wi->alpha; } else alpha_dest = NULL; ox = [matrix transformPoint: NSMakePoint(0, 0)].x - offset.x; oy = offset.y - [matrix transformPoint: NSMakePoint(0, 0)].y - pixelsHigh; for (y = 0; y < pixelsHigh; y++) { for (x = 0; x < pixelsWide; x++) { if (x + ox < clip_x0 || x + ox >= clip_x1 || y + oy < clip_y0 || y + oy >= clip_y1) { if (hasAlpha) src += 4; else src += 3; continue; } ri.dst = wi->data + (x + ox) * DI.bytes_per_pixel + (y + oy) * wi->bytes_per_line; ri.dsta = wi->alpha + (x + ox) + (y + oy) * wi->sx; ri.r = src[0]; ri.g = src[1]; ri.b = src[2]; if (hasAlpha) { ri.a = src[3]; /* Undo premultiply */ if (ri.a && ri.a != 255) { ri.r = (255 * ri.r) / ri.a; ri.g = (255 * ri.g) / ri.a; ri.b = (255 * ri.b) / ri.a; } if (alpha_dest) { if (src[3] == 255) RENDER_RUN_OPAQUE_A(&ri, 1); else if (src[3]) RENDER_RUN_ALPHA_A(&ri, 1); } else { if (src[3] == 255) RENDER_RUN_OPAQUE(&ri, 1); else if (src[3]) RENDER_RUN_ALPHA(&ri, 1); } src += 4; } else { ri.a = 255; if (alpha_dest) RENDER_RUN_OPAQUE_A(&ri, 1); else RENDER_RUN_OPAQUE(&ri, 1); src += 3; } } } UPDATE_UNBUFFERED return; } ii.bits_per_sample = bitsPerSample; ii.bits_per_pixel = bitsPerPixel; ii.is_planar = isPlanar; ii.has_alpha = hasAlpha; ii.width = pixelsWide; ii.height = pixelsHigh; ii.samples_per_pixel = samplesPerPixel; ii.bytes_per_row = bytesPerRow; ii.data = (const unsigned char **)data; if (bitsPerSample == 8 && is_rgb && ((samplesPerPixel == 3 && !hasAlpha) || (samplesPerPixel == 4 && hasAlpha))) { [self _image_do_rgb_transform: &ii : matrix : _image_get_color_rgb_8]; UPDATE_UNBUFFERED return; } if (is_rgb) ii.colorspace = 1; else if (colorSpaceName == NSDeviceCMYKColorSpace) ii.colorspace = 2; else if (colorSpaceName == NSDeviceWhiteColorSpace || colorSpaceName == NSCalibratedWhiteColorSpace) ii.colorspace = 3; else if (colorSpaceName == NSDeviceBlackColorSpace || colorSpaceName == NSCalibratedBlackColorSpace) ii.colorspace = 4; else ii.colorspace = 0; if (ii.colorspace != 0) { [self _image_do_rgb_transform: &ii : matrix : _image_get_color_rgb_cmyk_gray]; UPDATE_UNBUFFERED return; } NSLog(@"unimplemented DPSimage %lix%li |%@| bips=%li spp=%li bipp=%li bypr=%li planar=%i alpha=%i\n", pixelsWide, pixelsHigh, matrix, bitsPerSample, samplesPerPixel, bitsPerPixel, bytesPerRow, isPlanar, hasAlpha); } @end gnustep-back-0.29.0/Source/art/path.m000066400000000000000000000736001404163720200173320ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Path handling. */ #include #include #include #include "ARTGState.h" #ifndef RDS #include "x11/XWindowBuffer.h" #endif #include "blit.h" #include #include #if 0 /* useful when debugging */ static void dump_vpath(ArtVpath *vp) { int i; printf("** dumping %p **\n", vp); for (i = 0; ; i++) { if (vp[i].code == ART_MOVETO_OPEN) printf(" moveto_open"); else if (vp[i].code == ART_MOVETO) printf(" moveto"); else if (vp[i].code == ART_LINETO) printf(" lineto"); else if (vp[i].code == ART_END) printf(" end"); else printf(" unknown %i", vp[i].code); printf(" (%g %g)\n", vp[i].x, vp[i].y); if (vp[i].code == ART_END) break; } } static void dump_bpath(ArtBpath *vp) { int i; printf("** dumping %p **\n", vp); for (i = 0; ; i++) { if (vp[i].code == ART_MOVETO_OPEN) printf(" moveto_open"); else if (vp[i].code == ART_MOVETO) printf(" moveto"); else if (vp[i].code == ART_LINETO) printf(" lineto"); else if (vp[i].code == ART_CURVETO) printf(" curveto"); else printf(" unknown %i", vp[i].code); printf(" (%g %g) (%g %g) (%g %g)\n", vp[i].x1, vp[i].y1, vp[i].x2, vp[i].y2, vp[i].x3, vp[i].y3); if (vp[i].code == ART_END) break; } } { int i; NSBezierPathElement type; NSPoint pts[3]; for (i = 0; i < [newPath elementCount]; i++) { type = [newPath elementAtIndex: i associatedPoints: pts]; switch (type) { case NSMoveToBezierPathElement: printf("moveto (%g %g)\n", pts[0].x, pts[0].y); break; case NSLineToBezierPathElement: printf("lineto (%g %g)\n", pts[0].x, pts[0].y); break; case NSCurveToBezierPathElement: printf("curveto (%g %g) (%g %g) (%g %g)\n", pts[0].x, pts[0].y, pts[1].x, pts[1].y, pts[2].x, pts[2].y); break; } } } { int i,j; printf("size=%i num=%i\n",ci.span_size,ci.num_span); for (i=0;ix0, x1; int num; int alpha; unsigned char *dst, *dsta; alpha = start; /* empty line; very common case */ if (alpha < 0x10000 && !n_steps) { ri->ri.dst += ri->rowstride; ri->ri.dsta += ri->arowstride; return; } dst = ri->ri.dst + ri->rowstride; dsta = ri->ri.dsta + ri->arowstride; for (; n_steps; n_steps--, steps++) { x1 = steps->x; num = x1 - x0; ri->ri.a = (alpha * ri->real_a + 0x800000) >> 24; if (ri->ri.a && num) { if (ri->ri.a == 255) ri->run_opaque(&ri->ri, num); else ri->run_alpha(&ri->ri, num); } ri->ri.dst += ri->bpp * num; ri->ri.dsta += num; alpha += steps->delta; x0 = x1; } x1 = ri->x1; num = x1 - x0; ri->ri.a = (alpha * ri->real_a + 0x800000) >> 24; if (ri->ri.a && num) { if (ri->ri.a == 255) ri->run_opaque(&ri->ri, num); else ri->run_alpha(&ri->ri, num); } ri->ri.dst = dst; ri->ri.dsta = dsta; } static void render_svp_clipped_callback(void *data, int y, int start, ArtSVPRenderAAStep *steps, int n_steps) { svp_render_info_t *ri = data; int x0, x1; int num; int alpha; unsigned char *dst, *dsta; unsigned int *span, *end; BOOL state; alpha = start; /* empty line; very common case */ if (alpha < 0x10000 && !n_steps) { ri->ri.dst += ri->rowstride; ri->ri.dsta += ri->arowstride; return; } /* completely clipped line? */ if (ri->clip_index[y - ri->y0] == ri->clip_index[y - ri->y0 + 1]) { ri->ri.dst += ri->rowstride; ri->ri.dsta += ri->arowstride; return; } span = &ri->clip_span[ri->clip_index[y - ri->y0]]; end = &ri->clip_span[ri->clip_index[y - ri->y0 + 1]]; state = NO; dst = ri->ri.dst + ri->rowstride; dsta = ri->ri.dsta + ri->arowstride; x0 = 0; for (; n_steps; n_steps--, steps++) { x1 = steps->x - ri->x0; ri->ri.a = (alpha * ri->real_a + 0x800000) >> 24; if (ri->ri.a) { while (*span < x1) { num = *span - x0; if (state) { if (ri->ri.a == 255) ri->run_opaque(&ri->ri, num); else ri->run_alpha(&ri->ri, num); } x0 = *span; ri->ri.dst += ri->bpp * num; ri->ri.dsta += num; state = !state; span++; if (span == end) { ri->ri.dst = dst; ri->ri.dsta = dsta; return; } } num = x1 - x0; if (num && state) { if (ri->ri.a == 255) ri->run_opaque(&ri->ri, num); else ri->run_alpha(&ri->ri, num); } ri->ri.dst += ri->bpp * num; ri->ri.dsta += num; } else { num = x1 - x0; while (*span <= x1) { state = !state; span++; if (span == end) { ri->ri.dst = dst; ri->ri.dsta = dsta; return; } } ri->ri.dst += ri->bpp * num; ri->ri.dsta += num; } alpha += steps->delta; x0 = x1; } x1 = ri->x1 - ri->x0; num = x1 - x0; ri->ri.a = (alpha * ri->real_a + 0x800000) >> 24; if (ri->ri.a && num) { while (*span < x1) { num = *span - x0; if (state) { if (ri->ri.a == 255) ri->run_opaque(&ri->ri, num); else ri->run_alpha(&ri->ri, num); } x0 = *span; ri->ri.dst += ri->bpp * num; ri->ri.dsta += num; state = !state; span++; if (span == end) { ri->ri.dst = dst; ri->ri.dsta = dsta; return; } } num = x1 - x0; if (num && state) { if (ri->ri.a == 255) ri->run_opaque(&ri->ri, num); else ri->run_alpha(&ri->ri, num); } } ri->ri.dst = dst; ri->ri.dsta = dsta; } static void artcontext_render_svp(const ArtSVP *svp, int x0, int y0, int x1, int y1, unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned char *dst, int rowstride, unsigned char *dsta, int arowstride, int has_alpha, draw_info_t *di, unsigned int *clip_span, unsigned int *clip_index) { svp_render_info_t ri; ri.x0 = x0; ri.x1 = x1; ri.y0 = y0; ri.ri.r = r; ri.ri.g = g; ri.ri.b = b; ri.real_a = ri.ri.a = a; ri.bpp = di->bytes_per_pixel; ri.ri.dst = dst; ri.rowstride = rowstride; ri.clip_span = clip_span; ri.clip_index = clip_index; if (has_alpha) { ri.ri.dsta = dsta; ri.arowstride = arowstride; ri.run_alpha = di->render_run_alpha_a; ri.run_opaque = di->render_run_opaque_a; } else { ri.run_alpha = di->render_run_alpha; ri.run_opaque = di->render_run_opaque; } art_svp_render_aa(svp, x0, y0, x1, y1, clip_span? render_svp_clipped_callback : render_svp_callback, &ri); } @implementation ARTGState (path) /* Fills in vp. If the rectangle is axis- (and optionally pixel)-aligned, also fills in the axis coordinates (x0/y0 is min) and returns 1. Otherwise returns 0. (Actually, if pixel is NO, it's enough that the edges remain within one pixel.) */ - (int) _axis_rectangle: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h vpath: (ArtVpath *)vp axis: (int *)px0 : (int *)py0 : (int *)px1 : (int *)py1 pixel: (BOOL)pixel { float matrix[6]; float det; int i; int x0, y0, x1, y1; NSAffineTransformStruct ts = [ctm transformStruct]; if (w < 0) x += w, w = -w; if (h < 0) y += h, h = -h; matrix[0] = ts.m11; matrix[1] = -ts.m12; matrix[2] = ts.m21; matrix[3] = -ts.m22; matrix[4] = ts.tX - offset.x; matrix[5] = -ts.tY + offset.y; /* If the matrix is 'inverted', ie. if the determinant is negative, we need to flip the order of the vertices. Since it's a rectangle we can just swap vertex 1 and 3. */ det = matrix[0] * matrix[3] - matrix[1] * matrix[2]; vp[0].code = ART_MOVETO; vp[0].x = x * matrix[0] + y * matrix[2] + matrix[4]; vp[0].y = x * matrix[1] + y * matrix[3] + matrix[5]; i = det > 0? 3 : 1; vp[i].code = ART_LINETO; vp[i].x = vp[0].x + w * matrix[0]; vp[i].y = vp[0].y + w * matrix[1]; vp[2].code = ART_LINETO; vp[2].x = vp[0].x + w * matrix[0] + h * matrix[2]; vp[2].y = vp[0].y + w * matrix[1] + h * matrix[3]; i ^= 2; vp[i].code = ART_LINETO; vp[i].x = vp[0].x + h * matrix[2]; vp[i].y = vp[0].y + h * matrix[3]; vp[4].code = ART_LINETO; vp[4].x = vp[0].x; vp[4].y = vp[0].y; vp[5].code = ART_END; vp[5].x = vp[5].y = 0; /* Check if this rectangle is axis-aligned and on whole pixel boundaries. */ x0 = vp[0].x + 0.5; x1 = vp[2].x + 0.5; y0 = vp[0].y + 0.5; y1 = vp[2].y + 0.5; if (pixel) { if (x0 > x1) *px0 = x1, *px1 = x0; else *px0 = x0, *px1 = x1; if (y0 > y1) *py0 = y1, *py1 = y0; else *py0 = y0, *py1 = y1; if (fabs(vp[0].x - vp[1].x) < 0.01 && fabs(vp[1].y - vp[2].y) < 0.01 && fabs(vp[0].x - x0) < 0.01 && fabs(vp[0].y - y0) < 0.01 && fabs(vp[2].x - x1) < 0.01 && fabs(vp[2].y - y1) < 0.01) { return 1; } if (fabs(vp[0].y - vp[1].y) < 0.01 && fabs(vp[1].x - vp[2].x) < 0.01 && fabs(vp[0].x - x0) < 0.01 && fabs(vp[0].y - y0) < 0.01 && fabs(vp[2].x - x1) < 0.01 && fabs(vp[2].y - y1) < 0.01) { return 1; } } else { /* This is used when clipping, so we need to make sure we contain all pixels. */ if (vp[0].x < vp[2].x) *px0 = floor(vp[0].x), *px1 = ceil(vp[2].x); else *px0 = floor(vp[2].x), *px1 = ceil(vp[0].x); if (vp[0].y < vp[2].y) *py0 = floor(vp[0].y), *py1 = ceil(vp[2].y); else *py0 = floor(vp[2].y), *py1 = ceil(vp[0].y); if (floor(vp[0].x) == floor(vp[1].x) && floor(vp[0].y) == floor(vp[3].y) && floor(vp[1].y) == floor(vp[2].y) && floor(vp[2].x) == floor(vp[3].x)) { return 1; } if (floor(vp[0].y) == floor(vp[1].y) && floor(vp[0].x) == floor(vp[3].x) && floor(vp[1].x) == floor(vp[2].x) && floor(vp[2].y) == floor(vp[3].y)) { return 1; } } return 0; } - (ArtVpath *) _vpath_from_current_path: (BOOL)fill { ArtBpath *bpath, *bp2; ArtVpath *vp; int i, j, c, cur_start, cur_line; NSPoint points[3]; NSBezierPathElement t; double matrix[6]; c = [path elementCount]; if (!c) return NULL; if (fill) bpath = art_new(ArtBpath, 2 * c + 1); else bpath = art_new(ArtBpath, c + 1); cur_start = -1; cur_line = 0; for (i = j = 0; i < c; i++) { t = [path elementAtIndex: i associatedPoints: points]; switch (t) { case NSMoveToBezierPathElement: /* When filling, the path must be closed, so if it isn't already closed, we fix that here. */ if (fill) { if (cur_start != -1 && cur_line) { if (bpath[j - 1].x3 != bpath[cur_start].x3 || bpath[j - 1].y3 != bpath[cur_start].y3) { bpath[j].x3 = bpath[cur_start].x3; bpath[j].y3 = bpath[cur_start].y3; bpath[j].code = ART_LINETO; j++; } } bpath[j].code = ART_MOVETO; } else { bpath[j].code = ART_MOVETO_OPEN; } bpath[j].x3 = points[0].x; bpath[j].y3 = points[0].y; cur_start = j; j++; cur_line = 0; break; case NSLineToBezierPathElement: cur_line++; bpath[j].code = ART_LINETO; bpath[j].x3 = points[0].x; bpath[j].y3 = points[0].y; j++; break; case NSCurveToBezierPathElement: cur_line++; bpath[j].code = ART_CURVETO; bpath[j].x1 = points[0].x; bpath[j].y1 = points[0].y; bpath[j].x2 = points[1].x; bpath[j].y2 = points[1].y; bpath[j].x3 = points[2].x; bpath[j].y3 = points[2].y; j++; break; case NSClosePathBezierPathElement: if (cur_start != -1 && cur_line) { bpath[cur_start].code = ART_MOVETO; bpath[j].code = ART_LINETO; bpath[j].x3 = bpath[cur_start].x3; bpath[j].y3 = bpath[cur_start].y3; j++; } break; default: NSLog(@"invalid type %i\n", t); art_free(bpath); return NULL; } } if (fill && cur_start != -1 && cur_line) { if (bpath[j - 1].x3 != bpath[cur_start].x3 || bpath[j - 1].y3 != bpath[cur_start].y3) { bpath[j].x3 = bpath[cur_start].x3; bpath[j].y3 = bpath[cur_start].y3; bpath[j].code = ART_LINETO; j++; } } bpath[j].code = ART_END; matrix[0]= 1; matrix[1]= 0; matrix[2]= 0; matrix[3]=-1; matrix[4]= 0 - offset.x; matrix[5]= offset.y; bp2 = art_bpath_affine_transform(bpath, matrix); art_free(bpath); vp = art_bez_path_to_vec(bp2, 0.5); art_free(bp2); return vp; } /** Clipping **/ typedef struct { int x0, x1, y0, sy; int minx,maxx; int first_y,last_y; unsigned int *span; unsigned int *index; int span_size, num_span; unsigned int *cur_span; unsigned int *cur_index; } clip_info_t; static void clip_svp_callback(void *data, int y, int start, ArtSVPRenderAAStep *steps, int n_steps) { clip_info_t *ci = data; int x; int alpha; BOOL state, nstate; alpha = start; ci->index[y - ci->y0 - ci->first_y] = ci->num_span; if (y-ci->y0<0 || y-ci->y0>=ci->sy) { printf("weird y=%i (%i)\n",y,y-ci->y0); } /* empty line; very common case */ if (alpha < 0x10000 && !n_steps) { if (ci->first_y == y - ci->y0) ci->first_y++; return; } ci->last_y = y - ci->y0 + 1; x = 0; state = alpha >= 0x10000; if (state) { if (ci->num_span == ci->span_size) { ci->span_size += 16; ci->span = realloc(ci->span, sizeof(unsigned int) * ci->span_size); } ci->span[ci->num_span++] = x; if (x < ci->minx) ci->minx = x; } for (; n_steps; n_steps--, steps++) { alpha += steps->delta; x = steps->x - ci->x0; nstate = alpha >= 0x10000; if (state != nstate) { if (ci->num_span == ci->span_size) { ci->span_size += 16; ci->span = realloc(ci->span, sizeof(unsigned int) * ci->span_size); } ci->span[ci->num_span++] = x; if (x < ci->minx) ci->minx = x; if (x > ci->maxx) ci->maxx = x; state = nstate; } } if (state) { if (ci->num_span == ci->span_size) { ci->span_size += 16; ci->span = realloc(ci->span, sizeof(unsigned int) * ci->span_size); } x = ci->x1 - ci->x0; ci->span[ci->num_span++] = x; if (x > ci->maxx) ci->maxx = x; } } /* will free the passed in svp */ - (void) _clip_add_svp: (ArtSVP *)svp { clip_info_t ci; ci.span = NULL; ci.index = malloc(sizeof(unsigned int) * (clip_sy + 1)); if (!ci.index) { NSLog(@"Warning: out of memory calculating clipping spans (%lu bytes)", sizeof(unsigned int) * (clip_sy + 1)); return; } ci.span_size = ci.num_span = 0; ci.x0 = clip_x0; ci.x1 = clip_x1; ci.y0 = clip_y0; ci.sy = clip_sy; ci.minx = ci.x1 - ci.x0; ci.maxx = 0; ci.first_y = 0; ci.last_y = -1; if (clip_span) { NSLog(@"TODO: _clip_add_svp: with existing clip_span not implemented"); free(ci.index); return; } else { art_svp_render_aa(svp, clip_x0, clip_y0, clip_x1, clip_y1, clip_svp_callback, &ci); if (!ci.span) { /* This can happen if the path is empty, or doesn't intersect the current clipping path. The result then is that everything is clipped. */ free(ci.index); all_clipped = YES; clip_x0 = clip_x1 = clip_sx = 0; clip_y0 = clip_y1 = clip_sy = 0; return; } clip_span = ci.span; clip_index = ci.index; clip_index[clip_sy - ci.first_y] = clip_num_span = ci.num_span; clip_y1 = clip_y0 + ci.last_y; clip_y0 += ci.first_y; clip_sy = clip_y1 - clip_y0; if (clip_y1 <= clip_y0) all_clipped = YES; if (ci.minx > 0) { int i; for (i = 0; i < clip_num_span; i++) { if (clip_span[i] < ci.minx) NSLog(@"_clip_add_svp: clip_span[i]<0 when adjusting for minx"); clip_span[i] -= ci.minx; if (clip_span[i] > ci.maxx - ci.minx) NSLog(@"_clip_add_svp: clip_span[i] too large when adjusting for minx"); } } clip_x1 = clip_x0 + ci.maxx; clip_x0 += ci.minx; clip_sx = clip_x1 - clip_x0; if (clip_x1 <= clip_x0) all_clipped = YES; } art_svp_free(svp); } - (void) _clip: (int)rule { ArtVpath *vp; ArtSVP *svp; vp = [self _vpath_from_current_path: NO]; if (!vp) return; svp = art_svp_from_vpath(vp); art_free(vp); { ArtSVP *svp2; ArtSvpWriter *svpw; svpw = art_svp_writer_rewind_new(rule); art_svp_intersector(svp, svpw); svp2 = art_svp_writer_rewind_reap(svpw); art_svp_free(svp); svp = svp2; } [self _clip_add_svp: svp]; } - (void) DPSclip { [self _clip: ART_WIND_RULE_NONZERO]; } - (void) DPSeoclip { [self _clip: ART_WIND_RULE_ODDEVEN]; } - (void) DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { ArtVpath vp[6]; ArtSVP *svp; int x0, y0, x1, y1; int axis_aligned; [self DPSnewpath]; if (all_clipped) return; if (!wi) { all_clipped = YES; return; } axis_aligned = [self _axis_rectangle: x : y : w : h vpath: vp axis: &x0 : &y0 : &x1 : &y1 pixel: NO]; if (!axis_aligned || clip_span) { svp = art_svp_from_vpath(vp); [self _clip_add_svp: svp]; return; } if (x0 > clip_x0) clip_x0 = x0; if (y0 > clip_y0) clip_y0 = y0; if (x1 < clip_x1) clip_x1 = x1; if (y1 < clip_y1) clip_y1 = y1; if (clip_x0 >= clip_x1 || clip_y0 >= clip_y1) { all_clipped = YES; } clip_sx = clip_x1 - clip_x0; clip_sy = clip_y1 - clip_y0; } - (void) DPSinitclip; { if (!wi) { all_clipped = YES; return; } clip_x0 = clip_y0 = 0; clip_x1 = wi->sx; clip_y1 = wi->sy; all_clipped = NO; clip_sx = clip_x1 - clip_x0; clip_sy = clip_y1 - clip_y0; if (clip_span) { free(clip_span); free(clip_index); clip_span = clip_index = NULL; clip_num_span = 0; } } /** Filling **/ - (void) _fill: (int)rule { ArtVpath *vp; ArtSVP *svp; if (!wi || !wi->data) return; if (all_clipped) return; if (!fill_color[3]) return; vp = [self _vpath_from_current_path: YES]; if (!vp) return; svp = art_svp_from_vpath(vp); art_free(vp); { ArtSVP *svp2; ArtSvpWriter *svpw; svpw = art_svp_writer_rewind_new(rule); art_svp_intersector(svp, svpw); svp2 = art_svp_writer_rewind_reap(svpw); art_svp_free(svp); svp = svp2; } artcontext_render_svp(svp, clip_x0, clip_y0, clip_x1, clip_y1, fill_color[0], fill_color[1], fill_color[2], fill_color[3], CLIP_DATA, wi->bytes_per_line, wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL, wi->sx, wi->has_alpha, &DI, clip_span, clip_index); art_svp_free(svp); [path removeAllPoints]; UPDATE_UNBUFFERED } - (void) DPSeofill { if (pattern != nil) { [self eofillPath: path withPattern: pattern]; return; } [self _fill: ART_WIND_RULE_ODDEVEN]; } - (void) DPSfill { if (pattern != nil) { [self fillPath: path withPattern: pattern]; return; } [self _fill: ART_WIND_RULE_NONZERO]; } - (void) DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { ArtVpath vp[6]; ArtSVP *svp; int x0, y0, x1, y1; int axis_aligned; if (!wi || !wi->data) return; if (all_clipped) return; if (pattern != nil) { NSBezierPath *rpath; rpath = [[NSBezierPath alloc] init]; [rpath appendBezierPathWithRect: NSMakeRect(x, y, w, h)]; [rpath transformUsingAffineTransform: ctm]; [self fillPath: rpath withPattern: pattern]; RELEASE(rpath); return; } if (!fill_color[3]) return; axis_aligned = [self _axis_rectangle: x : y : w : h vpath: vp axis: &x0 : &y0 : &x1 : &y1 pixel: YES]; if (!axis_aligned || clip_span) { /* Not properly aligned. Handle the general case. */ svp = art_svp_from_vpath(vp); artcontext_render_svp(svp, clip_x0, clip_y0, clip_x1, clip_y1, fill_color[0], fill_color[1], fill_color[2], fill_color[3], CLIP_DATA, wi->bytes_per_line, wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL, wi->sx, wi->has_alpha, &DI, clip_span, clip_index); art_svp_free(svp); UPDATE_UNBUFFERED return; } /* optimize axis- and pixel-aligned rectangles */ { unsigned char *dst = CLIP_DATA; unsigned char *dsta = wi->alpha + clip_x0 + clip_y0 * wi->sx; render_run_t ri; x0 -= clip_x0; x1 -= clip_x0; if (x0 <= 0) x0 = 0; else { dst += x0 * DI.bytes_per_pixel; dsta += x0; } if (x1 > clip_sx) x1 = clip_sx; x1 -= x0; if (x1 <= 0) return; y0 -= clip_y0; y1 -= clip_y0; if (y0 <= 0) y0 = 0; else { dst += y0 * wi->bytes_per_line; dsta += y0 * wi->sx; } if (y1 > clip_sy) y1 = clip_sy; if (y1 <= y0) return; ri.dst = dst; ri.r = fill_color[0]; ri.g = fill_color[1]; ri.b = fill_color[2]; ri.a = fill_color[3]; if (wi->has_alpha) { ri.dsta = dsta; if (fill_color[3] == 255) { while (y0 < y1) { RENDER_RUN_OPAQUE_A(&ri, x1); y0++; ri.dst += wi->bytes_per_line; ri.dsta += wi->sx; } } else { while (y0 < y1) { RENDER_RUN_ALPHA_A(&ri, x1); y0++; ri.dst += wi->bytes_per_line; ri.dsta += wi->sx; } } } else { if (fill_color[3] == 255) { while (y0 < y1) { RENDER_RUN_OPAQUE(&ri, x1); y0++; ri.dst += wi->bytes_per_line; } } else { while (y0 < y1) { RENDER_RUN_ALPHA(&ri, x1); y0++; ri.dst += wi->bytes_per_line; } } } UPDATE_UNBUFFERED } } /** Stroking **/ /* will free the passed in vpath */ - (void) _stroke: (ArtVpath *)vp { double temp_scale; ArtSVP *svp; NSAffineTransformStruct ts = [ctm transformStruct]; float dash_adjust; /* TODO: this is a hack, but it's better than nothing */ /* since we flip vertically, the signs here should really be inverted, but the fabs() means that it doesn't matter */ temp_scale = sqrt(fabs(ts.m11 * ts.m22 - ts.m12 * ts.m21)); if (temp_scale <= 0) temp_scale = 1; /* If stroke-adjusting (or something equivalent) is active, we want to adjust the path so it will turn out nice and sharp. To do this, we round the line width to the closest integer width. To get sharp lines, we then want each pixel to be at an integer coordinate, or an integer plus 0.5, depending on the width and a bunch of other things. */ if (strokeadjust /* No point trying to adjust width 0 lines. (if they were implemented properly) */ && line_width > 0 /* Nor if the path is empty. */ && vp[0].code != ART_END) { int i; int effective_width = rint(temp_scale * line_width); float ofs; int last_move; /* Paths with more elements than this won't be adjusted. */ #define MAX_LEN 1024 unsigned char flags[MAX_LEN]; /* 1 start of vertical line 2 start of horizontal line 4 end-point on vertical line 8 end-point on horizontal line */ temp_scale = effective_width / line_width; if (effective_width & 1) ofs = 0.5; else ofs = 0.0; last_move = 0; /* TODO: use epsilons instead of exact comparisons? makes rounding a huge mess. */ flags[0] = 0; for (i = 1; i < MAX_LEN; i++) { flags[i] = 0; /* If this is a closed sub-path, consider the line from the last element to the moveto. */ if (vp[i].code != ART_LINETO) { if (vp[last_move].code == ART_MOVETO) { if (vp[i - 1].x == vp[last_move].x) { flags[i - 1] |= 1; flags[last_move] |= 1; } if (vp[i - 1].y == vp[last_move].y) { flags[i - 1] |= 2; flags[last_move] |= 2; } } else { if (flags[last_move] & 1) flags[last_move] |= 4; if (flags[last_move] & 2) flags[last_move] |= 8; if (flags[i - 1] & 1) flags[i - 1] |= 4; if (flags[i - 1] & 2) flags[i - 1] |= 8; } } if (vp[i].code == ART_END) break; if (vp[i].code == ART_MOVETO || vp[i].code == ART_MOVETO_OPEN) { last_move = i; } else { if (vp[i - 1].x == vp[i].x) { flags[i - 1] |= 1; flags[i] |= 1; } if (vp[i - 1].y == vp[i].y) { flags[i - 1] |= 2; flags[i] |= 2; } } } if (i < MAX_LEN) { for (i = 0; ; i++) { if (vp[i].code == ART_END) break; if (flags[i] & 1) vp[i].x = floor(vp[i].x) + ofs; else if (flags[i] & 8) vp[i].x = floor(vp[i].x + 0.5); if (flags[i] & 2) vp[i].y = floor(vp[i].y) + ofs; else if (flags[i] & 4) vp[i].y = floor(vp[i].y + 0.5); } } /* Try to line an integer dash offset up on a pixel boundary near the first point. (Safe because we know the path isn't empty at this point.) */ dash_adjust = 0.0; if (vp[1].code == ART_LINETO) { if (fabs(vp[0].x - vp[1].x) < 0.1) dash_adjust = rint(vp[0].y) - vp[0].y; else if (fabs(vp[0].y - vp[1].y) < 0.1) dash_adjust = rint(vp[0].x) - vp[0].x; } #undef MAX_LEN } else { dash_adjust = 0.0; } if (do_dash) { /* try to adjust the offset so dashes appear on pixel boundaries (otherwise it turns into an antialiased blur) */ int i; float old_offset = dash.offset; ArtVpath *vp2; if (!dash.offset) dash.offset += dash_adjust; for (i = 0; i < dash.n_dash; i++) dash.dash[i] *= temp_scale; dash.offset *= temp_scale; vp2 = art_vpath_dash(vp, &dash); dash.offset /= temp_scale; for (i = 0; i < dash.n_dash; i++) dash.dash[i] /= temp_scale; art_free(vp); vp = vp2; dash.offset = old_offset; } svp = art_svp_vpath_stroke(vp, linejoinstyle, linecapstyle, temp_scale * line_width, miter_limit, 0.5); art_free(vp); artcontext_render_svp(svp, clip_x0, clip_y0, clip_x1, clip_y1, stroke_color[0], stroke_color[1], stroke_color[2], stroke_color[3], CLIP_DATA, wi->bytes_per_line, wi->has_alpha? wi->alpha + clip_x0 + clip_y0 * wi->sx : NULL, wi->sx, wi->has_alpha, &DI, clip_span, clip_index); art_svp_free(svp); UPDATE_UNBUFFERED } - (void) DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { ArtVpath *vp, *vp2; double matrix[6]; NSAffineTransformStruct ts; if (!wi || !wi->data) return; if (all_clipped) return; if (!stroke_color[3]) return; vp = art_new(ArtVpath, 6); vp[0].code = ART_MOVETO; vp[0].x = x; vp[0].y = y; vp[1].code = ART_LINETO; vp[1].x = x + w; vp[1].y = y; vp[2].code = ART_LINETO; vp[2].x = x + w; vp[2].y = y + h; vp[3].code = ART_LINETO; vp[3].x = x; vp[3].y = y + h; vp[4].code = ART_LINETO; vp[4].x = x; vp[4].y = y; vp[5].code = ART_END; vp[5].x = vp[5].y = 0; ts = [ctm transformStruct]; matrix[0] = ts.m11; matrix[1] = -ts.m12; matrix[2] = ts.m21; matrix[3] = -ts.m22; matrix[4] = ts.tX - offset.x; matrix[5] = -ts.tY + offset.y; vp2 = art_vpath_affine_transform(vp, matrix); art_free(vp); vp = vp2; [self _stroke: vp]; } - (void) DPSstroke { /* TODO: Resolve line-width and dash scaling issues. The way this is currently done is the most obvious libart approach: 1. convert the NSBezierPath to an ArtBpath 2. transform the Bpath 3. convert the Bpath to a Vpath, approximating the curves with lines (1-3 are done in -_vpath_from_current_path:) 4. apply dashing to the Vpath (art_vpath_dash, called below) 5. stroke and convert the Vpath to an svp (art_svp_vpath_stroke, called below) To do this correctly, we need to do dashing and stroking (4 and part of 5) in user space. It is possible to do the transform _after_ step 5 (although it's less efficient), but we want to do any curve approximation (3, and 5 if there are round line ends or joins) in device space. The best way to solve this is probably to keep doing the transform first, and to add transform-aware dashing and stroking functions to libart. Currently, a single scale value is applied to dashing and stroking. This will give correct results as long as both axises are scaled the same. */ ArtVpath *vp; if (!wi || !wi->data) return; if (all_clipped) return; if (!stroke_color[3]) return; /* TODO: this is wrong. we should transform _after_ we dash and stroke */ vp = [self _vpath_from_current_path: NO]; if (!vp) return; [self _stroke: vp]; [path removeAllPoints]; } @end @interface ARTGState (path_testing) - (void) GScurrentpath: (NSBezierPath **)p; @end @implementation ARTGState (path_testing) - (void) GScurrentpath: (NSBezierPath **)p { *p = [path copy]; } @end @implementation ARTContext (path_testing) /* TODO: this is just for testing */ - (void) GScurrentpath: (NSBezierPath **)p { [(ARTGState *)gstate GScurrentpath: p]; } @end gnustep-back-0.29.0/Source/art/shfill.m000066400000000000000000000455151404163720200176630ustar00rootroot00000000000000/* Copyright (C) 2003 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* this code is rather experimental */ #include #include "ARTGState.h" #ifndef RDS #include "x11/XWindowBuffer.h" #endif #include "blit.h" #include #include #include #include #include #include /* TODO: share this with composite.m */ /* Handle compositing in transformed coordinate spaces. _rect_setup sets up the a rect_trace_t structure, and each call to _rect_advance returns YES and the left and right points on the next row, or NO if all rows are done. */ typedef struct { int x[4], y[4]; int cy, ey; int left_delta; int lx, lx_frac, ldx, ldx_frac, l_de, le; int rx, rx_frac, rdx, rdx_frac, r_de, re; int cx0, cx1; } rect_trace_t; static void _rect_setup(rect_trace_t * t, NSRect r, int cx0, int cx1, NSAffineTransform * ctm, int up, int *y0, NSPoint offset) { float fx[4], fy[4]; NSPoint p; t->cx0 = cx0; t->cx1 = cx1; p = r.origin; p = [ctm transformPoint: p]; fx[0] = p.x; fy[0] = p.y; p = r.origin; p.x += r.size.width; p = [ctm transformPoint: p]; fx[1] = p.x; fy[1] = p.y; p = r.origin; p.x += r.size.width; p.y += r.size.height; p = [ctm transformPoint: p]; fx[2] = p.x; fy[2] = p.y; p = r.origin; p.y += r.size.height; p = [ctm transformPoint: p]; fx[3] = p.x; fy[3] = p.y; if (fabs(fx[0] - floor(fx[0] + .5)) < 0.001) fx[0] = floor(fx[0] + .5); if (fabs(fx[1] - floor(fx[1] + .5)) < 0.001) fx[1] = floor(fx[1] + .5); if (fabs(fx[2] - floor(fx[2] + .5)) < 0.001) fx[2] = floor(fx[2] + .5); if (fabs(fx[3] - floor(fx[3] + .5)) < 0.001) fx[3] = floor(fx[3] + .5); if (fabs(fy[0] - floor(fy[0] + .5)) < 0.001) fy[0] = floor(fy[0] + .5); if (fabs(fy[1] - floor(fy[1] + .5)) < 0.001) fy[1] = floor(fy[1] + .5); if (fabs(fy[2] - floor(fy[2] + .5)) < 0.001) fy[2] = floor(fy[2] + .5); if (fabs(fy[3] - floor(fy[3] + .5)) < 0.001) fy[3] = floor(fy[3] + .5); t->x[0] = floor(fx[0]) - offset.x; t->y[0] = offset.y - floor(fy[0]); t->x[1] = floor(fx[1]) - offset.x; t->y[1] = offset.y - floor(fy[1]); t->x[2] = floor(fx[2]) - offset.x; t->y[2] = offset.y - floor(fy[2]); t->x[3] = floor(fx[3]) - offset.x; t->y[3] = offset.y - floor(fy[3]); /* If we're tracing the 'other way', we just flip the y -coordinates and unflip when returning them */ if (up) { t->y[0] = -t->y[0]; t->y[1] = -t->y[1]; t->y[2] = -t->y[2]; t->y[3] = -t->y[3]; } t->cy = t->y[t->le = 0]; if (t->y[1] < t->cy) t->cy = t->y[t->le = 1]; if (t->y[2] < t->cy) t->cy = t->y[t->le = 2]; if (t->y[3] < t->cy) t->cy = t->y[t->le = 3]; t->re = t->le; t->ey = t->y[0]; if (t->y[1] > t->ey) t->ey = t->y[1]; if (t->y[2] > t->ey) t->ey = t->y[2]; if (t->y[3] > t->ey) t->ey = t->y[3]; if (t->x[(t->le + 1) & 3] < t->x[(t->le - 1) & 3]) t->left_delta = 1; else t->left_delta = -1; /* silence the compiler */ t->lx = t->lx_frac = t->ldx = t->ldx_frac = t->l_de = 0; t->rx = t->rx_frac = t->rdx = t->rdx_frac = t->r_de = 0; if (up) * y0 = -t->cy; else * y0 = t->cy; } static BOOL _rect_advance(rect_trace_t * t, int *x0, int *x1) { int next; if (t->cy > t->ey) return NO; if (t->cy == t->y[t->le]) { next = (t->le + t->left_delta) & 3; if (t->y[t->le] == t->y[next]) { t->le = next; next = (t->le + t->left_delta) & 3; } t->l_de = t->y[next] - t->y[t->le]; if (!t->l_de) return NO; t->lx = t->x[t->le]; t->lx_frac = 0; t->ldx = (t->x[next] - t->x[t->le]) / t->l_de; t->ldx_frac = (t->x[next] - t->x[t->le]) % t->l_de; t->le = next; } else { t->lx += t->ldx; t->lx_frac += t->ldx_frac; if (t->lx_frac < 0) t->lx --, t->lx_frac += t->l_de; if (t->lx_frac > t->l_de) t->lx ++, t->lx_frac -= t->l_de; } if (t->cy == t->y[t->re]) { next = (t->re - t->left_delta) & 3; if (t->y[t->re] == t->y[next]) { t->re = next; next = (t->re - t->left_delta) & 3; } t->r_de = t->y[next] - t->y[t->re]; if (!t->r_de) return NO; t->rx = t->x[t->re]; t->rx_frac = t->r_de - 1; /* TODO? */ t->rdx = (t->x[next] - t->x[t->re]) / t->r_de; t->rdx_frac = (t->x[next] - t->x[t->re]) % t->r_de; t->re = next; } else { t->rx += t->rdx; t->rx_frac += t->rdx_frac; if (t->rx_frac < 0) t->rx --, t->rx_frac += t->r_de; if (t->rx_frac > t->r_de) t->rx ++, t->rx_frac -= t->r_de; } if (t->rx > t->lx && t->rx >= t->cx0 && t->lx < t->cx1) { * x0 = t->lx - t->cx0; if (* x0 < 0) * x0 = 0; * x1 = t->rx - t->cx0; if (* x1 > t->cx1 - t->cx0) * x1 = t->cx1 - t->cx0; } else { * x0 = *x1 = 0; } t->cy ++; return YES; } @implementation ARTGState (shfill) typedef struct function_s { /* General information about the function. */ int num_in, num_out; void (* eval)(struct function_s *f, double *in, double *out); double * domain; /* num_in * 2 */ double * range; /* num_out * 2 */ /* Type specific information */ int * size; /* num_in */ const unsigned char * data_source; int bits_per_sample; double * encode; /* num_in * 2 */ double * decode; /* num_out * 2 */ /* sample cache for in == 2, out == 3 */ int sample_index[2]; double sample_cache[4][3]; } function_t; static double function_getsample(function_t * f, int sample, int i) { double v; if (f->bits_per_sample == 8) { // printf("get at %i \n", sample * f->num_out +i); v = f->data_source[sample * f->num_out +i] /255.0; // printf("got %g \n", v); } else if (f->bits_per_sample == 16) { int c0, c1; c0 = f->data_source[(sample * f->num_out +i) * 2 +0]; c1 = f->data_source[(sample * f->num_out +i) * 2 + 1]; v =(c0 * 256 +c1)/65535.0; } else { NSLog(@"unhandled bits per sample %i", f->bits_per_sample); v = 0.0; } v = f->decode[i * 2] + v * (f->decode[i * 2 + 1] - f->decode[i * 2]); if (v < f->range[i * 2]) v = f->range[i * 2]; if (v > f->range[i * 2 + 1]) v = f->range[i * 2 + 1]; return v; } static void function_eval(function_t * f, double *a_in, double *out) { double in[f->num_in]; int sample[f->num_in]; int i, j, sample_index, sample_factor; unsigned int u, v; double c; for (i = 0; i < f->num_in; i ++) { in[i] =(a_in[i]-f->domain[i * 2])/(f->domain[i * 2 + 1]-f->domain[i * 2]); if (in[i] <0.0) in[i] = 0.0; if (in[i] >1.0) in[i] = 1.0; in[i] = f->encode[i * 2]+in[i]* (f->encode[i * 2 + 1]-f->encode[i * 2]); sample[i] = floor(in[i]); /* we only want sample[i] == f->size[i] -1 when f->size[i] == 1 */ if (sample[i] >= f->size[i]-1) sample[i] = f->size[i]-2; if (sample[i] <0) sample[i] = 0; in[i] = in[i]-sample[i]; if (in[i] <0.0) in[i] = 0.0; if (in[i] >1.0) in[i] = 1.0; // printf(" coord %i, sample %i, frac %g \n", i, sample[i], in[i]); } for (i = 0; inum_out; i ++) { double out_value; /* iterate over all corners in the f->num_in -dimensional hypercube we're in */ out_value = 0.0; for (u = 0; u<1<num_in; u ++) { sample_index = 0; sample_factor = 1; c = 1; for (v = 1, j = 0; jnum_in; j ++, v<<= 1) { sample_index += sample[j] * sample_factor; if (u&v) { c *= in[j]; sample_index += sample_factor; } else c *=(1.0 -in[j]); sample_factor *= f->size[j]; if (c == 0.0) break; } // printf(" %08x index %i, factor %i, c =%g \n", u, sample_index, sample_factor, c); if (c>0.0) out_value += c * function_getsample(f, sample_index, i); } // printf(" final =%g \n", out_value); out[i] = out_value; } } /* special case: f->num_in == 2, f->num_out == 3 */ static void function_eval_in2_out3(function_t * f, double *a_in, double *out) { double in[2]; int sample[2]; int i; for (i = 0; i<2; i ++) { in[i] =(a_in[i]-f->domain[i * 2])/(f->domain[i * 2 + 1]-f->domain[i * 2]); if (in[i] <0.0) in[i] = 0.0; if (in[i] >1.0) in[i] = 1.0; in[i] = f->encode[i * 2]+in[i]* (f->encode[i * 2 + 1]-f->encode[i * 2]); sample[i] = floor(in[i]); /* we only want sample[i] == f->size[i]-1 when f->size[i] == 1 */ if (sample[i] >= f->size[i]-1) sample[i] = f->size[i]-2; if (sample[i] <0) sample[i] = 0; in[i] = in[i]-sample[i]; if (in[i] <0.0) in[i] = 0.0; if (in[i] >1.0) in[i] = 1.0; // printf(" coord %i, sample %i, frac %g \n", i, sample[i], in[i]); } if (sample[0] != f->sample_index[0] || sample[1] != f->sample_index[1]) { f->sample_index[0] = sample[0]; f->sample_index[1] = sample[1]; for (i = 0; i < 3; i ++) { f->sample_cache[0][i] = function_getsample(f, sample[0] + (sample[1]) * f->size[0], i); if (sample[0] + 1 < f->size[0]) f->sample_cache[1][i] = function_getsample(f, sample[0] + 1 + (sample[1]) * f->size[0], i); if (sample[1] + 1 < f->size[1]) f->sample_cache[2][i] = function_getsample(f, sample[0] + (sample[1] + 1) * f->size[0], i); if (sample[0] + 1 < f->size[0] && sample[1] + 1 < f->size[1]) f->sample_cache[3][i] = function_getsample(f, sample[0] + 1 +(sample[1] + 1) * f->size[0], i); } } for (i = 0; i<3; i ++) { double out_value; double A, B, C, D; double p, q, pq; A = f->sample_cache[0][i]; B = f->sample_cache[1][i]; C = f->sample_cache[2][i]; D = f->sample_cache[3][i]; out_value = 0.0; p = in[0]; q = in[1]; pq = p * q; if (p!= 1.0 && q!= 1.0) out_value += A * (1 -p -q +pq); if (p!= 0.0 && q!= 1.0) out_value += B * (p -pq); if (p!= 1.0 && q!= 0.0) out_value += C * (q -pq); if (p!= 0.0 && q!= 0.0) out_value += D * pq; out[i] = out_value; } } static BOOL function_setup(NSDictionary * d, function_t *f) { NSNumber * v =[d objectForKey: @"FunctionType"]; NSArray * a; NSData * data; int i, j; if ([v intValue]!= 0) { NSDebugLLog(@"GSArt -shfill", @"FunctionType!= 0 not supported."); return NO; } memset(f, 0, sizeof(function_t)); a =[d objectForKey: @"Size"]; f->num_in =[a count]; if (!f->num_in) { NSDebugLLog(@"GSArt -shfill", @"Size has no entries."); return NO; } f->num_out =[[d objectForKey: @"Range"] count] /2; if (!f->num_out) { NSDebugLLog(@"GSArt -shfill", @"Range has no entries."); return NO; } f->bits_per_sample =[[d objectForKey: @"BitsPerSample"] intValue]; if (!(f->bits_per_sample == 8 || f->bits_per_sample == 16)) { NSDebugLLog(@"GSArt -shfill", @"BitsPerSample other than 8 or 16 aren't supported."); return NO; } data =[d objectForKey: @"DataSource"]; if (!data || ![data isKindOfClass: [NSData class]]) { NSDebugLLog(@"GSArt -shfill", @"No valid DataSource given."); return NO; } f->data_source =[data bytes]; f->size = malloc(sizeof(int) * f->num_in); f->domain = malloc(sizeof(double) * f->num_in * 2); f->range = malloc(sizeof(double) * f->num_out * 2); f->encode = malloc(sizeof(double) * f->num_in * 2); f->decode = malloc(sizeof(double) * f->num_out * 2); if (!f->size || !f->domain || !f->range || !f->encode || !f->decode) { free(f->size); f->size = NULL; free(f->domain); f->domain = NULL; free(f->range); f->range = NULL; free(f->encode); f->encode = NULL; free(f->decode); f->decode = NULL; NSDebugLLog(@"GSArt -shfill", @"Memory allocation failed."); return NO; } j = 1; for (i = 0; inum_in; i ++) { f->size[i] =[[a objectAtIndex: i] intValue]; j *= f->size[i]; f->encode[i * 2 +0] = 0; f->encode[i * 2 + 1] = f->size[i]-1; } j *= f->bits_per_sample * f->num_out; j =(j +7)/8; if ([data length] size); f->size = NULL; free(f->domain); f->domain = NULL; free(f->range); f->range = NULL; free(f->encode); f->encode = NULL; free(f->decode); f->decode = NULL; NSDebugLLog(@"GSArt -shfill", @"Need %i bytes of data, DataSource only has %lu bytes.", j, [data length]); return NO; } a =[d objectForKey: @"Domain"]; for (i = 0; inum_in * 2; i ++) f->domain[i] =[[a objectAtIndex: i] doubleValue]; a =[d objectForKey: @"Range"]; for (i = 0; inum_out * 2; i ++) f->decode[i] = f->range[i] =[[a objectAtIndex: i] doubleValue]; a =[d objectForKey: @"Decode"]; if (a) { for (i = 0; inum_out * 2; i ++) f->decode[i] =[[a objectAtIndex: i] doubleValue]; } a =[d objectForKey: @"Encode"]; if (a) { for (i = 0; inum_in * 2; i ++) f->encode[i] =[[a objectAtIndex: i] doubleValue]; } f->eval = function_eval; if (f->num_in == 2 && f->num_out == 3) { f->eval = function_eval_in2_out3; f->sample_index[0] = f->sample_index[1] =-1; } return YES; } static void function_free(function_t * f) { free(f->size); f->size = NULL; free(f->domain); f->domain = NULL; free(f->range); f->range = NULL; free(f->encode); f->encode = NULL; free(f->decode); f->decode = NULL; } - (void) DPSshfill: (NSDictionary *)shader { NSNumber * v; NSDictionary * function_dict; function_t function; NSAffineTransform * matrix, *inverse; if (!wi || !wi->data || all_clipped) return; // printf("DPSshfill: %@\n", shader); v = [shader objectForKey: @"ShadingType"]; /* only type 1 shaders */ if ([v intValue] != 1) { NSDebugLLog(@"GSArt -shfill", @"ShadingType!= 1 not supported."); return; } /* in device rgb space */ if ([shader objectForKey: @"ColorSpace"]) if (![[shader objectForKey: @"ColorSpace"] isEqual: NSDeviceRGBColorSpace]) { NSDebugLLog(@"GSArt -shfill", @"Only device RGB ColorSpace supported."); return; } function_dict =[shader objectForKey: @"Function"]; if (!function_dict) { NSDebugLLog(@"GSArt -shfill", @"Function not set."); return; } if (!function_setup(function_dict, &function)) return; if (function.num_in!= 2 || function.num_out!= 3) { function_free(&function); NSDebugLLog(@"GSArt -shfill", @"Function doesn't have 2 inputs and 3 outputs."); return; } matrix =[ctm copy]; if ([shader objectForKey: @"Matrix"]) { [matrix prependTransform: [shader objectForKey: @"Matrix"]]; } inverse = [matrix copy]; [inverse invert]; { rect_trace_t rt; NSRect rect; int y, x0, x1, x; render_run_t r; unsigned char * dst, *dsta; NSAffineTransformStruct ts; double in[2], out[3]; NSPoint p; ts = [inverse transformStruct]; rect.origin.x = function.domain[0]; rect.size.width = function.domain[1] -function.domain[0]; rect.origin.y = function.domain[2]; rect.size.height = function.domain[3] -function.domain[2]; /* printf("rect =(%g %g)+(%g %g)\n", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);*/ dst = wi->data +wi->bytes_per_line * clip_y0 +clip_x0 *DI.bytes_per_pixel; dsta = wi->alpha +wi->sx * clip_y0 +clip_x0; _rect_setup(&rt, rect, clip_x0, clip_x1, matrix, 0, &y, offset); while (y < clip_y0) { // printf("skip initial clip y =%i, %i \n", y, clip_y0); if (!_rect_advance(&rt, &x0, &x1)) goto done; // printf(" %i %i \n", x0, x1); y ++; } if (y > clip_y0) { dst += wi->bytes_per_line * (y -clip_y0); dsta += wi->sx * (y -clip_y0); } while (y < clip_y1 && _rect_advance(&rt, &x0, &x1)) { if (!clip_span) { r.dst = dst + x0 * DI.bytes_per_pixel; r.dsta = dsta + x0; p = [inverse transformPoint: NSMakePoint(clip_x0 + x0 - offset.x, offset.y - y)]; in[0] = p.x; in[1] = p.y; out[0] = out[1] = out[2] = 0.0; for (x = x0; x < x1; x ++) { function.eval(&function, in, out); r.r = out[0] * 255; r.g = out[1] * 255; r.b = out[2] * 255; if (wi->has_alpha) DI.render_run_opaque_a(&r, 1); else DI.render_run_opaque(&r, 1); r.dsta ++; r.dst += DI.bytes_per_pixel; in[0] += ts.m11; in[1] += ts.m12; } } else { unsigned int * span, *end; BOOL state = NO; span = &clip_span[clip_index[y - clip_y0]]; end = &clip_span[clip_index[y - clip_y0 + 1]]; while (span != end && *span < x0) { state = !state; span ++; } if (span != end) { while (span != end && *span < x1) { if (state) { p = [inverse transformPoint: NSMakePoint(clip_x0 + x0 - offset.x, offset.y - y)]; in[0] = p.x; in[1] = p.y; out[0] = out[1] = out[2] = 0.0; r.dst = dst + x0 * DI.bytes_per_pixel; r.dsta = dsta + x0; for (x = x0; x < *span; x ++) { function.eval(&function, in, out); r.r = out[0] * 255; r.g = out[1] * 255; r.b = out[2] * 255; if (wi->has_alpha) DI.render_run_opaque_a(&r, 1); else DI.render_run_opaque(&r, 1); r.dsta ++; r.dst += DI.bytes_per_pixel; in[0] += ts.m11; in[1] += ts.m12; } } x0 = *span; state = !state; span ++; if (span == end) break; } if (state) { p = [inverse transformPoint: NSMakePoint(clip_x0 + x0 - offset.x, offset.y - y)]; in[0] = p.x; in[1] = p.y; out[0] = out[1] = out[2] = 0.0; r.dst = dst + x0 * DI.bytes_per_pixel; r.dsta = dsta + x0; for (x = x0; x < x1; x ++) { function.eval(&function, in, out); r.r = out[0] * 255; r.g = out[1] * 255; r.b = out[2] * 255; if (wi->has_alpha) DI.render_run_opaque_a(&r, 1); else DI.render_run_opaque(&r, 1); r.dsta ++; r.dst += DI.bytes_per_pixel; in[0] += ts.m11; in[1] += ts.m12; } } } } y ++; dst += wi->bytes_per_line; dsta += wi->sx; } } UPDATE_UNBUFFERED done: DESTROY(matrix); DESTROY(inverse); function_free(&function); } @end gnustep-back-0.29.0/Source/cairo/000077500000000000000000000000001404163720200165215ustar00rootroot00000000000000gnustep-back-0.29.0/Source/cairo/CairoContext.m000066400000000000000000000213361404163720200213060ustar00rootroot00000000000000/* CairoContext.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "cairo/CairoContext.h" #include "cairo/CairoSurface.h" #include "cairo/CairoPSSurface.h" #include "cairo/CairoPDFSurface.h" #include "cairo/CairoFontInfo.h" #include "cairo/CairoFontEnumerator.h" #include "config.h" #define CGSTATE ((CairoGState *)gstate) #if BUILD_SERVER == SERVER_x11 # include "cairo/CairoGState.h" # include "x11/XGServer.h" # define _CAIRO_GSTATE_CLASSNAME CairoGState # ifdef USE_GLITZ # define _CAIRO_SURFACE_CLASSNAME XGCairoGlitzSurface # include "cairo/XGCairoGlitzSurface.h" # else //# define _CAIRO_SURFACE_CLASSNAME XGCairoSurface //# include "cairo/XGCairoSurface.h" //# define _CAIRO_SURFACE_CLASSNAME XGCairoXImageSurface //# include "cairo/XGCairoXImageSurface.h" # define _CAIRO_SURFACE_CLASSNAME XGCairoModernSurface # include "cairo/XGCairoModernSurface.h" # endif /* USE_GLITZ */ # include "x11/XGServerWindow.h" # include "x11/XWindowBuffer.h" #elif BUILD_SERVER == SERVER_win32 # include "cairo/Win32CairoGState.h" # include # include "win32/WIN32Server.h" # include "win32/WIN32Geometry.h" # define _CAIRO_GSTATE_CLASSNAME Win32CairoGState # ifdef USE_GLITZ # define _CAIRO_SURFACE_CLASSNAME Win32CairoGlitzSurface # include "cairo/Win32CairoGlitzSurface.h" # else # define _CAIRO_SURFACE_CLASSNAME Win32CairoSurface # include "cairo/Win32CairoSurface.h" # endif /* USE_GLITZ */ #elif BUILD_SERVER == SERVER_wayland # include "wayland/WaylandServer.h" # include "cairo/CairoGState.h" # include "cairo/WaylandCairoSurface.h" # define _CAIRO_GSTATE_CLASSNAME CairoGState # define _CAIRO_SURFACE_CLASSNAME WaylandCairoSurface #else # error Invalid server for Cairo backend : non implemented #endif /* BUILD_SERVER */ @implementation CairoContext + (void) initializeBackend { [NSGraphicsContext setDefaultContextClass: self]; [GSFontEnumerator setDefaultClass: [CairoFontEnumerator class]]; [GSFontInfo setDefaultClass: [CairoFontInfo class]]; } + (Class) GStateClass { return [_CAIRO_GSTATE_CLASSNAME class]; } + (BOOL) handlesPS { return YES; } - (BOOL) supportsDrawGState { return YES; } - (BOOL) isDrawingToScreen { CairoSurface *surface = nil; [CGSTATE GSCurrentSurface: &surface : NULL : NULL]; return [surface isDrawingToScreen]; } - (void) flushGraphics { // FIXME: Why is this here? When is it called? // Comments added 07/20/2013 to address the above question after // further debugging cairo/MSwindows non-retained backing store type: // This is called from NSWindow/flushWindow for the non-retained backing // store case. This code originally seems to have been added due to the // non-retained backing store type NOT showing up on XWindows/Cairo // combination and added this XFlush call to handle this case. // For MSWindows a similar problem seems to occur. However, the only // equivalent to XFlush on MSWindows is GdiFlush, which doesn't cause // the window to re-display properly. So, on MSWindows, the non-retained // cairo backend surface is currently excluded from the build and we // handle it as a buffered window expose event for now. // FIXME: Anyone know how this can be handled/fixed correctly... #if BUILD_SERVER == SERVER_x11 XFlush([(XGServer *)server xDisplay]); #elif BUILD_SERVER == SERVER_win32 CairoSurface *surface = nil; [CGSTATE GSCurrentSurface: &surface : NULL : NULL]; if ((surface != nil) && ([surface surface] != NULL)) { // Non-retained backing store types currently unsupported on MSWindows... // Currently handling such windows as buffered and invoking the handle // expose event processing... RECT rect; HWND hwnd = surface->gsDevice; GetClientRect(hwnd, &rect); NSRect frame = MSWindowRectToGS((WIN32Server*)GSCurrentServer(), hwnd, rect); [[self class] handleExposeRect: frame forDriver: surface]; } #endif } /* Private backend methods */ + (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver { #if BUILD_SERVER == SERVER_x11 if ([(id)driver isKindOfClass: [XWindowBuffer class]]) { // For XGCairoXImageSurface [(XWindowBuffer *)driver _exposeRect: rect]; } else #endif if ([(id)driver isKindOfClass: [CairoSurface class]]) { // For XGCairoModernSurface [(CairoSurface *)driver handleExposeRect: rect]; } } #if BUILD_SERVER == SERVER_x11 #ifdef XSHM + (void) _gotShmCompletion: (Drawable)d { [XWindowBuffer _gotShmCompletion: d]; } - (void) gotShmCompletion: (Drawable)d { [XWindowBuffer _gotShmCompletion: d]; } #endif // XSHM #endif // BUILD_SERVER = SERVER_x11 @end @implementation CairoContext (Ops) - (BOOL) isCompatibleBitmap: (NSBitmapImageRep*)bitmap { NSString *colorSpaceName; if ([bitmap bitmapFormat] != 0) { return NO; } if ([bitmap isPlanar]) { return NO; } if ([bitmap bitsPerSample] != 8) { return NO; } colorSpaceName = [bitmap colorSpaceName]; if (![colorSpaceName isEqualToString: NSDeviceRGBColorSpace] && ![colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) { return NO; } else { return YES; } } - (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { CairoSurface *surface; [CGSTATE GSCurrentSurface: &surface : x : y]; if (device) { *device = surface->gsDevice; } } - (void) GSSetDevice: (void *)device : (int)x : (int)y { CairoSurface *surface; surface = [[_CAIRO_SURFACE_CLASSNAME alloc] initWithDevice: device]; [CGSTATE GSSetSurface: surface : x : y]; [surface release]; } - (void) beginPrologueBBox: (NSRect)boundingBox creationDate: (NSString*)dateCreated createdBy: (NSString*)anApplication fonts: (NSString*)fontNames forWhom: (NSString*)user pages: (int)numPages title: (NSString*)aTitle { CairoSurface *surface; NSSize size; NSString *contextType; NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSPrintInfo *printInfo = [printOp printInfo]; if (printInfo != nil) { size = [printInfo paperSize]; // FIXME: This is confusing.. // When an 8.5x11 page is set to landscape, // NSPrintInfo also swaps the paperSize to be 11x8.5, // but gui also adds a 90 degree rotation as if it will // be drawing on a 8.5x11 page. So, swap 11x8.5 back to // 8.5x11 here. if ([printInfo orientation] == NSLandscapeOrientation) { size = NSMakeSize(size.height, size.width); } } else { [NSException raise: NSInternalInconsistencyException format: @"current print operation printInfo is nil in %@", NSStringFromSelector(_cmd)]; return; } contextType = [context_info objectForKey: NSGraphicsContextRepresentationFormatAttributeName]; if (contextType) { if ([contextType isEqual: NSGraphicsContextPSFormat]) { surface = [[CairoPSSurface alloc] initWithDevice: context_info]; [surface setSize: size]; // This strange setting is needed because of the way GUI handles offset. [CGSTATE GSSetSurface: surface : 0.0 : size.height]; RELEASE(surface); } else if ([contextType isEqual: NSGraphicsContextPDFFormat]) { surface = [[CairoPDFSurface alloc] initWithDevice: context_info]; [surface setSize: size]; // This strange setting is needed because of the way GUI handles offset. [CGSTATE GSSetSurface: surface : 0.0 : size.height]; RELEASE(surface); } } } - (void) showPage { [CGSTATE showPage]; } @end #undef _CAIRO_SURFACE_CLASSNAME #undef _CAIRO_GSTATE_CLASSNAME gnustep-back-0.29.0/Source/cairo/CairoFaceInfo.m000066400000000000000000000036641404163720200213400ustar00rootroot00000000000000/* CairoFaceInfo.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on original code of Alex Malmberg Rewrite: Fred Kiefer Date: Jan 2006 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/CairoFaceInfo.h" #include @implementation CairoFaceInfo - (void) dealloc { if (_fontFace) { cairo_font_face_destroy(_fontFace); } [super dealloc]; } - (void *)fontFace { if (!_fontFace) { FcPattern *resolved; FcBool scalable; resolved = [self matchedPattern]; FcPatternGetBool(resolved, FC_SCALABLE, 0, &scalable); if (scalable != FcTrue) { NSLog(@"Selected non-scalable font."); } _fontFace = cairo_ft_font_face_create_for_pattern(resolved); FcPatternDestroy(resolved); if (cairo_font_face_status(_fontFace) != CAIRO_STATUS_SUCCESS) { NSLog(@"Creating a font face failed %@", _familyName); cairo_font_face_destroy(_fontFace); _fontFace = NULL; return NULL; } } return _fontFace; } @end gnustep-back-0.29.0/Source/cairo/CairoFontEnumerator.m000066400000000000000000000025631404163720200226330ustar00rootroot00000000000000/* CairoFontEnumerator.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on original code of Alex Malmberg Rewrite: Fred Kiefer Date: Jan 2006 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/CairoFontEnumerator.h" #include "cairo/CairoFontInfo.h" @implementation CairoFontEnumerator + (Class) faceInfoClass { return [CairoFaceInfo class]; } + (CairoFaceInfo *) fontWithName: (NSString *) name { return (CairoFaceInfo *) [super fontWithName: name]; } @end gnustep-back-0.29.0/Source/cairo/CairoFontInfo.m000066400000000000000000000335671404163720200214150ustar00rootroot00000000000000/* CairoFontInfo.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on original code of Alex Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GNUstepBase/Unicode.h" #include #include #include "cairo/CairoFontInfo.h" #include "cairo/CairoFontEnumerator.h" #include #include #include FT_FREETYPE_H #include FT_SFNT_NAMES_H #include FT_TRUETYPE_TABLES_H #include FT_TYPE1_TABLES_H #include #include void set_font_options(cairo_font_options_t *options) { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; cairo_hint_metrics_t metrics = CAIRO_HINT_METRICS_ON; cairo_hint_style_t style = CAIRO_HINT_STYLE_NONE; int hinting = [ud integerForKey: @"GSFontHinting"]; int subpixel = 0; if (hinting == 0) { /* * This could be on purpose or a missing value. * In the later case use the defaults. */ if (nil == [ud objectForKey: @"GSFontHinting"]) { hinting = 33; } } /* * This part is only here to debug disabling the use of hinting for * metrics, because doing so causes menus to get cut off on the right. */ switch (hinting >> 4) { case 0: metrics = CAIRO_HINT_METRICS_DEFAULT; break; case 1: metrics = CAIRO_HINT_METRICS_OFF; break; case 2: metrics = CAIRO_HINT_METRICS_ON; break; } switch (hinting & 0x0f) { case 0: style = CAIRO_HINT_STYLE_DEFAULT; break; case 1: style = CAIRO_HINT_STYLE_NONE; break; case 2: style = CAIRO_HINT_STYLE_SLIGHT; break; case 3: style = CAIRO_HINT_STYLE_MEDIUM; break; case 4: style = CAIRO_HINT_STYLE_FULL; break; } cairo_font_options_set_hint_metrics(options, metrics); cairo_font_options_set_hint_style(options, style); if ((subpixel = [ud integerForKey: @"back-art-subpixel-text"])) { cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_SUBPIXEL); if (subpixel == 2) { cairo_font_options_set_subpixel_order(options, CAIRO_SUBPIXEL_ORDER_BGR); } else { cairo_font_options_set_subpixel_order(options, CAIRO_SUBPIXEL_ORDER_RGB); } } } @implementation CairoFontInfo - (BOOL) setupAttributes { cairo_font_extents_t font_extents; cairo_font_face_t *face; cairo_matrix_t font_matrix; cairo_matrix_t ctm; cairo_font_options_t *options; if (![super setupAttributes]) { return NO; } /* setting GSFontInfo: * xHeight, pix_width, pix_height */ cairo_matrix_init(&font_matrix, matrix[0], matrix[1], -matrix[2], matrix[3], matrix[4], matrix[5]); //cairo_matrix_scale(&font_matrix, 0.9, 0.9); cairo_matrix_init_identity(&ctm); face = [_faceInfo fontFace]; if (!face) { return NO; } // Get default font options options = cairo_font_options_create(); if (cairo_font_options_status(options) != CAIRO_STATUS_SUCCESS) { return NO; } set_font_options(options); _scaled = cairo_scaled_font_create(face, &font_matrix, &ctm, options); cairo_font_options_destroy(options); if (cairo_scaled_font_status(_scaled) != CAIRO_STATUS_SUCCESS) { return NO; } cairo_scaled_font_extents(_scaled, &font_extents); if (cairo_scaled_font_status(_scaled) != CAIRO_STATUS_SUCCESS) { return NO; } ascender = font_extents.ascent; descender = -font_extents.descent; xHeight = ascender * 0.6; lineHeight = font_extents.height; maximumAdvancement = NSMakeSize(font_extents.max_x_advance, font_extents.max_y_advance); fontBBox = NSMakeRect(0, descender, maximumAdvancement.width, ascender - descender); /* NSLog(@"Font matrix (%g, %g, %g, %g, %g, %g) type %d", matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], cairo_scaled_font_get_type(_scaled)); NSLog(@"(%@) h=%g a=%g d=%g max=(%g %g) (%g %g)+(%g %g)\n", fontName, xHeight, ascender, descender, maximumAdvancement.width, maximumAdvancement.height, fontBBox.origin.x, fontBBox.origin.y, fontBBox.size.width, fontBBox.size.height); */ return YES; } - (id) initWithFontName: (NSString *)name matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont { self = [super init]; if (!self) return nil; _screenFont = p_screenFont; fontName = [name copy]; memcpy(matrix, fmatrix, sizeof(matrix)); if (_screenFont) { /* Round up; makes the text more legible. */ matrix[0] = ceil(matrix[0]); if (matrix[3] < 0.0) matrix[3] = floor(matrix[3]); else matrix[3] = ceil(matrix[3]); } if (![self setupAttributes]) { RELEASE(self); return nil; } return self; } - (void) dealloc { if (_scaled) { cairo_scaled_font_destroy(_scaled); } [super dealloc]; } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { BOOL val = NO; if (_scaled) { FT_Face face = cairo_ft_scaled_font_lock_face(_scaled); if (FT_Get_Char_Index (face, glyph) != 0) { val = YES; } cairo_ft_scaled_font_unlock_face(_scaled); } return val; } - (NSGlyph) glyphWithName: (NSString *)glyphName { NSGlyph val = NSNullGlyph; FT_String *name = (FT_String *)[glyphName UTF8String]; if (_scaled) { FT_Face face = cairo_ft_scaled_font_lock_face(_scaled); if (FT_Has_PS_Glyph_Names(face)) { val = (NSGlyph) FT_Get_Name_Index(face, name); } cairo_ft_scaled_font_unlock_face(_scaled); } return val; } static BOOL _cairo_extents_for_NSGlyph(cairo_scaled_font_t *scaled_font, NSGlyph glyph, cairo_text_extents_t *ctext) { unichar ustr[2]; char str[4]; unsigned char *b; unsigned int size = 4; int length = 1; ustr[0] = glyph; ustr[1] = 0; b = (unsigned char *)str; if (!GSFromUnicode(&b, &size, ustr, length, NSUTF8StringEncoding, NULL, GSUniTerminate)) { NSLog(@"Conversion failed for %@", [NSString stringWithCharacters: ustr length: length]); return NO; } cairo_scaled_font_text_extents(scaled_font, str, ctext); return cairo_scaled_font_status(scaled_font) == CAIRO_STATUS_SUCCESS; } - (NSSize) advancementForGlyph: (NSGlyph)glyph { cairo_text_extents_t ctext; if (_cachedSizes) { int entry = glyph % _cacheSize; if (_cachedGlyphs[entry] == glyph) { return _cachedSizes[entry]; } if (_cairo_extents_for_NSGlyph(_scaled, glyph, &ctext)) { _cachedGlyphs[entry] = glyph; _cachedSizes[entry] = NSMakeSize(ctext.x_advance, ctext.y_advance); return _cachedSizes[entry]; } } else { if (_cairo_extents_for_NSGlyph(_scaled, glyph, &ctext)) { return NSMakeSize(ctext.x_advance, ctext.y_advance); } } return NSZeroSize; } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { cairo_text_extents_t ctext; if (_cairo_extents_for_NSGlyph(_scaled, glyph, &ctext)) { return NSMakeRect(ctext.x_bearing, ctext.y_bearing, ctext.width, ctext.height); } return NSZeroRect; } - (NSString *) displayName { return [_faceInfo displayName]; } - (CGFloat) widthOfString: (NSString *)string { cairo_text_extents_t ctext; if (!string) { return 0.0; } cairo_scaled_font_text_extents(_scaled, [string UTF8String], &ctext); if (cairo_scaled_font_status(_scaled) == CAIRO_STATUS_SUCCESS) { return ctext.width; } return 0.0; } - (void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs count: (int)length toBezierPath: (NSBezierPath *)path { cairo_format_t format = CAIRO_FORMAT_ARGB32; cairo_surface_t *isurface; cairo_t *ct; int ix = 400; int iy = 400; unsigned char *cdata; int i; unichar ustr[length+1]; char str[3*length+1]; unsigned char *b; unsigned int size = 3*length+1; cairo_status_t status; cairo_matrix_t font_matrix; for (i = 0; i < length; i++) { ustr[i] = glyphs[i]; } ustr[length] = 0; b = (unsigned char *)str; if (!GSFromUnicode(&b, &size, ustr, length, NSUTF8StringEncoding, NULL, GSUniTerminate)) { NSLog(@"Conversion failed for %@", [NSString stringWithCharacters: ustr length: length]); return; } cdata = malloc(sizeof(char) * 4 * ix * iy); if (!cdata) { NSLog(@"Could not allocate drawing space for glyphs"); return; } isurface = cairo_image_surface_create_for_data(cdata, format, ix, iy, 4*ix); status = cairo_surface_status(isurface); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while creating surface: %s", cairo_status_to_string(status)); cairo_surface_destroy(isurface); free(cdata); return; } ct = cairo_create(isurface); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while creating context: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } // Use flip matrix cairo_matrix_init(&font_matrix, matrix[0], matrix[1], matrix[2], -matrix[3], matrix[4], matrix[5]); cairo_set_font_matrix(ct, &font_matrix); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font matrix: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } cairo_set_font_face(ct, [_faceInfo fontFace]); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font face: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } // Set font options from the scaled font // FIXME: Instead of setting the matrix, setting the face, and setting // the options, we should be using cairo_set_scaled_font(). // But we have to deal with the flipped matrix here. { cairo_font_options_t *options = cairo_font_options_create(); cairo_scaled_font_get_font_options(_scaled, options); cairo_set_font_options(ct, options); cairo_font_options_destroy(options); } if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font options: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } if ([path elementCount] > 0) { NSPoint p; p = [path currentPoint]; cairo_move_to(ct, floorf(p.x), floorf(p.y)); } cairo_text_path(ct, str); if (cairo_status(ct) == CAIRO_STATUS_SUCCESS) { cairo_path_t *cpath; cairo_path_data_t *data; cpath = cairo_copy_path(ct); for (i = 0; i < cpath->num_data; i += cpath->data[i].header.length) { data = &cpath->data[i]; switch (data->header.type) { case CAIRO_PATH_MOVE_TO: [path moveToPoint: NSMakePoint(data[1].point.x, data[1].point.y)]; break; case CAIRO_PATH_LINE_TO: [path lineToPoint: NSMakePoint(data[1].point.x, data[1].point.y)]; break; case CAIRO_PATH_CURVE_TO: [path curveToPoint: NSMakePoint(data[3].point.x, data[3].point.y) controlPoint1: NSMakePoint(data[1].point.x, data[1].point.y) controlPoint2: NSMakePoint(data[2].point.x, data[2].point.y)]; break; case CAIRO_PATH_CLOSE_PATH: [path closePath]; break; } } cairo_path_destroy(cpath); } cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); } - (void) drawGlyphs: (const NSGlyph*)glyphs length: (int)length on: (cairo_t*)ct { unichar ustr[length+1]; char str[3*length+1]; unsigned char *b; int i; unsigned int size = 3*length+1; for (i = 0; i < length; i++) { ustr[i] = glyphs[i]; } ustr[length] = 0; b = (unsigned char *)str; if (!GSFromUnicode(&b, &size, ustr, length, NSUTF8StringEncoding, NULL, GSUniTerminate)) { NSLog(@"Conversion failed for %@", [NSString stringWithCharacters: ustr length: length]); return; } cairo_set_scaled_font(ct, _scaled); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting scaled font: %s", cairo_status_to_string(cairo_status(ct))); return; } cairo_show_text(ct, str); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error drawing string: '%s' for string %s", cairo_status_to_string(cairo_status(ct)), str); } } @end gnustep-back-0.29.0/Source/cairo/CairoGState.m000066400000000000000000001355441404163720200210600ustar00rootroot00000000000000 /* CairoGState.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Rewrite: Fred Kiefer Date: Jan 2006 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include "cairo/CairoGState.h" #include "cairo/CairoFontInfo.h" #include "cairo/CairoSurface.h" #include "cairo/CairoContext.h" #include // Macro stolen from base/Header/Additions/GNUstepBase/GSObjRuntime.h #ifndef GS_MAX_OBJECTS_FROM_STACK /** * The number of objects to try to get from varargs into an array on * the stack ... if there are more than this, use the heap. * NB. This MUST be a multiple of 2 */ #define GS_MAX_OBJECTS_FROM_STACK 128 #endif // Macros stolen from base/Source/GSPrivate.h /** * Macro to manage memory for chunks of code that need to work with * arrays of items. Use this to start the block of code using * the array and GS_ENDITEMBUF() to end it. The idea is to ensure that small * arrays are allocated on the stack (for speed), but large arrays are * allocated from the heap (to avoid stack overflow). */ #define GS_BEGINITEMBUF(P, S, T) { \ T _ibuf[(S) <= GS_MAX_OBJECTS_FROM_STACK ? (S) : 0]; \ T *_base = ((S) <= GS_MAX_OBJECTS_FROM_STACK) ? _ibuf \ : (T*)NSZoneMalloc(NSDefaultMallocZone(), (S) * sizeof(T)); \ T *(P) = _base; /** * Macro to manage memory for chunks of code that need to work with * arrays of items. Use GS_BEGINITEMBUF() to start the block of code using * the array and this macro to end it. */ #define GS_ENDITEMBUF() \ if (_base != _ibuf) \ NSZoneFree(NSDefaultMallocZone(), _base); \ } static inline double doubleFromUserSpace(NSAffineTransform *ctm, CGFloat d) { if (ctm) { NSSize s = {d, d}; s = [ctm transformSize: s]; d = (((s.width > 0.0) ? s.width : -s.width) + ((s.height > 0.0) ? s.height : -s.height)) / 2; } return d; } static inline CGFloat floatToUserSpace(NSAffineTransform *ctm, double d) { if (ctm) { NSAffineTransform *ictm; ictm = [ctm copy]; [ictm invert]; d = doubleFromUserSpace(ictm, d); RELEASE(ictm); } return (CGFloat)d; } static inline cairo_filter_t cairoFilterFromNSImageInterpolation(NSImageInterpolation interpolation) { switch (interpolation) { case NSImageInterpolationNone: return CAIRO_FILTER_NEAREST; case NSImageInterpolationLow: return CAIRO_FILTER_FAST; case NSImageInterpolationHigh: return CAIRO_FILTER_BEST; default: return CAIRO_FILTER_GOOD; } } @implementation CairoGState + (void) initialize { if (self == [CairoGState class]) { } } - (void) dealloc { if (_ct) { cairo_destroy(_ct); } RELEASE(_surface); [super dealloc]; } - (NSString*) description { NSMutableString *description = [[[super description] mutableCopy] autorelease]; [description appendFormat: @" surface: %@",_surface]; [description appendFormat: @" context: %p",_ct]; return [[description copy] autorelease]; } - (id) copyWithZone: (NSZone *)zone { CairoGState *copy = (CairoGState *)[super copyWithZone: zone]; RETAIN(_surface); if (_ct) { cairo_status_t status; // FIXME: Need some way to do a copy // but there isnt anything like copy->_ct = cairo_copy(_ct); copy->_ct = cairo_create(cairo_get_target(_ct)); status = cairo_status(copy->_ct); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Cairo status '%s' in copy", cairo_status_to_string(status)); copy->_ct = NULL; } else { cairo_path_t *cpath; cairo_matrix_t local_matrix; #if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1, 4, 0) cairo_rectangle_list_t *clip_rects; int num_dashes; #endif cairo_get_matrix(_ct, &local_matrix); cairo_set_matrix(copy->_ct, &local_matrix); status = cairo_status(copy->_ct); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Cairo status '%s' in set matrix", cairo_status_to_string(status)); } cpath = cairo_copy_path(_ct); status = cpath->status; if (status != CAIRO_STATUS_SUCCESS) { /* Due to an interesting programming concept in cairo this does not mean that an error has occured. It may as well just be that the old path had no elements. At least in cairo 1.4.10 (See file cairo-path.c, line 379). */ // NSLog(@"Cairo status '%s' in copy path", cairo_status_to_string(status)); } else { cairo_append_path(copy->_ct, cpath); } cairo_path_destroy(cpath); cairo_set_operator(copy->_ct, cairo_get_operator(_ct)); cairo_set_source(copy->_ct, cairo_get_source(_ct)); cairo_set_tolerance(copy->_ct, cairo_get_tolerance(_ct)); cairo_set_antialias(copy->_ct, cairo_get_antialias(_ct)); cairo_set_line_width(copy->_ct, cairo_get_line_width(_ct)); cairo_set_line_cap(copy->_ct, cairo_get_line_cap(_ct)); cairo_set_line_join(copy->_ct, cairo_get_line_join(_ct)); cairo_set_miter_limit(copy->_ct, cairo_get_miter_limit(_ct)); #if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1, 4, 0) // In cairo 1.4 there is a way get the dash. num_dashes = cairo_get_dash_count(_ct); if (num_dashes != 0) { double dash_offset; GS_BEGINITEMBUF(dashes, num_dashes, double); cairo_get_dash(_ct, dashes, &dash_offset); cairo_set_dash (copy->_ct, dashes, num_dashes, dash_offset); GS_ENDITEMBUF(); } // In cairo 1.4 there also is a way to get the current clipping path clip_rects = cairo_copy_clip_rectangle_list(_ct); status = clip_rects->status; if (status == CAIRO_STATUS_SUCCESS) { int i; if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 6, 0)) { for (i = 0; i < clip_rects->num_rectangles; i++) { cairo_rectangle_t rect = clip_rects->rectangles[i]; cairo_rectangle(copy->_ct, rect.x, rect.y, rect.width, rect.height); cairo_clip(copy->_ct); } } else { for (i = 0; i < clip_rects->num_rectangles; i++) { cairo_rectangle_t rect = clip_rects->rectangles[i]; NSSize size = [_surface size]; cairo_rectangle(copy->_ct, rect.x, /* This strange computation is due to the device offset missing for clip rects in cairo < 1.6.0. */ rect.y + 2*(offset.y - size.height), rect.width, rect.height); cairo_clip(copy->_ct); } } } else if (status == CAIRO_STATUS_CLIP_NOT_REPRESENTABLE) { // We cannot get the exact clip, so we do the best we can double x1; double y1; double x2; double y2; cairo_clip_extents(_ct, &x1, &y1, &x2, &y2); cairo_rectangle(copy->_ct, x1, y1, x2 - x1, y2 - y1); cairo_clip(copy->_ct); } else { NSLog(@"Cairo status '%s' in copy clip", cairo_status_to_string(status)); } cairo_rectangle_list_destroy(clip_rects); #endif } } return copy; } - (void) GSCurrentSurface: (CairoSurface **)surface : (int *)x : (int *)y { if (x) *x = offset.x; if (y) *y = offset.y; if (surface) { *surface = _surface; } } - (void) GSSetSurface: (CairoSurface *)surface : (int)x : (int)y { ASSIGN(_surface, surface); [self setOffset: NSMakePoint(x, y)]; [self DPSinitgraphics]; } - (void) setOffset: (NSPoint)theOffset { if (_surface != nil) { NSSize size = [_surface size]; cairo_surface_set_device_offset([_surface surface], -theOffset.x, theOffset.y - size.height); } [super setOffset: theOffset]; } - (void) showPage { if (_ct) { cairo_show_page(_ct); } } /* * Color operations */ - (void) GSSetPatterColor: (NSImage*)image { // FIXME: Create a cairo surface from the image and set it as source. [super GSSetPatterColor: image]; } /* * Text operations */ - (void) _setPoint { NSPoint p; p = [path currentPoint]; cairo_move_to(_ct, p.x, p.y); } - (void) DPScharpath: (const char *)s : (int)b { if (_ct) { GS_BEGINITEMBUF(c, b + 1, char); [self _setPoint]; memcpy(c, s, b); c[b] = 0; cairo_text_path(_ct, c); GS_ENDITEMBUF(); if (cairo_status(_ct) == CAIRO_STATUS_SUCCESS) { cairo_path_t *cpath; cairo_path_data_t *data; int i; cpath = cairo_copy_path(_ct); for (i = 0; i < cpath->num_data; i += cpath->data[i].header.length) { data = &cpath->data[i]; switch (data->header.type) { case CAIRO_PATH_MOVE_TO: [path moveToPoint: NSMakePoint(data[1].point.x, data[1].point.y)]; break; case CAIRO_PATH_LINE_TO: [path lineToPoint: NSMakePoint(data[1].point.x, data[1].point.y)]; break; case CAIRO_PATH_CURVE_TO: [path curveToPoint: NSMakePoint(data[3].point.x, data[3].point.y) controlPoint1: NSMakePoint(data[1].point.x, data[1].point.y) controlPoint2: NSMakePoint(data[2].point.x, data[2].point.y)]; break; case CAIRO_PATH_CLOSE_PATH: [path closePath]; break; } } cairo_path_destroy(cpath); } } } - (void) DPSshow: (const char *)s { if (_ct) { cairo_matrix_t local_matrix; NSAffineTransformStruct matrix = [ctm transformStruct]; device_color_t c; c = strokeColor; gsColorToRGB(&c); // The underlying concept does not allow to determine if alpha is set or not. cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]); [self _setPoint]; cairo_save(_ct); cairo_matrix_init(&local_matrix, matrix.m11, 0, 0, matrix.m22, 0, 0); cairo_transform(_ct, &local_matrix); // Undo the flip cairo_matrix_init_scale(&local_matrix, 1, -1); cairo_matrix_translate(&local_matrix, 0, -[_surface size].height); cairo_transform(_ct, &local_matrix); cairo_show_text(_ct, s); cairo_restore(_ct); } } - (void) GSSetFont: (GSFontInfo *)fontref { [super GSSetFont: fontref]; if (_ct) { cairo_set_scaled_font(_ct, ((CairoFontInfo *)font)->_scaled); } } - (void) GSSetFontSize: (CGFloat)size { if (_ct) { cairo_set_font_size(_ct, doubleFromUserSpace(ctm, size)); } } - (void) GSShowText: (const char *)string : (size_t)length { if (_ct) { device_color_t c; GS_BEGINITEMBUF(chars, length + 1, char); c = strokeColor; gsColorToRGB(&c); // The underlying concept does not allow to determine if alpha is set or not. cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]); [self _setPoint]; memcpy(chars, string, length); chars[length] = 0; cairo_show_text(_ct, chars); GS_ENDITEMBUF(); } } - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { // FIXME: this method should just be a call to cairo_show_glyphs // FIXME: Currently advances is ignored if (_ct) { cairo_matrix_t local_matrix; NSAffineTransformStruct matrix = [ctm transformStruct]; device_color_t c; c = strokeColor; gsColorToRGB(&c); // The underlying concept does not allow to determine if alpha is set or not. cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]); [self _setPoint]; // FIXME: Hack to get font in rotated view working cairo_save(_ct); cairo_matrix_init(&local_matrix, matrix.m11, matrix.m12, matrix.m21, matrix.m22, 0, 0); cairo_transform(_ct, &local_matrix); // Undo the cairo_matrix_init_scale(&local_matrix, 1, -1); cairo_matrix_translate(&local_matrix, 0, -[_surface size].height); cairo_transform(_ct, &local_matrix); [(CairoFontInfo *)font drawGlyphs: glyphs length: length on: _ct]; double x, y; cairo_get_current_point(_ct, &x, &y); cairo_user_to_device(_ct, &x, &y); cairo_restore(_ct); // reset the current point cairo_device_to_user(_ct, &x, &y); [path moveToPoint: NSMakePoint(x,y)]; } } /* * GState operations */ - (void) DPSinitgraphics { cairo_status_t status; cairo_matrix_t local_matrix; [super DPSinitgraphics]; if (_ct) { cairo_destroy(_ct); _ct = NULL; } if (!_surface) { return; } _ct = cairo_create([_surface surface]); status = cairo_status(_ct); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Cairo status '%s' in DPSinitgraphics", cairo_status_to_string(status)); _ct = NULL; return; } // cairo draws the other way around. // At this point in time viewIsFlipped has not been set, but it is // OK to ignore this here, as in that case the matrix will later // get flipped by GUI, cairo_matrix_init_scale(&local_matrix, 1, -1); cairo_matrix_translate(&local_matrix, 0, -[_surface size].height); cairo_set_matrix(_ct, &local_matrix); // Cairo's default line width is 2.0 cairo_set_line_width(_ct, 1.0); cairo_set_operator(_ct, CAIRO_OPERATOR_OVER); cairo_new_path(_ct); } - (void) DPScurrentflat: (CGFloat *)flatness { if (_ct) { *flatness = (CGFloat)cairo_get_tolerance(_ct) * 2; } } - (void) DPScurrentlinecap: (int *)linecap { cairo_line_cap_t lc; if (_ct) { lc = cairo_get_line_cap(_ct); *linecap = lc; } /* switch (lc) { case CAIRO_LINE_CAP_BUTT: *linecap = 0; break; case CAIRO_LINE_CAP_ROUND: *linecap = 1; break; case CAIRO_LINE_CAP_SQUARE: *linecap = 2; break; default: NSLog(@"ERROR Line cap unknown"); exit(-1); } */ } - (void) DPScurrentlinejoin: (int *)linejoin { cairo_line_join_t lj; if (_ct) { lj = cairo_get_line_join(_ct); *linejoin = lj; } /* switch (lj) { case CAIRO_LINE_JOIN_MITER: *linejoin = 0; break; case CAIRO_LINE_JOIN_ROUND: *linejoin = 1; break; case CAIRO_LINE_JOIN_BEVEL: *linejoin = 2; break; default: NSLog(@"ERROR Line join unknown"); exit(-1); } */ } - (void) DPScurrentlinewidth: (CGFloat *)width { if (_ct) { *width = floatToUserSpace(ctm, cairo_get_line_width(_ct)); } } - (void) DPScurrentmiterlimit: (CGFloat *)limit { if (_ct) { *limit = floatToUserSpace(ctm, cairo_get_miter_limit(_ct)); } } - (void) DPScurrentstrokeadjust: (int *)b { } - (void) DPSsetdash: (const CGFloat *)pat : (NSInteger)size : (CGFloat)foffset { if (_ct) { double doffset = doubleFromUserSpace(ctm, foffset); int i; GS_BEGINITEMBUF(dpat, size, double); i = size; while (i) { i--; // FIXME: When using the correct values, some dashes look wrong dpat[i] = doubleFromUserSpace(ctm, pat[i]) * 1.4; } cairo_set_dash(_ct, dpat, size, doffset); GS_ENDITEMBUF(); } } - (void) DPSsetflat: (CGFloat)flatness { [super DPSsetflat: flatness]; if (_ct) { // Divide GNUstep flatness by 2 to get Cairo tolerance - this produces // results visually similar to OS X. cairo_set_tolerance(_ct, flatness / 2); } } - (void) DPSsetlinecap: (int)linecap { if (_ct) { cairo_set_line_cap(_ct, (cairo_line_cap_t)linecap); } } - (void) DPSsetlinejoin: (int)linejoin { if (_ct) { cairo_set_line_join(_ct, (cairo_line_join_t)linejoin); } } - (void) DPSsetlinewidth: (CGFloat)width { if (_ct) { cairo_set_line_width(_ct, doubleFromUserSpace(ctm, width)); } } - (void) DPSsetmiterlimit: (CGFloat)limit { if (_ct) { cairo_set_miter_limit(_ct, doubleFromUserSpace(ctm, limit)); } } - (void) DPSsetstrokeadjust: (int)b { } /* * Path operations */ - (void) _setPath { NSInteger count = [path elementCount]; NSInteger i; SEL elmsel = @selector(elementAtIndex:associatedPoints:); NSBezierPathElement (*elmidx)(id, SEL, NSInteger, NSPoint*) = (NSBezierPathElement (*)(id, SEL, NSInteger, NSPoint*))[path methodForSelector: elmsel]; // reset current cairo path cairo_new_path(_ct); for (i = 0; i < count; i++) { NSBezierPathElement type; NSPoint points[3]; type = (NSBezierPathElement)(*elmidx)(path, elmsel, i, points); switch(type) { case NSMoveToBezierPathElement: cairo_move_to(_ct, points[0].x, points[0].y); break; case NSLineToBezierPathElement: cairo_line_to(_ct, points[0].x, points[0].y); break; case NSCurveToBezierPathElement: cairo_curve_to(_ct, points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y); break; case NSClosePathBezierPathElement: cairo_close_path(_ct); break; default: break; } } cairo_set_antialias(_ct, [self shouldAntialias] ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE); } - (void) DPSclip { if (_ct) { [self _setPath]; cairo_clip(_ct); } } - (void) DPSeoclip { if (_ct) { [self _setPath]; cairo_set_fill_rule(_ct, CAIRO_FILL_RULE_EVEN_ODD); cairo_clip(_ct); cairo_set_fill_rule(_ct, CAIRO_FILL_RULE_WINDING); } } - (void) DPSeofill { if (_ct) { device_color_t c; if (pattern != nil) { [self eofillPath: path withPattern: pattern]; return; } c = fillColor; gsColorToRGB(&c); // The underlying concept does not allow to determine if alpha is set or not. cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]); [self _setPath]; cairo_set_fill_rule(_ct, CAIRO_FILL_RULE_EVEN_ODD); cairo_fill(_ct); cairo_set_fill_rule(_ct, CAIRO_FILL_RULE_WINDING); } [self DPSnewpath]; } - (void) DPSfill { if (_ct) { device_color_t c; if (pattern != nil) { [self fillPath: path withPattern: pattern]; return; } c = fillColor; gsColorToRGB(&c); // The underlying concept does not allow to determine if alpha is set or not. cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]); [self _setPath]; cairo_fill(_ct); } [self DPSnewpath]; } - (void) DPSinitclip { if (_ct) { cairo_reset_clip(_ct); } } - (void) DPSstroke { if (_ct) { BOOL zeroLineWidth = NO; device_color_t c; c = strokeColor; gsColorToRGB(&c); // The underlying concept does not allow to determine if alpha is set or not. cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]); [self _setPath]; // If the line width is 0, draw a thin line. // cairo (and Quartz) will draw nothing with a line width of 0. // See the PostScript Language Reference, 3rd ed, p. 674 if (cairo_get_line_width(_ct) == 0) { double w1 = 1.0; double w2 = 1.0; cairo_device_to_user_distance(_ct, &w1, &w2); cairo_set_line_width(_ct, w1); zeroLineWidth = YES; } cairo_stroke(_ct); if (zeroLineWidth) { cairo_set_line_width(_ct, 0); } } [self DPSnewpath]; } - (NSDictionary *) GSReadRect: (NSRect)r { static NSDictionary *baseDict = nil; NSMutableDictionary *dict; NSSize ssize; NSAffineTransform *matrix; double x, y; int ix, iy; cairo_format_t format = CAIRO_FORMAT_ARGB32; cairo_surface_t *surface; cairo_surface_t *isurface; cairo_t *ct; cairo_status_t status; int dataSize; NSMutableData *data; unsigned char *dataBytes; uint32_t *dataPixel; int pixelCounter; if (!_ct) { return nil; } r = [ctm rectInMatrixSpace: r]; x = NSWidth(r); y = NSHeight(r); ix = fabs(floor(x)); iy = fabs(floor(y)); ssize = NSMakeSize(ix, iy); if (!baseDict) { baseDict = [[NSDictionary dictionaryWithObjectsAndKeys: NSDeviceRGBColorSpace, @"ColorSpace", [NSNumber numberWithUnsignedInt: 8], @"BitsPerSample", [NSNumber numberWithUnsignedInt: 32], @"Depth", [NSNumber numberWithUnsignedInt: 4], @"SamplesPerPixel", [NSNumber numberWithUnsignedInt: 1], @"HasAlpha", nil] retain]; } dict = [NSMutableDictionary dictionaryWithDictionary: baseDict]; [dict setObject: [NSValue valueWithSize: ssize] forKey: @"Size"]; matrix = [self GSCurrentCTM]; [matrix translateXBy: -r.origin.x - offset.x yBy: r.origin.y + NSHeight(r) - offset.y]; [dict setObject: matrix forKey: @"Matrix"]; dataSize = ix*iy*4; data = [NSMutableData dataWithLength: dataSize]; if (data == nil) return nil; dataBytes = [data mutableBytes]; surface = cairo_get_target(_ct); isurface = cairo_image_surface_create_for_data(dataBytes, format, ix, iy, 4*ix); status = cairo_surface_status(isurface); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Cairo status '%s' in GSReadRect", cairo_status_to_string(status)); return nil; } ct = cairo_create(isurface); status = cairo_status(ct); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Cairo status '%s' in GSReadRect", cairo_status_to_string(status)); cairo_surface_destroy(isurface); return nil; } if (_surface != nil) { ssize = [_surface size]; } else { ssize = NSMakeSize(0, 0); } cairo_set_source_surface(ct, surface, -r.origin.x, -ssize.height + r.size.height + r.origin.y); cairo_rectangle(ct, 0, 0, ix, iy); cairo_paint(ct); cairo_destroy(ct); cairo_surface_destroy(isurface); dataPixel = (uint32_t *) dataBytes; pixelCounter = ix * iy; while (pixelCounter--) { #if GS_WORDS_BIGENDIAN // ARGB -> RGBA *dataPixel = (*dataPixel << 8) // ARGB -> RGB_ | (*dataPixel >> 24); // ARGB -> ___A #else // ARGB -> ABGR *dataPixel = ((*dataPixel & 0x000000FF) << 16) // ___B -> _B__ | ((*dataPixel & 0x00FF0000) >> 16) // _R__ -> ___R | (*dataPixel & 0xFF00FF00); // A_G_ -> A_G_ #endif dataPixel++; } [dict setObject: data forKey: @"Data"]; return dict; } static void _set_op(cairo_t *ct, NSCompositingOperation op) { switch (op) { case NSCompositeClear: cairo_set_operator(ct, CAIRO_OPERATOR_CLEAR); break; case NSCompositeCopy: cairo_set_operator(ct, CAIRO_OPERATOR_SOURCE); break; case NSCompositeSourceOver: cairo_set_operator(ct, CAIRO_OPERATOR_OVER); break; case NSCompositeSourceIn: cairo_set_operator(ct, CAIRO_OPERATOR_IN); break; case NSCompositeSourceOut: cairo_set_operator(ct, CAIRO_OPERATOR_OUT); break; case NSCompositeSourceAtop: cairo_set_operator(ct, CAIRO_OPERATOR_ATOP); break; case NSCompositeDestinationOver: cairo_set_operator(ct, CAIRO_OPERATOR_DEST_OVER); break; case NSCompositeDestinationIn: cairo_set_operator(ct, CAIRO_OPERATOR_DEST_IN); break; case NSCompositeDestinationOut: cairo_set_operator(ct, CAIRO_OPERATOR_DEST_OUT); break; case NSCompositeDestinationAtop: cairo_set_operator(ct, CAIRO_OPERATOR_DEST_ATOP); break; case NSCompositeXOR: cairo_set_operator(ct, CAIRO_OPERATOR_XOR); break; case NSCompositePlusDarker: // FIXME: There is no match for this operation in cairo!!! cairo_set_operator(ct, CAIRO_OPERATOR_SATURATE); break; case NSCompositeHighlight: // MacOSX 10.4 documentation maps this value onto NSCompositeSourceOver cairo_set_operator(ct, CAIRO_OPERATOR_OVER); break; case NSCompositePlusLighter: cairo_set_operator(ct, CAIRO_OPERATOR_ADD); break; default: cairo_set_operator(ct, CAIRO_OPERATOR_SOURCE); } } /* For debugging */ - (void) drawOrientationMarkersIn: (cairo_t *)ct { cairo_rectangle(_ct, 0, 0, 20, 10); cairo_set_source_rgba(_ct, 0, 1, 0, 1); cairo_fill(_ct); cairo_rectangle(_ct, 0, 30, 20, 10); cairo_set_source_rgba(_ct, 0, 0, 1, 1); cairo_fill(_ct); } - (void) DPSimage: (NSAffineTransform *)matrix : (NSInteger)pixelsWide : (NSInteger)pixelsHigh : (NSInteger)bitsPerSample : (NSInteger)samplesPerPixel : (NSInteger)bitsPerPixel : (NSInteger)bytesPerRow : (BOOL)isPlanar : (BOOL)hasAlpha : (NSString *)colorSpaceName : (const unsigned char *const[5])data { cairo_format_t format; NSAffineTransformStruct tstruct; cairo_surface_t *surface; unsigned char *dataRow, *reformattedData; int reformattedDataSize, rowCounter, columnCounter; uint32_t *reformattedDataPixel; cairo_matrix_t local_matrix; cairo_status_t status; if (!_ct) { return; } if (isPlanar || !([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] || [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace])) { // FIXME: Need to conmvert to something that is supported NSLog(@"Image format not support in cairo backend.\n colour space: %@ planar %d", colorSpaceName, isPlanar); return; } // default is 8 bit grayscale if (!bitsPerSample) bitsPerSample = 8; if (!samplesPerPixel) samplesPerPixel = 1; // FIXME - does this work if we are passed a planar image but no hints ? if (!bitsPerPixel) bitsPerPixel = bitsPerSample * samplesPerPixel; if (!bytesPerRow) bytesPerRow = (bitsPerPixel * pixelsWide) / 8; /* make sure its sane - also handles row padding if hint missing */ while ((bytesPerRow * 8) < (bitsPerPixel * pixelsWide)) bytesPerRow++; reformattedDataSize = pixelsWide * pixelsHigh * sizeof(*reformattedDataPixel); switch (bitsPerPixel) { case 32: reformattedData = malloc(reformattedDataSize); if (!reformattedData) { NSLog(@"Could not allocate drawing space for image"); return; } dataRow = (unsigned char *)data[0]; reformattedDataPixel = (uint32_t *) reformattedData; rowCounter = pixelsHigh; while (rowCounter--) { uint32_t *dataPixel = (uint32_t *) dataRow; columnCounter = pixelsWide; while (columnCounter--) { #if GS_WORDS_BIGENDIAN // RGBA (uint32) -> ARGB (uint32) *reformattedDataPixel++ = (*dataPixel >> 8) // RGBA -> _RGB | (*dataPixel << 24); // RGBA -> A___ #else // ABGR (uint32) -> ARGB (uint32) *reformattedDataPixel++ = ((*dataPixel & 0x000000FF) << 16) // ___R -> _R__ | ((*dataPixel & 0x00FF0000) >> 16) // _B__ -> ___B | (*dataPixel & 0xFF00FF00); // A_G_ -> A_G_ #endif dataPixel++; } dataRow += bytesPerRow; } format = CAIRO_FORMAT_ARGB32; break; case 24: reformattedData = malloc(reformattedDataSize); if (!reformattedData) { NSLog(@"Could not allocate drawing space for image"); return; } dataRow = (unsigned char *)data[0]; reformattedDataPixel = (uint32_t *) reformattedData; rowCounter = pixelsHigh; while (rowCounter--) { unsigned char *dataPixelComponent = dataRow; columnCounter = pixelsWide; while (columnCounter--) { // R,G,B (uchar[0-2]) -> _RGB (uint32) *reformattedDataPixel++ = (((uint32_t) dataPixelComponent[0]) << 16) // R -> _R__ | (((uint32_t) dataPixelComponent[1]) << 8) // G -> __G_ | ((uint32_t) dataPixelComponent[2]); // B -> ___B dataPixelComponent += 3; } dataRow += bytesPerRow; } format = CAIRO_FORMAT_RGB24; break; default: NSLog(@"Image format not support"); return; } surface = cairo_image_surface_create_for_data((void*)reformattedData, format, pixelsWide, pixelsHigh, pixelsWide * sizeof(*reformattedDataPixel)); status = cairo_surface_status(surface); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Cairo status '%s' in DPSimage", cairo_status_to_string(status)); if (reformattedData) { free(reformattedData); } return; } cairo_save(_ct); cairo_set_operator(_ct, CAIRO_OPERATOR_SOURCE); // Set the basic transformation tstruct = [ctm transformStruct]; cairo_matrix_init(&local_matrix, tstruct.m11, tstruct.m12, tstruct.m21, tstruct.m22, tstruct.tX, tstruct.tY); cairo_transform(_ct, &local_matrix); // add the local tranformation tstruct = [matrix transformStruct]; cairo_matrix_init(&local_matrix, tstruct.m11, tstruct.m12, tstruct.m21, tstruct.m22, tstruct.tX, tstruct.tY); cairo_transform(_ct, &local_matrix); { cairo_pattern_t *cpattern; cairo_matrix_t source_matrix; cpattern = cairo_pattern_create_for_surface(surface); cairo_matrix_init_scale(&source_matrix, 1, -1); cairo_matrix_translate(&source_matrix, 0, -pixelsHigh); cairo_pattern_set_matrix(cpattern, &source_matrix); cairo_pattern_set_filter(cpattern, cairoFilterFromNSImageInterpolation([drawcontext imageInterpolation])); if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 6, 0)) { cairo_pattern_set_extend(cpattern, CAIRO_EXTEND_PAD); } cairo_set_source(_ct, cpattern); cairo_pattern_destroy(cpattern); cairo_rectangle(_ct, 0, 0, pixelsWide, pixelsHigh); } cairo_clip(_ct); cairo_paint(_ct); //[self drawOrientationMarkersIn: _ct]; cairo_surface_destroy(surface); cairo_restore(_ct); if (reformattedData) { free(reformattedData); } } - (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op { if (_ct) { NSBezierPath *oldPath = path; device_color_t c; cairo_save(_ct); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 4) if (GSCompositeHighlight == op) { cairo_set_operator(_ct, CAIRO_OPERATOR_DIFFERENCE); cairo_set_source_rgb(_ct, 1, 1, 1); } else #endif { _set_op(_ct, op); c = fillColor; gsColorToRGB(&c); // The underlying concept does not allow to determine if alpha is set or not. cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]); } // This is almost a rectclip::::, but the path stays unchanged. path = [NSBezierPath bezierPathWithRect: aRect]; [path transformUsingAffineTransform: ctm]; [self _setPath]; cairo_clip(_ct); cairo_paint(_ct); cairo_restore(_ct); path = oldPath; } } - (void) compositeGState: (CairoGState *)source fromRect: (NSRect)srcRect toPoint: (NSPoint)destPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { cairo_surface_t *src; NSSize ssize = NSZeroSize; BOOL copyOnSelf; /* The source rect in the source base coordinate space. This rect is the minimum bounding rect of srcRect. */ NSRect srcRectInBase = NSZeroRect; /* The destination point in the target base coordinate space */ NSPoint destPointInBase = NSZeroPoint; /* The origin of srcRectInBase */ double minx, miny; /* The composited content size */ double width, height; /* The adjusted destination point in the target base coordinate space */ double x, y; /* Alternative source rect origin in the source current CTM */ NSPoint srcRectAltOrigin; /* Alternative source rect origin in the source base coordinate space */ NSPoint srcRectAltOriginInBase; /* The source rect origin in the source base coordinate space */ NSPoint srcRectOriginInBase; BOOL originFlippedBetweenBaseAndSource = NO; /* The delta between the origins of srcRect and srcRectInBase */ double dx, dy; cairo_pattern_t *cpattern; cairo_matrix_t source_matrix; NSDebugMLLog(@"CairoGState", @"self: %@\n", self); if (!_ct || !source->_ct) { return; } //NSLog(@"Composite surface %p source size %@ target size %@", self->_surface, NSStringFromSize([self->_surface size]), NSStringFromSize([source->_surface size])); src = cairo_get_target(source->_ct); copyOnSelf = (src == cairo_get_target(_ct)); srcRectAltOrigin = NSMakePoint(srcRect.origin.x, srcRect.origin.y + srcRect.size.height); srcRectAltOriginInBase = [source->ctm transformPoint: srcRectAltOrigin]; srcRectOriginInBase = [source->ctm transformPoint: srcRect.origin]; cairo_save(_ct); /* When the target and source are the same surface, we use the group tricks */ if (copyOnSelf) cairo_push_group(_ct); cairo_new_path(_ct); _set_op(_ct, op); //NSLog(@"Point %@", NSStringFromPoint(destPoint)); /* Scales and/or rotates the local destination point with the current AppKit CTM */ destPointInBase = [ctm transformPoint: destPoint]; //NSLog(@"Point in base %@", NSStringFromPoint(destPointInBase)); /* Scales and/or rotates the source rect and retrieves the minimum bounding rectangle that encloses it and makes it our source area */ [source->ctm boundingRectFor: srcRect result: &srcRectInBase]; //NSLog(@"Bounding rect %@ from %@", NSStringFromRect(srcRectInBase), NSStringFromRect(srcRect)); /* Find whether the source rect origin in the base is the same than in the source current CTM. We need to know the origin in the base to compute how much the source bounding rect origin is shifted relatively to the closest source rect corner. We use this delta (dx, dy) to correctly composite from a rotated source. */ originFlippedBetweenBaseAndSource = ((srcRect.origin.y < srcRectAltOrigin.y && srcRectOriginInBase.y > srcRectAltOriginInBase.y) || (srcRect.origin.y > srcRectAltOrigin.y && srcRectOriginInBase.y < srcRectAltOriginInBase.y)); if (originFlippedBetweenBaseAndSource) { srcRectOriginInBase = srcRectAltOriginInBase; } dx = srcRectOriginInBase.x - srcRectInBase.origin.x; dy = srcRectOriginInBase.y - srcRectInBase.origin.y; //NSLog(@"Point in base adjusted %@", NSStringFromPoint(NSMakePoint(destPointInBase.x - dx, destPointInBase.y - dy))); if (source->_surface != nil) { ssize = [source->_surface size]; } if ((cairo_version() >= CAIRO_VERSION_ENCODE(1, 8, 0)) && (cairo_version() <= CAIRO_VERSION_ENCODE(1, 13, 0))) { // For cairo > 1.8 and < 1.13 we seem to need this adjustment srcRectInBase.origin.y -= 2 * (source->offset.y - ssize.height); } x = destPointInBase.x; y = destPointInBase.y; minx = NSMinX(srcRectInBase); miny = NSMinY(srcRectInBase); width = NSWidth(srcRectInBase); height = NSHeight(srcRectInBase); /* We respect the AppKit CTM effect on the origin 'aPoint' (see -[ctm transformPoint:]), but we ignore the scaling and rotation effect on the composited content and size. Which means we never rotate or scale the content we composite. We use a pattern as a trick to simulate a target CTM change, this way we don't touch the source CTM even when both source and target are identical (e.g. scrolling case). We must use a pattern matrix that matches the AppKit base CTM set up in -DPSinitgraphics to ensure no transform is applied to the source content, translation adjustements related to destination point and source rect put aside. */ cpattern = cairo_pattern_create_for_surface(src); cairo_matrix_init_scale(&source_matrix, 1, -1); //cairo_matrix_translate(&source_matrix, 0, -[_surface size].height); cairo_matrix_translate(&source_matrix, minx - x + dx, miny - y + dy - ssize.height); cairo_pattern_set_matrix(cpattern, &source_matrix); cairo_pattern_set_filter(cpattern, cairoFilterFromNSImageInterpolation([drawcontext imageInterpolation])); cairo_set_source(_ct, cpattern); cairo_pattern_destroy(cpattern); cairo_rectangle(_ct, x, y, width, height); cairo_clip(_ct); if (delta < 1.0) { cairo_paint_with_alpha(_ct, delta); } else { cairo_paint(_ct); } if (copyOnSelf) { cairo_pop_group_to_source(_ct); cairo_paint(_ct); } cairo_restore(_ct); } /** Unlike -compositeGState, -drawGSstate fully respects the AppKit CTM but doesn't support to use the receiver cairo target as the source. */ - (void) drawGState: (CairoGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { NSAffineTransformStruct tstruct = [ctm transformStruct]; cairo_surface_t *src; double width, height; double x, y; cairo_pattern_t *cpattern; cairo_matrix_t local_matrix; cairo_matrix_t source_matrix; NSDebugMLLog(@"CairoGState", @"source: %@ fromRect: %@ toPoint: %@\n", source, NSStringFromRect(aRect), NSStringFromPoint(aPoint)); if (!_ct || !source->_ct) { NSLog(@"WARNING: -drawGState called with a NULL target context (%p) or source context (%p)", _ct, source->_ct); return; } src = cairo_get_target(source->_ct); cairo_save(_ct); cairo_new_path(_ct); _set_op(_ct, op); if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 8, 0)) { NSSize size = [source->_surface size]; // For cairo > 1.8 we seem to need this adjustment aRect.origin.y -= 2*(source->offset.y - size.height); } x = aPoint.x; y = aPoint.y; width = NSWidth(aRect); height = NSHeight(aRect); // NOTE: We don't keep the Cairo matrix in sync with the AppKit matrix (aka // -[NSGraphicsContext GSCurrentCTM]) /* Prepare a Cairo matrix with the current AppKit CTM */ cairo_matrix_init(&local_matrix, tstruct.m11, tstruct.m12, tstruct.m21, tstruct.m22, tstruct.tX, tstruct.tY); /* Append the local point transformation */ cairo_matrix_translate(&local_matrix, x - aRect.origin.x, y - aRect.origin.y); /* Concat to the Cairo matrix created in -DPSinitgraphics, which adjusts the mismatch between the Cairo top left vs AppKit bottom left origin. */ cairo_transform(_ct, &local_matrix); //[self drawOrientationMarkersIn: _ct]; cpattern = cairo_pattern_create_for_surface(src); cairo_matrix_init_scale(&source_matrix, 1, -1); cairo_matrix_translate(&source_matrix, 0, -[source->_surface size].height); cairo_pattern_set_matrix(cpattern, &source_matrix); cairo_pattern_set_filter(cpattern, cairoFilterFromNSImageInterpolation([drawcontext imageInterpolation])); if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 6, 0)) { cairo_pattern_set_extend(cpattern, CAIRO_EXTEND_PAD); } cairo_set_source(_ct, cpattern); cairo_pattern_destroy(cpattern); cairo_rectangle(_ct, aRect.origin.x, aRect.origin.y, width, height); cairo_clip(_ct); if (delta < 1.0) { cairo_paint_with_alpha(_ct, delta); } else { cairo_paint(_ct); } cairo_restore(_ct); } @end @implementation CairoGState (PatternColor) - (void *) saveClip { #if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1, 4, 0) if (_ct) { cairo_status_t status; cairo_rectangle_list_t *clip_rects = cairo_copy_clip_rectangle_list(_ct); status = cairo_status(_ct); if (status == CAIRO_STATUS_SUCCESS) { return clip_rects; } } #endif return NULL; } - (void) restoreClip: (void *)savedClip { #if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1, 4, 0) if (_ct && savedClip) { int i; cairo_rectangle_list_t *clip_rects = (cairo_rectangle_list_t *)savedClip; cairo_reset_clip(_ct); if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 6, 0)) { for (i = 0; i < clip_rects->num_rectangles; i++) { cairo_rectangle_t rect = clip_rects->rectangles[i]; cairo_rectangle(_ct, rect.x, rect.y, rect.width, rect.height); cairo_clip(_ct); } } else { for (i = 0; i < clip_rects->num_rectangles; i++) { cairo_rectangle_t rect = clip_rects->rectangles[i]; NSSize size = [_surface size]; cairo_rectangle(_ct, rect.x, /* This strange computation is due to the device offset missing for clip rects in cairo < 1.6.0. */ rect.y + 2*(offset.y - size.height), rect.width, rect.height); cairo_clip(_ct); } } cairo_rectangle_list_destroy(clip_rects); } #endif } @end @implementation CairoGState (NSGradient) - (void) drawGradient: (NSGradient*)gradient fromCenter: (NSPoint)startCenter radius: (CGFloat)startRadius toCenter: (NSPoint)endCenter radius: (CGFloat)endRadius options: (NSUInteger)options { if (_ct) { cairo_status_t status; int i; int stops = [gradient numberOfColorStops]; NSPoint startP = [ctm transformPoint: startCenter]; NSPoint endP = [ctm transformPoint: endCenter]; cairo_pattern_t *cpattern = cairo_pattern_create_radial(startP.x, startP.y, doubleFromUserSpace(ctm, startRadius), endP.x, endP.y, doubleFromUserSpace(ctm, endRadius)); status = cairo_pattern_status(cpattern); if (status != CAIRO_STATUS_SUCCESS) { return; } for (i = 0; i < stops; i++) { NSColor *color; CGFloat location; double red; double green; double blue; double alpha; [gradient getColor: &color location: &location atIndex: i]; red = [color redComponent]; green = [color greenComponent]; blue = [color blueComponent]; alpha = [color alphaComponent]; cairo_pattern_add_color_stop_rgba(cpattern, location, red, green, blue, alpha); } cairo_save(_ct); cairo_set_source(_ct, cpattern); cairo_pattern_destroy(cpattern); cairo_paint(_ct); cairo_restore(_ct); } } - (void) drawGradient: (NSGradient*)gradient fromPoint: (NSPoint)startPoint toPoint: (NSPoint)endPoint options: (NSUInteger)options { if (_ct) { cairo_status_t status; int i; int stops = [gradient numberOfColorStops]; NSPoint startP = [ctm transformPoint: startPoint]; NSPoint endP = [ctm transformPoint: endPoint]; cairo_pattern_t *cpattern = cairo_pattern_create_linear(startP.x, startP.y, endP.x, endP.y); status = cairo_pattern_status(cpattern); if (status != CAIRO_STATUS_SUCCESS) { return; } for (i = 0; i < stops; i++) { NSColor *color; CGFloat location; double red; double green; double blue; double alpha; NSString *colorSpaceName; [gradient getColor: &color location: &location atIndex: i]; colorSpaceName = [color colorSpaceName]; if([NSCalibratedRGBColorSpace isEqualToString: colorSpaceName] || [NSDeviceRGBColorSpace isEqualToString: colorSpaceName]) { red = [color redComponent]; green = [color greenComponent]; blue = [color blueComponent]; alpha = [color alphaComponent]; cairo_pattern_add_color_stop_rgba(cpattern, location, red, green, blue, alpha); } else if([NSCalibratedWhiteColorSpace isEqualToString: colorSpaceName] || [NSDeviceWhiteColorSpace isEqualToString: colorSpaceName] || [NSCalibratedBlackColorSpace isEqualToString: colorSpaceName] || [NSDeviceBlackColorSpace isEqualToString: colorSpaceName]) { red = [color whiteComponent]; green = [color whiteComponent]; blue = [color whiteComponent]; alpha = [color alphaComponent]; cairo_pattern_add_color_stop_rgba(cpattern, location, red, green, blue, alpha); } else { NSLog(@"Cannot draw gradient for %@",colorSpaceName); } } cairo_save(_ct); cairo_set_source(_ct, cpattern); cairo_pattern_destroy(cpattern); cairo_paint(_ct); cairo_restore(_ct); } } @end gnustep-back-0.29.0/Source/cairo/CairoPDFSurface.m000066400000000000000000000033201404163720200215750ustar00rootroot00000000000000/* Copyright (C) 2007 Free Software Foundation, Inc. Author: Fred Kiefer This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/CairoPDFSurface.h" #include @implementation CairoPDFSurface - (id) initWithDevice: (void *)device { NSDictionary *info; NSString *path; info = (NSDictionary*)device; path = [info objectForKey: @"NSOutputFile"]; // FIXME: Hard coded size in points size = NSMakeSize(400, 400); _surface = cairo_pdf_surface_create([path fileSystemRepresentation], size.width, size.height); if (cairo_surface_status(_surface)) { DESTROY(self); } return self; } - (NSSize) size { return size; } - (void) setSize: (NSSize)newSize { size = newSize; cairo_pdf_surface_set_size(_surface, size.width, size.height); } - (BOOL) isDrawingToScreen { return NO; } - (void) writeComment: (NSString *)comment { } @end gnustep-back-0.29.0/Source/cairo/CairoPSSurface.m000066400000000000000000000033441404163720200215140ustar00rootroot00000000000000/* Copyright (C) 2007 Free Software Foundation, Inc. Author: Fred Kiefer This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/CairoPSSurface.h" #include @implementation CairoPSSurface - (id) initWithDevice: (void *)device { NSDictionary *info; NSString *path; info = (NSDictionary*)device; path = [info objectForKey: @"NSOutputFile"]; // FIXME: Hard coded size in points size = NSMakeSize(400, 400); _surface = cairo_ps_surface_create([path fileSystemRepresentation], size.width, size.height); if (cairo_surface_status(_surface)) { DESTROY(self); } return self; } - (NSSize) size { return size; } - (void) setSize: (NSSize)newSize { size = newSize; cairo_ps_surface_set_size(_surface, size.width, size.height); } - (void) writeComment: (NSString *)comment { cairo_ps_surface_dsc_comment(_surface, [comment UTF8String]); } - (BOOL) isDrawingToScreen { return NO; } @end gnustep-back-0.29.0/Source/cairo/CairoSurface.m000066400000000000000000000033341404163720200212500ustar00rootroot00000000000000/* Copyright (C) 2004 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/CairoSurface.h" @implementation CairoSurface - (id) initWithDevice: (void *) device { /* TODO FIXME make a more abstract struct for the device */ [self subclassResponsibility:_cmd]; return self; } - (void) dealloc { //NSLog(@"CairoSurface dealloc"); if (_surface != NULL) { cairo_surface_destroy(_surface); } [super dealloc]; } - (NSString *) description { return [NSString stringWithFormat:@"<%@ %p xr:%p>", [self class], self, _surface]; } -(NSSize) size { [self subclassResponsibility:_cmd]; return NSMakeSize(0, 0); } - (void) setSize: (NSSize)newSize { [self subclassResponsibility:_cmd]; } - (cairo_surface_t *) surface { return _surface; } - (void) handleExposeRect: (NSRect)rect { } - (BOOL) isDrawingToScreen { return YES; } @end gnustep-back-0.29.0/Source/cairo/GNUmakefile000066400000000000000000000041551404163720200206000ustar00rootroot00000000000000# Copyright (C) 2004 Free Software Foundation, Inc. # # Author: Banlu Kemiyatorn # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make SUBPROJECT_NAME=cairo # The Objective-C source files to be compiled cairo_OBJC_FILES = CairoSurface.m \ CairoFontInfo.m \ CairoGState.m \ CairoContext.m \ CairoFontEnumerator.m \ CairoFaceInfo.m \ CairoPSSurface.m \ CairoPDFSurface.m \ ../fontconfig/FCFaceInfo.m \ ../fontconfig/FCFontEnumerator.m \ ../fontconfig/FCFontInfo.m \ ifeq ($(BUILD_SERVER),x11) ifeq ($(WITH_GLITZ),yes) cairo_OBJC_FILES += XGCairoGlitzSurface.m else cairo_OBJC_FILES += XGCairoSurface.m XGCairoXImageSurface.m XGCairoModernSurface.m endif else ifeq ($(BUILD_SERVER),wayland) cairo_OBJC_FILES += WaylandCairoSurface.m else ifeq ($(BUILD_GRAPHICS),cairo) ifeq ($(WITH_GLITZ),yes) cairo_OBJC_FILES += Win32CairoGlitzSurface.m else cairo_OBJC_FILES += Win32CairoSurface.m Win32CairoGState.m # Win32CairoXImageSurface.m endif endif endif endif cairo_OBJC_FILES += -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/cairo/GNUmakefile.preamble000066400000000000000000000031311404163720200223570ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler #ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS = -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) \ # Additional LDFLAGS to pass to the linker #ADDITIONAL_LDFLAGS = # Additional library directories the linker should search #ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/cairo/WaylandCairoSurface.m000066400000000000000000000145451404163720200225760ustar00rootroot00000000000000/* -*- mode:ObjC -*- WaylandCairoSurface - Draw with Cairo onto Wayland surfaces Copyright (C) 2020 Free Software Foundation, Inc. Author: Sergio L. Pascual Date: February 2016 This file is part of the GNU Objective C Backend Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define _GNU_SOURCE #include "wayland/WaylandServer.h" #include "cairo/WaylandCairoSurface.h" #include #include #include #include #include #define GSWINDEVICE ((struct window *)gsDevice) /* Linux specific version */ static int os_create_anonymous_file(off_t size) { static const char template[] = "/weston-shared-XXXXXX"; const char *path; char *name; int fd; path = getenv("XDG_RUNTIME_DIR"); if (!path) { errno = ENOENT; return -1; } name = malloc(strlen(path) + sizeof(template)); if (!name) return -1; strcpy(name, path); strcat(name, template); fd = memfd_create(name, MFD_CLOEXEC); free(name); if (fd < 0) return -1; if (ftruncate(fd, size) != 0) { close(fd); return -1; } return fd; } static inline size_t shm_buffer_stride(struct window *window) { return window->width * 4; } static inline size_t shm_buffer_size(struct window *window) { return shm_buffer_stride(window) * window->height; } static cairo_surface_t * create_shm_buffer(struct window *window) { struct wl_shm_pool *pool; cairo_surface_t *surface; int fd, size, stride; stride = shm_buffer_stride(window); size = shm_buffer_size(window); NSDebugLog(@"WaylandCairoSurface: creating shm buffer of %d bytes", size); fd = os_create_anonymous_file(size); if (fd < 0) { NSLog(@"creating a buffer file for surface failed"); return NULL; } window->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (window->data == MAP_FAILED) { NSLog(@"error mapping anonymous file"); close(fd); return NULL; } pool = wl_shm_create_pool(window->wlconfig->shm, fd, size); surface = cairo_image_surface_create_for_data(window->data, CAIRO_FORMAT_ARGB32, window->width, window->height, stride); window->buffer = wl_shm_pool_create_buffer(pool, 0, window->width, window->height, stride, WL_SHM_FORMAT_ARGB8888); wl_shm_pool_destroy(pool); close(fd); return surface; } @implementation WaylandCairoSurface - (id) initWithDevice: (void*)device { struct window *window = (struct window *) device; NSDebugLog(@"WaylandCairoSurface: initWithDevice win=%d", window->window_id); gsDevice = device; _surface = create_shm_buffer(window); if (_surface == NULL) { NSDebugLog(@"can't create cairo surface"); return 0; } wl_surface_attach(window->surface, window->buffer, 0, 0); window->wcs = self; return self; } - (void) dealloc { struct window *window = (struct window*) gsDevice; NSDebugLog(@"WaylandCairoSurface: dealloc win=%d", window->window_id); // FIXME: This is leaking memory. We need to *correctly* implement // the counterpart to create_shm_buffer. // // For instance, this is the wrong place to destroy the cairo surface: // cairo_surface_destroy(window->surface); // window->surface = NULL; // and likely to unmap the data, and destroy/release the buffer. // "Destroying the wl_buffer after wl_buffer.release does not change // the surface contents. However, if the client destroys the wl_buffer // before receiving the wl_buffer.release event, the surface contents // become undefined immediately." // Hence also skipping: // munmap(window->data, shm_buffer_size(window)); [super dealloc]; } - (NSSize) size { NSDebugLog(@"WaylandCairoSurface: size"); struct window *window = (struct window*) gsDevice; return NSMakeSize(window->width, window->height); } - (void) setSurface: (cairo_surface_t*)surface { NSDebugLog(@"WaylandCairoSurface: setSurface"); _surface = surface; } - (void) handleExposeRect: (NSRect)rect { NSDebugLog(@"handleExposeRect"); struct window *window = (struct window*) gsDevice; cairo_surface_t *cairo_surface = _surface; double backupOffsetX = 0; double backupOffsetY = 0; int x = NSMinX(rect); int y = NSMinY(rect); int width = NSWidth(rect); int height = NSHeight(rect); NSDebugLog(@"updating region: %dx%d %dx%d", x, y, width, height); if (cairo_surface_status(cairo_surface) != CAIRO_STATUS_SUCCESS) { NSWarnMLog(@"cairo initial window error status: %s\n", cairo_status_to_string(cairo_surface_status(_surface))); } cairo_surface_get_device_offset(cairo_surface, &backupOffsetX, &backupOffsetY); cairo_surface_set_device_offset(cairo_surface, 0, 0); // FIXME: This seems to be creating a context to paint into cairo_surface, // and then copies back into the same cairo_surface. cairo_t *cr = cairo_create(cairo_surface); cairo_rectangle(cr, x, y, width, height); cairo_clip(cr); cairo_set_source_surface(cr, cairo_surface, 0, 0); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_paint(cr); cairo_destroy(cr); NSDebugLog(@"trying to commit cairo surface for window %d", window->window_id); if (window->configured) wl_surface_commit(window->surface); NSDebugLog(@"done trying to commit cairo surface for window %d", window->window_id); wl_display_dispatch_pending(window->wlconfig->display); wl_display_flush(window->wlconfig->display); cairo_surface_set_device_offset(_surface, backupOffsetX, backupOffsetY); NSDebugLog(@"handleExposeRect exit"); } @end gnustep-back-0.29.0/Source/cairo/Win32CairoGState.m000066400000000000000000000035321404163720200216720ustar00rootroot00000000000000/* Win32CairoGState.m Copyright (C) 2003 Free Software Foundation, Inc. August 8, 2012 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/Win32CairoGState.h" #include "cairo/CairoSurface.h" #include @implementation Win32CairoGState + (void) initialize { if (self == [Win32CairoGState class]) { } } - (void) dealloc { DESTROY(_lastPath); [super dealloc]; } - (id)copyWithZone: (NSZone *)zone { Win32CairoGState *object = [super copyWithZone: zone]; object->_lastPath = [_lastPath copy]; return object; } - (HDC) getHDC { if (_surface) { cairo_surface_flush([_surface surface]); NSDebugLLog(@"CairoGState", @"%s:_surface: %p hdc: %p\n", __PRETTY_FUNCTION__, _surface, cairo_win32_surface_get_dc([_surface surface])); return cairo_win32_surface_get_dc([_surface surface]); } NSLog(@"%s:_surface is NULL\n", __PRETTY_FUNCTION__); return NULL; } - (void) releaseHDC: (HDC)hdc { if (hdc && _surface) cairo_surface_mark_dirty([_surface surface]); } @end gnustep-back-0.29.0/Source/cairo/Win32CairoGlitzSurface.m000066400000000000000000000101521404163720200231010ustar00rootroot00000000000000/* Win32CairoGlitzSurface.m Copyright (C) 2008 Free Software Foundation, Inc. Author: Xavier Glattard Based on the work of: Alexander Malmberg Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/Win32CairoGlitzSurface.h" #include #include #define GSWINDEVICE ((HWND)gsDevice) @implementation Win32CairoGlitzSurface + (void) initialize { NSLog(@"Win32CairoGlitzSurface : %d : glitz_wgl_init", __LINE__); glitz_wgl_init(NULL); } - (id) initWithDevice: (void *)device { WIN_INTERN *win; unsigned long mask = 0; glitz_drawable_format_t dtempl; //static glitz_drawable_format_t *dformat = NULL; glitz_drawable_t *drawable = NULL; glitz_format_t *format = NULL; glitz_surface_t *surface = NULL; RECT sz; gsDevice = device; GetClientRect(GSWINDEVICE, &sz); win = (WIN_INTERN *)GetWindowLongPtr(GSWINDEVICE, GWLP_USERDATA); if (win && win->useHDC) { HGDIOBJ old; old = SelectObject(win->hdc, win->old); DeleteObject(old); DeleteDC(win->hdc); win->hdc = NULL; win->old = NULL; win->useHDC = NO; } //NSLog(@"Win32CairoGlitzSurface : init window %d (%d,%d-%d,%d)",GSWINDEVICE,sz.left,sz.top,sz.right,sz.bottom); //if(!dformat) { dtempl.samples = 1; mask |= GLITZ_FORMAT_SAMPLES_MASK; dtempl.color.red_size = 8; dtempl.color.green_size = 8; dtempl.color.blue_size = 8; dtempl.color.alpha_size = 8; dtempl.color.fourcc = GLITZ_FOURCC_RGB; mask |= GLITZ_FORMAT_FOURCC_MASK | GLITZ_FORMAT_RED_SIZE_MASK | GLITZ_FORMAT_GREEN_SIZE_MASK | GLITZ_FORMAT_BLUE_SIZE_MASK | GLITZ_FORMAT_ALPHA_SIZE_MASK; dtempl.doublebuffer = 0; mask |= GLITZ_FORMAT_DOUBLEBUFFER_MASK; dformat = glitz_wgl_find_window_format(mask, &dtempl, 0); if (!dformat) { NSLog(@"Win32CairoGlitzSurface : %d : no format for drawable",__LINE__); exit(1); } /* NSLog (@"ID:%d RGBA:%d/%d/%d/%d D:%d St:%d DB:%d S:%d", (int) dformat->id, dformat->color.red_size, dformat->color.green_size, dformat->color.blue_size, dformat->color.alpha_size, dformat->depth_size, dformat->stencil_size, dformat->doublebuffer, dformat->samples ); */ } drawable = glitz_wgl_create_drawable_for_window( dformat, GSWINDEVICE, sz.right - sz.left, sz.bottom - sz.top); if (!drawable) { NSLog(@"Win32CairoGlitzSurface : %d : no glitz drawable",__LINE__); exit(1); } format = glitz_find_standard_format(drawable, GLITZ_STANDARD_ARGB32); if (!format) { NSLog(@"Win32CairoGlitzSurface : %d (%d) : couldn't find ARGB32 surface format",__LINE__,GSWINDEVICE); exit(1); } surface = glitz_surface_create( drawable, format, sz.right - sz.left, sz.bottom - sz.top, 0, NULL); if (!surface) { NSLog(@"Win32CairoGlitzSurface : %d : couldn't create glitz surface",__LINE__); exit(1); } glitz_surface_attach(surface, drawable, GLITZ_DRAWABLE_BUFFER_FRONT_COLOR); _surface = cairo_glitz_surface_create(surface); if (cairo_surface_status(_surface)) { DESTROY(self); } return self; } - (NSSize) size { RECT sz; GetClientRect(GSWINDEVICE, &sz); return NSMakeSize(sz.right - sz.left, sz.bottom - sz.top); } @end gnustep-back-0.29.0/Source/cairo/Win32CairoSurface.m000066400000000000000000000307031404163720200220730ustar00rootroot00000000000000/* Win32CairoSurface.m Copyright (C) 2008 Free Software Foundation, Inc. Author: Xavier Glattard Based on the work of: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/Win32CairoSurface.h" #include "win32/WIN32Geometry.h" #include "win32/WIN32Server.h" #include #define GSWINDEVICE ((HWND)gsDevice) @implementation Win32CairoSurface - (id) initWithDevice: (void *)device { if (self) { WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)device, GWLP_USERDATA); HDC hDC = GetDC((HWND)device); // Save/set initial state... gsDevice = device; _surface = NULL; if (hDC == NULL) { NSWarnMLog(@"Win32CairoSurface line: %d : no device context", __LINE__); // And deallocate ourselves... DESTROY(self); } else { // Create the cairo surfaces... // NSBackingStoreRetained works like Buffered since 10.5 (See apple docs)... // NOTE: According to Apple docs NSBackingStoreBuffered should be the only one // ever used anymore....others are NOT recommended... if (win && (win->type == NSBackingStoreNonretained)) { // This is the raw DC surface... _surface = cairo_win32_surface_create(hDC); // Check for error... if (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS) { // Output the surface create error... cairo_status_t status = cairo_surface_status(_surface); NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status)); // Destroy the initial surface created... cairo_surface_destroy(_surface); // And deallocate ourselves... DESTROY(self); // Release the device context... ReleaseDC(device, hDC); } } else { NSSize csize = [self size]; // This is the raw DC surface... cairo_surface_t *window = cairo_win32_surface_create(hDC); // Check for error... if (cairo_surface_status(window) != CAIRO_STATUS_SUCCESS) { // Output the surface create error... cairo_status_t status = cairo_surface_status(window); NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status)); // And deallocate ourselves... DESTROY(self); } else { // and this is the in-memory DC surface...surface owns its DC... // NOTE: For some reason we get an init sequence with zero width/height, // which creates problems in the cairo layer. It tries to clear // the 'similar' surface it's creating, and with a zero width/height // it incorrectly thinks the clear failed...so we will init with // a minimum size of 1 for width/height... _surface = cairo_surface_create_similar(window, CAIRO_CONTENT_COLOR_ALPHA, MAX(1, csize.width), MAX(1, csize.height)); cairo_status_t status = cairo_surface_status(_surface); // Check for error... if (status != CAIRO_STATUS_SUCCESS) { // Output the surface create error... NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status)); // Destroy the surface created... cairo_surface_destroy(_surface); // And deallocate ourselves... DESTROY(self); } } // Destroy the initial surface created... cairo_surface_destroy(window); // Release the device context... ReleaseDC((HWND)device, hDC); } if (win && self) { // We need this for handleExposeEvent in WIN32Server... win->surface = (void*)self; } } } return self; } - (void) dealloc { // After further testing and monitoring USER/GDI object counts found // that releasing the HDC is redundant and unnecessary... [super dealloc]; } - (NSString*) description { NSMutableString *description = AUTORELEASE([[super description] mutableCopy]); HDC shdc = NULL; if (_surface) { shdc = cairo_win32_surface_get_dc(_surface); } [description appendFormat: @" size: %@",NSStringFromSize([self size])]; [description appendFormat: @" _surface: %p",_surface]; [description appendFormat: @" surfDC: %p",shdc]; return AUTORELEASE(description); } - (NSSize) size { RECT csize; GetClientRect(GSWINDEVICE, &csize); return NSMakeSize(csize.right - csize.left, csize.bottom - csize.top); } - (void) setSize: (NSSize)newSize { NSDebugMLLog(@"Win32CairoSurface", @"size: %@\n", NSStringFromSize(newSize)); } - (void) handleExposeRect: (NSRect)rect { // If the surface is buffered then we will have been invoked... HDC hdc = GetDC(GSWINDEVICE); // Make sure we got a HDC... if (hdc == NULL) { NSWarnMLog(@"ERROR: cannot get a HDC for surface: %@\n", self); } else { // Create a cairo surface for the hDC... cairo_surface_t *window = cairo_win32_surface_create(hdc); // If the surface is buffered then... if (window == NULL) { NSWarnMLog(@"ERROR: cannot create cairo surface for: %@\n", self); } else { // First check the current status of the foreground surface... if (cairo_surface_status(window) != CAIRO_STATUS_SUCCESS) { NSWarnMLog(@"cairo initial window error status: %s\n", cairo_status_to_string(cairo_surface_status(window))); } else { cairo_t *context = cairo_create(window); if (cairo_status(context) != CAIRO_STATUS_SUCCESS) { NSWarnMLog(@"cairo context create error - status: _surface: %s window: %s windowCtxt: %s (%d)", cairo_status_to_string(cairo_surface_status(_surface)), cairo_status_to_string(cairo_surface_status(window)), cairo_status_to_string(cairo_status(context)), cairo_get_reference_count(context)); } else { double backupOffsetX = 0; double backupOffsetY = 0; RECT msRect = GSWindowRectToMS((WIN32Server*)GSCurrentServer(), GSWINDEVICE, rect); // Need to save the device offset context... cairo_surface_get_device_offset(_surface, &backupOffsetX, &backupOffsetY); cairo_surface_set_device_offset(_surface, 0, 0); cairo_rectangle(context, msRect.left, msRect.top, rect.size.width, rect.size.height); cairo_clip(context); cairo_set_source_surface(context, _surface, 0, 0); cairo_set_operator(context, CAIRO_OPERATOR_SOURCE); cairo_paint(context); if (cairo_status(context) != CAIRO_STATUS_SUCCESS) { NSWarnMLog(@"cairo expose error - status: _surface: %s window: %s windowCtxt: %s", cairo_status_to_string(cairo_surface_status(_surface)), cairo_status_to_string(cairo_surface_status(window)), cairo_status_to_string(cairo_status(context))); } // Cleanup... cairo_destroy(context); // Restore device offset cairo_surface_set_device_offset(_surface, backupOffsetX, backupOffsetY); } } // Destroy the surface... cairo_surface_destroy(window); } // Release the aquired HDC... ReleaseDC(GSWINDEVICE, hdc); } } @end @implementation WIN32Server (ScreenCapture) - (NSImage *) contentsOfScreen: (int)screen inRect: (NSRect)rect { NSImage *result = nil; HDC hdc = [self createHdcForScreen: screen]; // We need a screen device context for this to work... if (hdc == NULL) { NSWarnMLog(@"invalid screen request: %d", screen); } else { // Convert rect to flipped coordinates NSRect boundsForScreen = [self boundsForScreen: screen]; NSInteger width = rect.size.width; NSInteger height = rect.size.height; NSBitmapImageRep *bmp; cairo_surface_t *src, *dst; rect.origin.y = boundsForScreen.size.height - NSMaxY(rect); // Create a bitmap representation for capturing the screen area... bmp = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL pixelsWide: width pixelsHigh: height bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSDeviceRGBColorSpace bitmapFormat: 0 bytesPerRow: 0 bitsPerPixel: 32] autorelease]; // Create the required surfaces... src = cairo_win32_surface_create(hdc); dst = cairo_image_surface_create_for_data([bmp bitmapData], CAIRO_FORMAT_ARGB32, width, height, [bmp bytesPerRow]); // Ensure we were able to generate the required surfaces... if (cairo_surface_status(src) != CAIRO_STATUS_SUCCESS) { NSWarnMLog(@"cairo screen surface error status: %s\n", cairo_status_to_string(cairo_surface_status(src))); } else if (cairo_surface_status(dst) != CAIRO_STATUS_SUCCESS) { NSWarnMLog(@"cairo screen surface error status: %s\n", cairo_status_to_string(cairo_surface_status(dst))); cairo_surface_destroy(src); } else { // Capture the requested screen rectangle... cairo_t *cr = cairo_create(dst); cairo_set_source_surface(cr, src, -1 * rect.origin.x, -1 * rect.origin.y); cairo_paint(cr); cairo_destroy(cr); // Cleanup the cairo surfaces... cairo_surface_destroy(src); cairo_surface_destroy(dst); [self deleteScreenHdc: hdc]; // Convert BGRA to RGBA // Original code located in XGCairSurface.m { NSInteger stride; NSInteger x, y; unsigned char *cdata; stride = [bmp bytesPerRow]; cdata = [bmp bitmapData]; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { NSInteger i = (y * stride) + (x * 4); unsigned char d = cdata[i]; #if GS_WORDS_BIGENDIAN cdata[i + 0] = cdata[i + 1]; cdata[i + 1] = cdata[i + 2]; cdata[i + 2] = cdata[i + 3]; cdata[i + 3] = d; #else cdata[i + 0] = cdata[i + 2]; //cdata[i + 1] = cdata[i + 1]; cdata[i + 2] = d; //cdata[i + 3] = cdata[i + 3]; #endif } } } // Create the image and add the bitmap representation... result = [[[NSImage alloc] initWithSize: NSMakeSize(width, height)] autorelease]; [result addRepresentation: bmp]; } } // Return whatever we got... return result; } @end gnustep-back-0.29.0/Source/cairo/XGCairoGlitzSurface.m000066400000000000000000000056421404163720200225250ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cairo/XGCairoGlitzSurface.h" #include #include #define GSWINDEVICE ((gswindow_device_t *)gsDevice) @implementation XGCairoGlitzSurface - (id) initWithDevice: (void *)device { glitz_drawable_format_t templ; glitz_drawable_format_t *dformat = NULL; glitz_drawable_t *drawable = NULL; glitz_format_t *format = NULL; glitz_surface_t *surface = NULL; gsDevice = device; /* if (GSWINDEVICE->type != NSBackingStoreNonretained) { XSetWindowBackgroundPixmap(GSWINDEVICE->display, GSWINDEVICE->ident, GSWINDEVICE->buffer); } */ templ.doublebuffer = 0; dformat = glitz_glx_find_drawable_format_for_visual(GSWINDEVICE->display, GSWINDEVICE->screen, XVisualIDFromVisual(DefaultVisual(GSWINDEVICE->display, GSWINDEVICE->screen))); if (!dformat) { NSLog(@"XGCairoGlitzSurface : %d : no format",__LINE__); exit(1); } drawable = glitz_glx_create_drawable_for_window(GSWINDEVICE->display, GSWINDEVICE->screen, dformat, GSWINDEVICE->ident, GSWINDEVICE->xframe.size.width, GSWINDEVICE->xframe.size.height); if (!drawable) { NSLog(@"XGCairoGlitzSurface : %d : no glitz drawable", __LINE__); exit(1); } format = glitz_find_standard_format(drawable, GLITZ_STANDARD_ARGB32); if (!format) { NSLog(@"XGCairoGlitzSurface : %d : couldn't find ARGB32 surface format", __LINE__); exit(1); } surface = glitz_surface_create(drawable, format, GSWINDEVICE->xframe.size.width, GSWINDEVICE->xframe.size.height, 0, NULL); if (!surface) { NSLog(@"XGCairoGlitzSurface : %d : couldn't create glitz surface", __LINE__); exit(1); } glitz_surface_attach(surface, drawable, GLITZ_DRAWABLE_BUFFER_FRONT_COLOR); _surface = cairo_glitz_surface_create(surface); return self; } - (NSSize) size { return GSWINDEVICE->xframe.size; } @end gnustep-back-0.29.0/Source/cairo/XGCairoModernSurface.m000066400000000000000000000104051404163720200226510ustar00rootroot00000000000000/* Copyright (C) 2011 Free Software Foundation, Inc. Author: Eric Wasylishen This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "x11/XGServer.h" #include "x11/XGServerWindow.h" #include "cairo/XGCairoModernSurface.h" #include #define GSWINDEVICE ((gswindow_device_t *)gsDevice) @implementation XGCairoModernSurface - (id) initWithDevice: (void *)device { cairo_surface_t *windowsurface; gsDevice = device; // Create a cairo xlib surface for the window { Display *dpy = GSWINDEVICE->display; Visual *visual; XWindowAttributes attributes; if (!XGetWindowAttributes(dpy, GSWINDEVICE->ident, &attributes)) { visual = DefaultVisual(dpy, DefaultScreen(dpy)); } else { visual = attributes.visual; } windowsurface = cairo_xlib_surface_create(GSWINDEVICE->display, GSWINDEVICE->ident, visual, GSWINDEVICE->xframe.size.width, GSWINDEVICE->xframe.size.height); } if (GSWINDEVICE->type == NSBackingStoreNonretained) { // Don't double-buffer: // use the window surface as the drawing destination. _surface = windowsurface; } else { // Do double-buffer: // Create a similar surface to the window which supports alpha // Ask XGServerWindow to call +[CairoContext handleExposeRect:forDriver:] // to let us handle the back buffer -> front buffer copy using cairo. GSWINDEVICE->gdriverProtocol |= GDriverHandlesExpose | GDriverHandlesBacking; GSWINDEVICE->gdriver = self; _windowSurface = windowsurface; _surface = cairo_surface_create_similar(windowsurface, CAIRO_CONTENT_COLOR_ALPHA, GSWINDEVICE->xframe.size.width, GSWINDEVICE->xframe.size.height); /*NSLog(@"Window surface type %d, back buffer type %d, w %d h %d", (int) cairo_surface_get_type(_windowSurface), (int) cairo_surface_get_type(_surface), (int) GSWINDEVICE->xframe.size.width, (int) GSWINDEVICE->xframe.size.height); */ } return self; } - (void) dealloc { if (_windowSurface != NULL) { cairo_surface_destroy(_windowSurface); } [super dealloc]; } - (NSSize) size { return GSWINDEVICE->xframe.size; } - (void) handleExposeRect: (NSRect)rect { cairo_t *windowCtx = cairo_create(_windowSurface); double backupOffsetX, backupOffsetY; // Temporairly cancel the device offset on the back buffer since // we want to work with raw X11 pixel coordinates cairo_surface_get_device_offset(_surface, &backupOffsetX, &backupOffsetY); cairo_surface_set_device_offset(_surface, 0, 0); // Copy the desired rectangle from the back buffer to the // front buffer // FIXME: should round cairo_rectangle(windowCtx, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); cairo_clip(windowCtx); cairo_set_source_surface(windowCtx, _surface, 0, 0); cairo_set_operator(windowCtx, CAIRO_OPERATOR_SOURCE); cairo_paint(windowCtx); // Debugging // cairo_reset_clip(windowCtx); // cairo_set_source_rgba(windowCtx, 1.0, 0.0, 0.0, 0.5); // cairo_rectangle(windowCtx, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); // cairo_stroke(windowCtx); // NSLog(@"Exposing rect %@ with cairo. Status: '%s'", NSStringFromRect(rect), cairo_status_to_string(cairo_status(windowCtx))); cairo_destroy(windowCtx); // Restore device offset cairo_surface_set_device_offset(_surface, backupOffsetX, backupOffsetY); } @end gnustep-back-0.29.0/Source/cairo/XGCairoSurface.m000066400000000000000000000103631404163720200215070ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "x11/XGServer.h" #include "x11/XGServerWindow.h" #include "cairo/XGCairoSurface.h" #include #define GSWINDEVICE ((gswindow_device_t *)gsDevice) @implementation XGCairoSurface - (id) initWithDevice: (void *)device { Display *dpy; Drawable drawable; Visual* visual; XWindowAttributes attributes; gsDevice = device; dpy = GSWINDEVICE->display; if (GSWINDEVICE->type != NSBackingStoreNonretained) { drawable = GSWINDEVICE->buffer; } else { drawable = GSWINDEVICE->ident; } /* if (GSWINDEVICE->type != NSBackingStoreNonretained) { GSWINDEVICE->gdriverProtocol |= GDriverHandlesExpose; XSetWindowBackgroundPixmap(GSWINDEVICE->display, GSWINDEVICE->ident, GSWINDEVICE->buffer); } */ if (!XGetWindowAttributes (dpy, GSWINDEVICE->ident, &attributes)) { visual = DefaultVisual (dpy, DefaultScreen (dpy)); } else { visual = attributes.visual; } _surface = cairo_xlib_surface_create(dpy, drawable, visual, GSWINDEVICE->xframe.size.width, GSWINDEVICE->xframe.size.height); return self; } - (NSSize) size { return GSWINDEVICE->xframe.size; } @end @implementation XGServer (ScreenCapture) - (NSImage *) contentsOfScreen: (int)screen inRect: (NSRect)rect { Window win; XWindowAttributes attrs; win = [self xDisplayRootWindow]; if (XGetWindowAttributes(dpy, win, &attrs)) { NSInteger width = rect.size.width; NSInteger height = rect.size.height; NSImage *result; NSBitmapImageRep *bmp; cairo_surface_t *src, *dest; // Convert rect to flipped coordinates rect.origin.y = attrs.height - NSMaxY(rect); bmp = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL pixelsWide: width pixelsHigh: height bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSDeviceRGBColorSpace bitmapFormat: 0 bytesPerRow: 0 bitsPerPixel: 32] autorelease]; src = cairo_xlib_surface_create(dpy, win, attrs.visual, attrs.width, attrs.height); dest = cairo_image_surface_create_for_data([bmp bitmapData], CAIRO_FORMAT_ARGB32, width, height, [bmp bytesPerRow]); { cairo_t *cr = cairo_create(dest); cairo_set_source_surface(cr, src, -1 * rect.origin.x, -1 * rect.origin.y); cairo_paint(cr); cairo_destroy(cr); } cairo_surface_destroy(src); cairo_surface_destroy(dest); // Convert BGRA to RGBA { NSInteger stride; NSInteger x, y; unsigned char *cdata; stride = [bmp bytesPerRow]; cdata = [bmp bitmapData]; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { NSInteger i = (y * stride) + (x * 4); unsigned char d = cdata[i]; #if GS_WORDS_BIGENDIAN cdata[i] = cdata[i + 1]; cdata[i + 1] = cdata[i + 2]; cdata[i + 2] = cdata[i + 3]; cdata[i + 3] = d; #else cdata[i] = cdata[i + 2]; //cdata[i + 1] = cdata[i + 1]; cdata[i + 2] = d; //cdata[i + 3] = cdata[i + 3]; #endif } } } result = [[[NSImage alloc] initWithSize: NSMakeSize(width, height)] autorelease]; [result addRepresentation: bmp]; return result; } return nil; } @end gnustep-back-0.29.0/Source/cairo/XGCairoXImageSurface.m000066400000000000000000000050541404163720200226030ustar00rootroot00000000000000/* Copyright (C) 2002 Free Software Foundation, Inc. Author: Banlu Kemiyatorn This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "x11/XGServer.h" #include "x11/XGServerWindow.h" #include "x11/XWindowBuffer.h" #include "cairo/XGCairoXImageSurface.h" #include "cairo/XGCairoSurface.h" #define GSWINDEVICE ((gswindow_device_t *)gsDevice) @implementation XGCairoXImageSurface - (id) initWithDevice: (void *)device { struct XWindowBuffer_depth_info_s di; gsDevice = device; if (GSWINDEVICE->type == NSBackingStoreNonretained) { // FIXME: This is a hack to get non-reatined backing store working. // I see no reason, why it isn't working, as the code is identical // to the one in the art backend. RELEASE(self); return (XGCairoXImageSurface*)[[XGCairoSurface alloc] initWithDevice: device]; } di.drawing_depth = GSWINDEVICE->depth; // FIXME: The next lines may be wrong for depth <> 32. // But then art uses a depth of 24 for 32 bit modes. Strange! di.bytes_per_pixel = 4; di.inline_alpha = YES; di.inline_alpha_ofs = 0; /* The cairo image surface uses the client's byte order (cf. bug #28590). */ #if GS_WORDS_BIGENDIAN di.byte_order = MSBFirst; #else di.byte_order = LSBFirst; #endif ASSIGN(wi, [XWindowBuffer windowBufferForWindow: GSWINDEVICE depthInfo: &di]); _surface = cairo_image_surface_create_for_data((unsigned char*)wi->data, CAIRO_FORMAT_ARGB32, wi->sx, wi->sy, wi->bytes_per_line); return self; } - (void) dealloc { DESTROY(wi); [super dealloc]; } - (NSSize) size { return GSWINDEVICE->xframe.size; } @end gnustep-back-0.29.0/Source/fontconfig/000077500000000000000000000000001404163720200175605ustar00rootroot00000000000000gnustep-back-0.29.0/Source/fontconfig/FCFaceInfo.m000066400000000000000000000103101404163720200216140ustar00rootroot00000000000000/* FCFaceInfo.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on original code of Alex Malmberg Rewrite: Fred Kiefer Date: Jan 2006 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "fontconfig/FCFaceInfo.h" #include "fontconfig/FCFontEnumerator.h" #include @implementation FCFaceInfo - (id) initWithfamilyName: (NSString *)familyName weight: (int)weight traits: (unsigned int)traits pattern: (FcPattern *)pattern { _pattern = pattern; FcPatternReference(_pattern); [self setFamilyName: familyName]; [self setWeight: weight]; [self setTraits: traits]; return self; } - (void) dealloc { FcPatternDestroy(_pattern); RELEASE(_familyName); RELEASE(_characterSet); [super dealloc]; } - (void) setFamilyName: (NSString *)name { ASSIGN(_familyName, name); } - (NSString *)familyName { return _familyName; } - (NSString *) displayName { char *fcname; #ifdef FC_POSTSCRIPT_NAME char *fcpsname; #endif /* If fullname && fullname != psname, use fullname as displayname. This works around some weird Adobe OpenType fonts which contain their PostScript name in their "human-readable name" field. So, set the fullname as displayName (now AKA VisibleName) only if it's not the same as whatever the postscript name is. */ if (FcPatternGetString(_pattern, FC_FULLNAME, 0, (FcChar8 **)&fcname) == FcResultMatch #ifdef FC_POSTSCRIPT_NAME && FcPatternGetString(_pattern, FC_POSTSCRIPT_NAME, 0, (FcChar8 **)&fcpsname) == FcResultMatch && strcmp (fcpsname, fcname) #endif ) { return [NSString stringWithUTF8String: fcname]; } else if (FcPatternGetString(_pattern, FC_STYLE, 0, (FcChar8 **)&fcname) == FcResultMatch) { return [NSString stringWithFormat: @"%@ %@", _familyName, [NSString stringWithUTF8String: fcname]]; } return _familyName; } - (int) weight { return _weight; } - (void) setWeight: (int)weight { _weight = weight; } - (unsigned int) traits { return _traits; } - (void) setTraits: (unsigned int)traits { _traits = traits; } - (unsigned int) cacheSize { return 257; } - (void *) fontFace { [self subclassResponsibility: _cmd]; return NULL; } - (FcPattern *) matchedPattern { if (!_patternIsResolved) { FcResult result; FcPattern *resolved; FcConfigSubstitute(NULL, _pattern, FcMatchPattern); FcDefaultSubstitute(_pattern); resolved = FcFontMatch(NULL, _pattern, &result); FcPatternDestroy(_pattern); _pattern = resolved; _patternIsResolved = YES; } // The caller expects ownership of returned pattern and will destroy it FcPatternReference(_pattern); return _pattern; } - (NSCharacterSet*) characterSet { if (_characterSet == nil && !_hasNoCharacterSet) { FcPattern *resolved; FcCharSet *charset; resolved = [self matchedPattern]; if (FcResultMatch == FcPatternGetCharSet(resolved, FC_CHARSET, 0, &charset)) { _characterSet = [[FontconfigCharacterSet alloc] initWithFontconfigCharSet: charset]; } /* Only try to get the character set once because FcFontMatch is expensive */ if (_characterSet == nil) { _hasNoCharacterSet = YES; } FcPatternDestroy(resolved); } return _characterSet; } @end gnustep-back-0.29.0/Source/fontconfig/FCFontEnumerator.m000066400000000000000000000735671404163720200231410ustar00rootroot00000000000000/* FCFontEnumerator.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on original code of Alex Malmberg Rewrite: Fred Kiefer Date: Jan 2006 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gsc/GSGState.h" #include "fontconfig/FCFontEnumerator.h" #include "fontconfig/FCFontInfo.h" // Old versions of fontconfig don't have FC_WEIGHT_ULTRABLACK defined. // Use the maximal value instead. #ifndef FC_WEIGHT_ULTRABLACK #define FC_WEIGHT_ULTRABLACK FC_WEIGHT_BLACK #endif static float convertWeight (int fcWeight, int bottomValue, int topValue) { /* This is the distance between topValue and bottomValue expressed as a fraction between zero and one. We do this to express the range of fontconfig font weights in a useful manner. */ if (fcWeight <= bottomValue) { return 0.0; } else if (fcWeight >= topValue) { return 1.0; } else { return (float) (fcWeight - bottomValue) * (1.0f / (topValue - bottomValue)); } } static NSComparisonResult sortFontFacesArray(id fontArr1, id fontArr2, void *context) { /* Order of array: 0: Font name 1: Font style 2: Font weight 3: Font traits */ NSString *style1 = [fontArr1 objectAtIndex: 1]; NSString *style2 = [fontArr2 objectAtIndex: 1]; float weight1 = [[fontArr1 objectAtIndex: 2] floatValue]; float weight2 = [[fontArr2 objectAtIndex: 2] floatValue]; unsigned int traits1 = [[fontArr1 objectAtIndex: 3] unsignedIntValue]; unsigned int traits2 = [[fontArr2 objectAtIndex: 3] unsignedIntValue]; // order first by weight if (weight1 < weight2) return NSOrderedAscending; if (weight1 > weight2) return NSOrderedDescending; // Italic next if ((traits1 & NSItalicFontMask) < (traits2 & NSItalicFontMask)) return NSOrderedAscending; if ((traits1 & NSItalicFontMask) > (traits2 & NSItalicFontMask)) return NSOrderedDescending; // now do condensed if ((traits1 & NSCondensedFontMask) < (traits2 & NSCondensedFontMask)) return NSOrderedAscending; if ((traits1 & NSCondensedFontMask) > (traits2 & NSCondensedFontMask)) return NSOrderedDescending; // ...and expanded if ((traits1 & NSExpandedFontMask) < (traits2 & NSExpandedFontMask)) return NSOrderedAscending; if ((traits1 & NSExpandedFontMask) > (traits2 & NSExpandedFontMask)) return NSOrderedDescending; // Special case: "Regular" sorts before non-Regular, for many reasons. if ([style1 isEqualToString: @"Regular"] && ![style2 isEqualToString: @"Regular"]) return NSOrderedAscending; if ([style2 isEqualToString: @"Regular"] && ![style1 isEqualToString: @"Regular"]) return NSOrderedDescending; if ([style1 isEqualToString: @"Normal"] && ![style2 isEqualToString: @"Normal"]) return NSOrderedAscending; if ([style2 isEqualToString: @"Normal"] && ![style1 isEqualToString: @"Normal"]) return NSOrderedDescending; if ([style1 isEqualToString: @"Roman"] && ![style2 isEqualToString: @"Roman"]) return NSOrderedAscending; if ([style2 isEqualToString: @"Roman"] && ![style1 isEqualToString: @"Roman"]) return NSOrderedDescending; // Otherwise, alphabetize return [style1 compare: style2]; } @implementation FCFontEnumerator NSMutableDictionary * __allFonts; + (FCFaceInfo *) fontWithName: (NSString *) name { FCFaceInfo *face; face = [__allFonts objectForKey: name]; if (!face) { NSDebugLLog(@"NSFont", @"Font not found %@", name); } return face; } + (Class) faceInfoClass { [self subclassResponsibility: _cmd]; return nil; } // Make a GNUstep style font descriptor from a FcPattern static NSArray *faFromFc(FcPattern *pat) { int weight, slant, spacing, width; float nsweight; unsigned int nstraits = 0; char *fcfamily, *fcstyle; NSMutableString *name, *family, *style; #ifdef FC_POSTSCRIPT_NAME char *fcname; #endif if (FcPatternGetInteger(pat, FC_WEIGHT, 0, &weight) != FcResultMatch || FcPatternGetInteger(pat, FC_SLANT, 0, &slant) != FcResultMatch || FcPatternGetString(pat, FC_FAMILY, 0, (FcChar8 **)&fcfamily) != FcResultMatch) return nil; if (FcPatternGetInteger(pat, FC_SPACING, 0, &spacing) == FcResultMatch) if (spacing==FC_MONO || spacing==FC_CHARCELL) nstraits |= NSFixedPitchFontMask; name = [NSMutableString stringWithCapacity: 100]; #ifdef FC_POSTSCRIPT_NAME if (FcPatternGetString(pat, FC_POSTSCRIPT_NAME, 0, (FcChar8 **)&fcname) == FcResultMatch) [name appendString: [NSMutableString stringWithUTF8String: fcname]]; #endif family = [NSMutableString stringWithUTF8String: fcfamily]; style = [NSMutableString stringWithCapacity: 100]; if (weight < FC_WEIGHT_ULTRALIGHT) { [style appendString: @"Thin"]; nsweight = 1 + convertWeight (weight, FC_WEIGHT_THIN, FC_WEIGHT_ULTRALIGHT); } else if (weight < FC_WEIGHT_LIGHT) { [style appendString: @"Ultralight"]; nsweight = 2 + convertWeight (weight, FC_WEIGHT_ULTRALIGHT, FC_WEIGHT_LIGHT); } else if (weight < FC_WEIGHT_BOOK) { [style appendString: @"Light"]; nsweight = 3 + convertWeight (weight, FC_WEIGHT_LIGHT, FC_WEIGHT_BOOK); } else if (weight < FC_WEIGHT_REGULAR) { [style appendString: @"Book"]; nsweight = 4 + convertWeight (weight, FC_WEIGHT_BOOK, FC_WEIGHT_REGULAR); } else if (weight < FC_WEIGHT_MEDIUM) { nsweight = 5 + convertWeight (weight, FC_WEIGHT_REGULAR, FC_WEIGHT_MEDIUM); } else if (weight < FC_WEIGHT_DEMIBOLD) { [style appendString: @"Medium"]; nsweight = 6 + convertWeight (weight, FC_WEIGHT_MEDIUM, FC_WEIGHT_DEMIBOLD); } else if (weight < FC_WEIGHT_BOLD) { [style appendString: @"Demibold"]; nsweight = 7 + convertWeight (weight, FC_WEIGHT_DEMIBOLD, FC_WEIGHT_BOLD); } else if (weight < FC_WEIGHT_ULTRABOLD) { [style appendString: @"Bold"]; nsweight = 9 + convertWeight (weight, FC_WEIGHT_BOLD, FC_WEIGHT_ULTRABOLD); nstraits |= NSBoldFontMask; } else if (weight < FC_WEIGHT_BLACK) { [style appendString: @"Ultrabold"]; nsweight = 11 + convertWeight (weight, FC_WEIGHT_ULTRABOLD, FC_WEIGHT_BLACK); nstraits |= NSBoldFontMask; } else if (weight < FC_WEIGHT_ULTRABLACK) { [style appendString: @"Black"]; nsweight = 12 + convertWeight (weight, FC_WEIGHT_BLACK, FC_WEIGHT_ULTRABLACK); nstraits |= NSBoldFontMask; } else { [style appendString: @"Ultrablack"]; nsweight = 13 + convertWeight (weight, FC_WEIGHT_ULTRABLACK, FC_WEIGHT_ULTRABLACK + 20); nstraits |= NSBoldFontMask; } if (FcPatternGetInteger(pat, FC_WIDTH, 0, &width) == FcResultMatch) { if (width < FC_WIDTH_EXTRACONDENSED) { [style appendString: @"Ultracondensed"]; nstraits |= NSCondensedFontMask; } else if (width < FC_WIDTH_CONDENSED) { [style appendString: @"Extracondensed"]; nstraits |= NSCondensedFontMask; } else if (width < FC_WIDTH_SEMICONDENSED) { [style appendString: @"Condensed"]; nstraits |= NSCondensedFontMask; } else if (width < FC_WIDTH_SEMIEXPANDED) { // do nothing, this is "regular" } else if (width < FC_WIDTH_EXPANDED) { [style appendString: @"Semiexpanded"]; nstraits |= NSExpandedFontMask; } else if (width < FC_WIDTH_EXTRAEXPANDED) { [style appendString: @"Expanded"]; nstraits |= NSExpandedFontMask; } else if (width < FC_WIDTH_ULTRAEXPANDED) { [style appendString: @"Extraexpanded"]; nstraits |= NSExpandedFontMask; } else { [style appendString: @"Ultraexpanded"]; nstraits |= NSExpandedFontMask; } } switch (slant) { case FC_SLANT_ROMAN: break; case FC_SLANT_ITALIC: [style appendString: @"Italic"]; nstraits |= NSItalicFontMask; break; case FC_SLANT_OBLIQUE: [style appendString: @"Oblique"]; nstraits |= NSItalicFontMask; break; } if (![name length]) // no psname { NSDebugLLog(@"NSFont", @"Warning: synthesizing PSName for '%@ %@'", family, style); [name appendString: family]; if ([style length] > 0) { [name appendString: @"-"]; [name appendString: style]; } } if (![style length]) { [style setString: @"Regular"]; } if (FcPatternGetString(pat, FC_STYLE, 0, (FcChar8 **)&fcstyle) == FcResultMatch) style = [NSString stringWithUTF8String: fcstyle]; // NSLog (@"family: %@, style: %s/%@", name, fcstyle, style); return [NSArray arrayWithObjects: name, style, [NSNumber numberWithFloat: nsweight], [NSNumber numberWithUnsignedInt: nstraits], nil]; } - (void) enumerateFontsAndFamilies { int i; NSMutableDictionary *fcxft_allFontFamilies = [NSMutableDictionary new]; NSMutableDictionary *fcxft_allFonts = [NSMutableDictionary new]; NSMutableArray *fcxft_allFontNames = [NSMutableArray new]; Class faceInfoClass = [[self class] faceInfoClass]; FcPattern *pat = FcPatternCreate(); FcObjectSet *os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, FC_FULLNAME, #ifdef FC_POSTSCRIPT_NAME FC_POSTSCRIPT_NAME, #endif FC_SLANT, FC_WEIGHT, FC_WIDTH, FC_SPACING, NULL); FcFontSet *fs = FcFontList(NULL, pat, os); FcPatternDestroy(pat); FcObjectSetDestroy(os); for (i = 0; i < fs->nfont; i++) { char *family; if (FcPatternGetString(fs->fonts[i], FC_FAMILY, 0, (FcChar8 **)&family) == FcResultMatch) { NSArray *fontArray; if ((fontArray = faFromFc(fs->fonts[i]))) { NSString *name = [fontArray objectAtIndex: 0]; if (![fcxft_allFontNames containsObject: name]) { NSString *familyString; NSMutableArray *familyArray; FCFaceInfo *aFont; familyString = [NSString stringWithUTF8String: family]; familyArray = [fcxft_allFontFamilies objectForKey: familyString]; if (familyArray == nil) { NSDebugLLog(@"NSFont", @"Found font family %@", familyString); familyArray = [[NSMutableArray alloc] init]; [fcxft_allFontFamilies setObject: familyArray forKey: familyString]; RELEASE(familyArray); } NSDebugLLog(@"NSFont", @"fc enumerator: adding font: %@", name); [familyArray addObject: fontArray]; [fcxft_allFontNames addObject: name]; aFont = [[faceInfoClass alloc] initWithfamilyName: familyString weight: [[fontArray objectAtIndex: 2] floatValue] traits: [[fontArray objectAtIndex: 3] unsignedIntValue] pattern: fs->fonts[i]]; [fcxft_allFonts setObject: aFont forKey: name]; RELEASE(aFont); } } } } FcFontSetDestroy (fs); allFontNames = fcxft_allFontNames; allFontFamilies = fcxft_allFontFamilies; __allFonts = fcxft_allFonts; // Sort font families { NSComparisonResult (*fontSort)(id, id, void *) = sortFontFacesArray; NSEnumerator *e = [allFontFamilies keyEnumerator]; id key; while ((key = [e nextObject])) { [[allFontFamilies objectForKey: key] sortUsingFunction: fontSort context: NULL]; } } } - (NSString *) defaultSystemFontName { if ([allFontNames containsObject: @"DejaVuSans"]) { return @"DejaVuSans"; } if ([allFontNames containsObject: @"BitstreamVeraSans-Roman"]) { return @"BitstreamVeraSans-Roman"; } if ([allFontNames containsObject: @"FreeSans"]) { return @"FreeSans"; } if ([allFontNames containsObject: @"Tahoma"]) { return @"Tahoma"; } if ([allFontNames containsObject: @"ArialMT"]) { return @"ArialMT"; } return @"Helvetica"; } - (NSString *) defaultBoldSystemFontName { if ([allFontNames containsObject: @"DejaVuSans-Bold"]) { return @"DejaVuSans-Bold"; } if ([allFontNames containsObject: @"BitstreamVeraSans-Bold"]) { return @"BitstreamVeraSans-Bold"; } if ([allFontNames containsObject: @"FreeSans-Bold"]) { return @"FreeSans-Bold"; } if ([allFontNames containsObject: @"Tahoma-Bold"]) { return @"Tahoma-Bold"; } if ([allFontNames containsObject: @"Arial-BoldMT"]) { return @"Arial-BoldMT"; } return @"Helvetica-Bold"; } - (NSString *) defaultFixedPitchFontName { if ([allFontNames containsObject: @"DejaVuSansMono"]) { return @"DejaVuSansMono"; } if ([allFontNames containsObject: @"BitstreamVeraSansMono-Roman"]) { return @"BitstreamVeraSansMono-Roman"; } if ([allFontNames containsObject: @"FreeMono"]) { return @"FreeMono"; } if ([allFontNames containsObject: @"CourierNewPSMT"]) { return @"CourierNewPSMT"; } return @"Courier"; } /** * Overrides the implementation in GSFontInfo, and delegates the * matching to Fontconfig. */ - (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes { NSMutableArray *descriptors; FcResult result; FcPattern *matchedpat, *pat; FontconfigPatternGenerator *generator; descriptors = [NSMutableArray array]; generator = [[FontconfigPatternGenerator alloc] init]; pat = [generator createPatternWithAttributes: attributes]; DESTROY(generator); FcConfigSubstitute(NULL, pat, FcMatchPattern); FcDefaultSubstitute(pat); result = FcResultMatch; matchedpat = FcFontMatch(NULL, pat, &result); if (result != FcResultMatch) { NSLog(@"Warning, FcFontMatch failed with code: %d", result); } else { FcFontSet *fontSet; result = FcResultMatch; fontSet = FcFontSort(NULL, matchedpat, FcFalse, NULL, &result); if (result == FcResultMatch) { int i; for (i=0; infont; i++) { FontconfigPatternParser *parser = [[FontconfigPatternParser alloc] init]; // FIXME: do we need to match this pattern? FcPattern *matchingpat = fontSet->fonts[i]; NSDictionary *attribs = [parser attributesFromPattern: matchingpat]; [parser release]; [descriptors addObject: [NSFontDescriptor fontDescriptorWithFontAttributes: attribs]]; } } else { NSLog(@"ERROR! FcFontSort failed"); } FcFontSetDestroy(fontSet); FcPatternDestroy(matchedpat); } FcPatternDestroy(pat); return descriptors; } @end @implementation FontconfigPatternGenerator - (void)addName: (NSString*)name { #ifdef FC_POSTSCRIPT_NAME FcPatternAddString(_pat, FC_POSTSCRIPT_NAME, (const FcChar8 *)[name UTF8String]); #else // FIXME: Fontconfig ignores PostScript names of fonts; we need // https://bugs.freedesktop.org/show_bug.cgi?id=18095 fixed. // This is a heuristic to try to 'parse' a PostScript font name, // however, since they are just unique identifiers for fonts and // don't need to follow any naming convention, this may fail NSRange dash = [name rangeOfString: @"-"]; if (dash.location == NSNotFound) { FcPatternAddString(_pat, FC_FAMILY, (const FcChar8 *)[name UTF8String]); } else { NSString *weightAndSlant = [name substringFromIndex: dash.location + 1]; NSString *family = [name substringToIndex: dash.location]; FcPatternAddString(_pat, FC_FAMILY, (const FcChar8 *)[family UTF8String]); if (NSNotFound != [weightAndSlant rangeOfString: @"Light"].location) { FcPatternAddInteger(_pat, FC_WEIGHT, FC_WEIGHT_LIGHT); } else if (NSNotFound != [weightAndSlant rangeOfString: @"Medium"].location) { FcPatternAddInteger(_pat, FC_WEIGHT, FC_WEIGHT_MEDIUM); } else if (NSNotFound != [weightAndSlant rangeOfString: @"Demibold"].location) { FcPatternAddInteger(_pat, FC_WEIGHT, FC_WEIGHT_DEMIBOLD); } else if (NSNotFound != [weightAndSlant rangeOfString: @"Bold"].location) { FcPatternAddInteger(_pat, FC_WEIGHT, FC_WEIGHT_BOLD); } else if (NSNotFound != [weightAndSlant rangeOfString: @"Black"].location) { FcPatternAddInteger(_pat, FC_WEIGHT, FC_WEIGHT_BLACK); } if (NSNotFound != [weightAndSlant rangeOfString: @"Italic"].location) { FcPatternAddInteger(_pat, FC_SLANT, FC_SLANT_ITALIC); } else if (NSNotFound != [weightAndSlant rangeOfString: @"Oblique"].location) { FcPatternAddInteger(_pat, FC_SLANT, FC_SLANT_OBLIQUE); } if (NSNotFound != [weightAndSlant rangeOfString: @"Condensed"].location) { FcPatternAddInteger(_pat, FC_WIDTH, FC_WIDTH_CONDENSED); } else if (NSNotFound != [weightAndSlant rangeOfString: @"Expanded"].location) { FcPatternAddInteger(_pat, FC_WIDTH, FC_WIDTH_EXPANDED); } } #endif } - (void)addVisibleName: (NSString*)name { FcPatternAddString(_pat, FC_FULLNAME, (const FcChar8 *)[name UTF8String]); } - (void)addFamilyName: (NSString*)name { FcPatternAddString(_pat, FC_FAMILY, (const FcChar8 *)[name UTF8String]); } - (void)addStyleName: (NSString*)style { FcPatternAddString(_pat, FC_STYLE, (const FcChar8 *)[style UTF8String]); } - (void)addTraits: (NSDictionary*)traits { if ([traits objectForKey: NSFontSymbolicTrait]) { NSFontSymbolicTraits symTraits = [[traits objectForKey: NSFontSymbolicTrait] intValue]; if (symTraits & NSFontItalicTrait) { // NOTE: May be overridden by NSFontSlantTrait FcPatternAddInteger(_pat, FC_SLANT, FC_SLANT_ITALIC); } if (symTraits & NSFontBoldTrait) { // NOTE: May be overridden by NSFontWeightTrait FcPatternAddInteger(_pat, FC_WEIGHT, FC_WEIGHT_BOLD); } if (symTraits & NSFontExpandedTrait) { // NOTE: May be overridden by NSFontWidthTrait FcPatternAddInteger(_pat, FC_WIDTH, FC_WIDTH_EXPANDED); } if (symTraits & NSFontCondensedTrait) { // NOTE: May be overridden by NSFontWidthTrait FcPatternAddInteger(_pat, FC_WIDTH, FC_WIDTH_CONDENSED); } if (symTraits & NSFontMonoSpaceTrait) { FcValue value; // If you run "fc-match :spacing=100", you get "DejaVu Sans" even though you would // expect to get "DejaVu Sans Mono". So, we also add "monospace" as a weak family // name to fix the problem. FcPatternAddInteger(_pat, FC_SPACING, FC_MONO); value.type = FcTypeString; value.u.s = (FcChar8*)"monospace"; FcPatternAddWeak(_pat, FC_FAMILY, value, FcTrue); } if (symTraits & NSFontVerticalTrait) { // Fontconfig can't express this (it means sideways letters) } if (symTraits & NSFontUIOptimizedTrait) { // NOTE: Fontconfig can't express this } { NSFontFamilyClass class = symTraits & NSFontFamilyClassMask; char *addWeakFamilyName = NULL; switch (class) { default: case NSFontUnknownClass: case NSFontOrnamentalsClass: case NSFontScriptsClass: case NSFontSymbolicClass: // FIXME: Is there some way to convey these to Fontconfig? break; case NSFontOldStyleSerifsClass: case NSFontTransitionalSerifsClass: case NSFontModernSerifsClass: case NSFontClarendonSerifsClass: case NSFontSlabSerifsClass: case NSFontFreeformSerifsClass: addWeakFamilyName = "serif"; break; case NSFontSansSerifClass: addWeakFamilyName = "sans"; break; } if (addWeakFamilyName) { FcValue value; value.type = FcTypeString; value.u.s = (const FcChar8 *)addWeakFamilyName; FcPatternAddWeak(_pat, FC_FAMILY, value, FcTrue); } } } if ([traits objectForKey: NSFontWeightTrait]) { /** * Scale: -1 is thinnest, 0 is normal, 1 is heaviest */ double weight = [[traits objectForKey: NSFontWeightTrait] doubleValue]; int fcWeight; weight = MAX(-1, MIN(1, weight)); if (weight <= 0) { fcWeight = FC_WEIGHT_THIN + ((weight + 1.0) * (FC_WEIGHT_NORMAL - FC_WEIGHT_THIN)); } else { fcWeight = FC_WEIGHT_NORMAL + (weight * (FC_WEIGHT_ULTRABLACK - FC_WEIGHT_NORMAL)); } FcPatternAddInteger(_pat, FC_WEIGHT, fcWeight); } if ([traits objectForKey: NSFontWidthTrait]) { /** * Scale: -1 is most condensed, 0 is normal, 1 is most spread apart */ double width = [[traits objectForKey: NSFontWidthTrait] doubleValue]; int fcWidth; width = MAX(-1, MIN(1, width)); if (width <= 0) { fcWidth = FC_WIDTH_ULTRACONDENSED + ((width + 1.0) * (FC_WIDTH_NORMAL - FC_WIDTH_ULTRACONDENSED)); } else { fcWidth = FC_WIDTH_NORMAL + (width * (FC_WIDTH_ULTRAEXPANDED - FC_WIDTH_NORMAL)); } FcPatternAddInteger(_pat, FC_WIDTH, fcWidth); } if ([traits objectForKey: NSFontSlantTrait]) { /** * Scale: -1 is 30 degree counterclockwise slant, 0 is no slant, 1 * is 30 degree clockwise slant */ double slant = [[traits objectForKey: NSFontSlantTrait] doubleValue]; // NOTE: Fontconfig can't express this as a scale if (slant > 0) { FcPatternAddInteger(_pat, FC_SLANT, FC_SLANT_ITALIC); } else { FcPatternAddInteger(_pat, FC_SLANT, FC_SLANT_ROMAN); } } } - (void)addSize: (NSNumber*)size { FcPatternAddDouble(_pat, FC_SIZE, [size doubleValue]); } - (void)addCharacterSet: (NSCharacterSet*)characterSet { if ([characterSet isKindOfClass: [FontconfigCharacterSet class]]) { // Fast case FcPatternAddCharSet(_pat, FC_CHARSET, [(FontconfigCharacterSet*)characterSet fontconfigCharSet]); } else { // Slow case FcCharSet *fcSet = FcCharSetCreate(); uint32_t plane; for (plane=0; plane<=16; plane++) { if ([characterSet hasMemberInPlane: plane]) { uint32_t codePoint; for (codePoint = plane<<16; codePoint <= 0xffff + (plane<<16); codePoint++) { if ([characterSet longCharacterIsMember: codePoint]) { FcCharSetAddChar(fcSet, codePoint); } } } } FcPatternAddCharSet(_pat, FC_CHARSET, fcSet); FcCharSetDestroy(fcSet); } } #define ADD_TO_PATTERN(key, handlerMethod, valueClass) \ do { \ id value = [_attributes objectForKey: key]; \ if (value) \ { \ if ([value isKindOfClass: valueClass]) \ { \ [self handlerMethod value]; \ } \ else \ { \ NSLog(@"NSFontDescriptor: Ignoring invalid value %@ for attribute %@", value, key); \ } \ } \ } while (0); - (void)addAttributes { ADD_TO_PATTERN(NSFontNameAttribute, addName:, [NSString class]); ADD_TO_PATTERN(NSFontVisibleNameAttribute, addVisibleName:, [NSString class]); ADD_TO_PATTERN(NSFontFamilyAttribute, addFamilyName:, [NSString class]); ADD_TO_PATTERN(NSFontFaceAttribute, addStyleName:, [NSString class]); ADD_TO_PATTERN(NSFontTraitsAttribute, addTraits:, [NSDictionary class]); ADD_TO_PATTERN(NSFontSizeAttribute, addSize:, [NSNumber class]); ADD_TO_PATTERN(NSFontCharacterSetAttribute, addCharacterSet:, [NSCharacterSet class]); } - (FcPattern *)createPatternWithAttributes: (NSDictionary *)attributes { _attributes = attributes; _pat = FcPatternCreate(); [self addAttributes]; return _pat; } @end @implementation FontconfigPatternParser - (NSString*)readFontconfigString: (const char *)key fromPattern: (FcPattern*)pat { unsigned char *string = NULL; if (FcResultMatch == FcPatternGetString(pat, key, 0, &string)) { if (string) { return [NSString stringWithUTF8String: (const char *)string]; } } return nil; } - (NSNumber*)readFontconfigInteger: (const char *)key fromPattern: (FcPattern*)pat { int value; if (FcResultMatch == FcPatternGetInteger(pat, key, 0, &value)) { return [NSNumber numberWithInt: value]; } return nil; } - (NSNumber*)readFontconfigDouble: (const char *)key fromPattern: (FcPattern*)pat { double value; if (FcResultMatch == FcPatternGetDouble(pat, key, 0, &value)) { return [NSNumber numberWithDouble: value]; } return nil; } - (NSString*)readNameFromPattern: (FcPattern*)pat { #ifdef FC_POSTSCRIPT_NAME NSString *name = [self readFontconfigString: FC_POSTSCRIPT_NAME fromPattern: pat]; #endif NSString *family = [self readFontconfigString: FC_FAMILY fromPattern: pat]; NSString *style = [self readFontconfigString: FC_STYLE fromPattern: pat]; #ifdef FC_POSTSCRIPT_NAME if (name) return name; else #endif if (style) { return [NSString stringWithFormat: @"%@-%@", family, style]; } else { return family; } } - (NSString*)readVisibleNameFromPattern: (FcPattern*)pat { // FIXME: try to get the localized one return [self readFontconfigString: FC_FULLNAME fromPattern: pat]; } - (NSString*)readFamilyNameFromPattern: (FcPattern*)pat { // FIXME: try to get the localized one return [self readFontconfigString: FC_FAMILY fromPattern: pat]; } - (NSString*)readStyleNameFromPattern: (FcPattern*)pat { // FIXME: try to get the localized one return [self readFontconfigString: FC_STYLE fromPattern: pat]; } - (NSDictionary*)readTraitsFromPattern: (FcPattern*)pat { NSMutableDictionary *traits = [NSMutableDictionary dictionary]; NSFontSymbolicTraits symTraits = 0; int value; if (FcResultMatch == FcPatternGetInteger(pat, FC_SLANT, 0, &value)) { if (value > FC_SLANT_ROMAN) { symTraits |= NSFontItalicTrait; } } if (FcResultMatch == FcPatternGetInteger(pat, FC_WEIGHT, 0, &value)) { double weight; if (value >= FC_WEIGHT_BOLD) { symTraits |= NSFontBoldTrait; } if (value <= FC_WEIGHT_NORMAL) { weight = ((value - FC_WEIGHT_THIN) / (double)(FC_WEIGHT_NORMAL - FC_WEIGHT_THIN)) - 1.0; } else { weight = (value - FC_WEIGHT_NORMAL) / (double)(FC_WEIGHT_ULTRABLACK - FC_WEIGHT_NORMAL); } [traits setObject: [NSNumber numberWithDouble: weight] forKey: NSFontWeightTrait]; } if (FcResultMatch == FcPatternGetInteger(pat, FC_WIDTH, 0, &value)) { double width; if (value >= FC_WIDTH_EXPANDED) { symTraits |= NSFontExpandedTrait; } if (value <= FC_WIDTH_CONDENSED) { symTraits |= NSFontCondensedTrait; } if (value <= FC_WIDTH_NORMAL) { width = ((value - FC_WIDTH_ULTRACONDENSED) / (double)(FC_WIDTH_NORMAL - FC_WIDTH_ULTRACONDENSED)) - 1.0; } else { width = (value - FC_WIDTH_NORMAL) / (double)(FC_WIDTH_ULTRAEXPANDED - FC_WIDTH_NORMAL); } [traits setObject: [NSNumber numberWithDouble: width] forKey: NSFontWidthTrait]; } if (FcResultMatch == FcPatternGetInteger(pat, FC_SPACING, 0, &value)) { if (value == FC_MONO || value == FC_CHARCELL) { symTraits |= NSFontMonoSpaceTrait; } } if (symTraits != 0) { [traits setObject: [NSNumber numberWithUnsignedInt: symTraits] forKey: NSFontSymbolicTrait]; } return traits; } - (NSNumber*)readSizeFromPattern: (FcPattern*)pat { return [self readFontconfigDouble: FC_SIZE fromPattern: pat]; } - (NSCharacterSet*)readCharacterSetFromPattern: (FcPattern*)pat { FcCharSet *value; if (FcResultMatch == FcPatternGetCharSet(pat, FC_CHARSET, 0, &value)) { return [[[FontconfigCharacterSet alloc] initWithFontconfigCharSet: value] autorelease]; } return nil; } #define READ_FROM_PATTERN(key, readMethod) \ do { \ id result = [self readMethod _pat]; \ if (result != nil) \ { \ [_attributes setObject: result \ forKey: key]; \ } \ } while (0); - (void)parseAttributes { READ_FROM_PATTERN(NSFontNameAttribute, readNameFromPattern:); READ_FROM_PATTERN(NSFontVisibleNameAttribute, readVisibleNameFromPattern:); READ_FROM_PATTERN(NSFontFamilyAttribute, readFamilyNameFromPattern:); READ_FROM_PATTERN(NSFontFaceAttribute, readStyleNameFromPattern:); READ_FROM_PATTERN(NSFontTraitsAttribute, readTraitsFromPattern:); READ_FROM_PATTERN(NSFontSizeAttribute, readSizeFromPattern:); READ_FROM_PATTERN(NSFontCharacterSetAttribute, readCharacterSetFromPattern:); } - (NSDictionary*)attributesFromPattern: (FcPattern *)pat { _attributes = [NSMutableDictionary dictionary]; _pat = pat; [self parseAttributes]; return _attributes; } @end @implementation FontconfigCharacterSet - (id)initWithFontconfigCharSet: (FcCharSet*)charset { if ((self = [super init])) { _charset = FcCharSetCopy(charset); } return self; } - (id)mutableCopyWithZone: (NSZone*)aZone { return [[NSMutableCharacterSet characterSetWithBitmapRepresentation: [self bitmapRepresentation]] retain]; } - (void)dealloc { FcCharSetDestroy(_charset); [super dealloc]; } - (FcCharSet*)fontconfigCharSet { return _charset; } - (BOOL)characterIsMember: (unichar)c { return FcCharSetHasChar(_charset, c); } - (BOOL)longCharacterIsMember: (UTF32Char)c { return FcCharSetHasChar(_charset, c); } // FIXME: Implement for better performance //- (NSData *)bitmapRepresentation //{ //} @end gnustep-back-0.29.0/Source/fontconfig/FCFontInfo.m000066400000000000000000000077741404163720200217100ustar00rootroot00000000000000/* FCFontInfo.m Copyright (C) 2003 Free Software Foundation, Inc. August 31, 2003 Written by Banlu Kemiyatorn Base on original code of Alex Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GNUstepBase/Unicode.h" #include #include #include "fontconfig/FCFontInfo.h" #include "fontconfig/FCFontEnumerator.h" #include @implementation FCFontInfo - (void) setCacheSize: (unsigned int)size { _cacheSize = size; if (_cachedSizes) { free(_cachedSizes); } if (_cachedGlyphs) { free(_cachedGlyphs); } _cachedSizes = malloc(sizeof(NSSize) * size); if (_cachedSizes) { memset(_cachedSizes, 0, sizeof(NSSize) * size); } _cachedGlyphs = malloc(sizeof(unsigned int) * size); if (_cachedGlyphs) { memset(_cachedGlyphs, 0, sizeof(unsigned int) * size); } } - (BOOL) setupAttributes { ASSIGN(_faceInfo, [FCFontEnumerator fontWithName: fontName]); if (!_faceInfo) { return NO; } // check for font specific cache size from face info [self setCacheSize: [_faceInfo cacheSize]]; /* setting GSFontInfo: * weight, traits, familyName, * mostCompatibleStringEncoding, encodingScheme, coveredCharacterSet */ weight = [_faceInfo weight]; traits = [_faceInfo traits]; familyName = [[_faceInfo familyName] copy]; mostCompatibleStringEncoding = NSUTF8StringEncoding; encodingScheme = @"iso10646-1"; coveredCharacterSet = [[_faceInfo characterSet] retain]; return YES; } - (id) initWithFontName: (NSString *)name matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont { self = [super init]; if (!self) return nil; _screenFont = p_screenFont; fontName = [name copy]; memcpy(matrix, fmatrix, sizeof(matrix)); if (_screenFont) { /* Round up; makes the text more legible. */ matrix[0] = ceil(matrix[0]); if (matrix[3] < 0.0) matrix[3] = floor(matrix[3]); else matrix[3] = ceil(matrix[3]); } if (![self setupAttributes]) { RELEASE(self); return nil; } return self; } - (void) dealloc { RELEASE(_faceInfo); if (_cachedSizes) free(_cachedSizes); if (_cachedGlyphs) free(_cachedGlyphs); [super dealloc]; } - (CGFloat) defaultLineHeightForFont { return lineHeight; } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { [self subclassResponsibility: _cmd]; return YES; } - (NSSize) advancementForGlyph: (NSGlyph)glyph { [self subclassResponsibility: _cmd]; return NSZeroSize; } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { [self subclassResponsibility: _cmd]; return NSZeroRect; } - (NSString *) displayName { return [_faceInfo displayName]; } - (CGFloat) widthOfString: (NSString *)string { [self subclassResponsibility: _cmd]; return 0.0; } - (NSGlyph) glyphWithName: (NSString *) glyphName { /* subclass should override */ /* terrible! FIXME */ NSGlyph g = [glyphName cString][0]; return g; } - (void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs count: (int)length toBezierPath: (NSBezierPath *)path { [self subclassResponsibility: _cmd]; } @end gnustep-back-0.29.0/Source/gsc/000077500000000000000000000000001404163720200162005ustar00rootroot00000000000000gnustep-back-0.29.0/Source/gsc/.cvsignore000066400000000000000000000000171404163720200201760ustar00rootroot00000000000000Resources *obj gnustep-back-0.29.0/Source/gsc/GNUmakefile000066400000000000000000000027011404163720200202520ustar00rootroot00000000000000# # Main makefile for GNUstep Backend generic contexts/gstates # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make SUBPROJECT_NAME=gsc # The Objective-C source files to be compiled gsc_OBJC_FILES = \ GSContext.m \ GSGState.m \ GSStreamContext.m \ GSStreamGState.m \ GSFunction.m \ externs.m gsc_C_FILES = gscolors.c -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/gsc/GNUmakefile.preamble000066400000000000000000000031041404163720200220360ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler #ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../Headers -I../$(GNUSTEP_TARGET_DIR) # Additional LDFLAGS to pass to the linker #ADDITIONAL_LDFLAGS = # Additional library directories the linker should search #ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/gsc/GSContext.m000066400000000000000000000647751404163720200202570ustar00rootroot00000000000000/* -*- mode:ObjC -*- GSContext - Generic drawing context for non-PS backends Copyright (C) 1998,1999 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gsc/GSContext.h" #include "gsc/GSStreamContext.h" #include "gsc/GSGState.h" #include "math.h" #define GSI_ARRAY_TYPES GSUNION_OBJ #if GS_WITH_GC == 0 #define GSI_ARRAY_RELEASE(A, X) [(X).obj release] #define GSI_ARRAY_RETAIN(A, X) [(X).obj retain] #else #define GSI_ARRAY_RELEASE(A, X) #define GSI_ARRAY_RETAIN(A, X) (X).obj #endif #ifdef GSIArray #undef GSIArray #endif #include /* Error macros */ #define CHECK_NULL_OUTPUT(outvar) \ do { if (outvar == NULL) {\ DPS_ERROR(DPSnulloutput, @"NULL output variable specified"); \ return; } } while (0) #define CHECK_INVALID_FONT(ident) \ do { if (ident >= [fontid count]) { \ DPS_ERROR(DPSinvalidfont, @"Cannot find indicated font"); \ return; } } while (0) #define CHECK_STACK_UNDERFLOW(stack) \ do { if (GSIArrayCount((GSIArray)stack) == 0) { \ DPS_ERROR(DPSstackunderflow, @"Attempt to pop from empty stack"); \ return; } } while (0) #if 0 #define CHECK_TYPECHECK(obj, kind) \ do { if ([kind class] != Nil && !GSObjCIsKindOf(GSObjCClass(obj), [kind class])) {\ DPS_ERROR(DPStypecheck, @"Invalid object"); \ return; } } while (0) #else #define CHECK_TYPECHECK(obj,kind) #endif #define ctxt_pop(object, stack, kind) \ do { \ CHECK_STACK_UNDERFLOW(stack); \ object = (GSIArrayLastItem((GSIArray)stack)).obj; \ CHECK_TYPECHECK(object, kind); \ AUTORELEASE(RETAIN(object)); \ GSIArrayRemoveLastItem((GSIArray)stack); \ } while (0) #define ctxt_push(object, stack) \ GSIArrayAddItem((GSIArray)stack, (GSIArrayItem)((id)object)) /* Globally unique gstate number */ static unsigned int unique_index = 0; static NSMapTable *gtable; @interface GSContext (PrivateOps) - (void)DPSdefineuserobject; - (void)DPSexecuserobject: (NSInteger)index; - (void)DPSundefineuserobject: (NSInteger)index; - (void)DPSclear; - (void)DPScopy: (int)n; - (void)DPScount: (int *)n; - (void)DPSdup; - (void)DPSexch; - (void)DPSindex: (int)i; - (void)DPSpop; @end @interface NSBitmapImageRep (GSPrivate) - (NSBitmapImageRep *) _convertToFormatBitsPerSample: (NSInteger)bps samplesPerPixel: (NSInteger)spp hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString*)colorSpaceName bitmapFormat: (NSBitmapFormat)bitmapFormat bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits; @end /** GSContext

This class is a reasonable attempt at providing PostScript-like drawing operations. Don't even begin to think that this is a full PostScript implementation, however. Only operations that do not require stack handling are implemented. Some other functions that would require stack handling and are needed for drawing are implemented in a different way (e.g. colorspace and images). These functions should also allow for a reasonable simulation of Quartz functionality.

*/ @implementation GSContext + (void) initialize { if (self == [GSContext class]) { gtable = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 20); } } + (void) insertObject: (id)obj forKey: (int)index { NSMapInsert(gtable, (void *)(uintptr_t)index, obj); } + (id) getObjectForKey: (int)index { return NSMapGet(gtable, (void *)(uintptr_t)index); } + (void) removeObjectForKey: (int)index { NSMapRemove(gtable, (void *)(uintptr_t)index); } + (Class) GStateClass { return [GSGState class]; } + (BOOL) handlesPS { return NO; } - (id) initWithContextInfo: (NSDictionary *)info { NSString *contextType; NSZone *z = [self zone]; contextType = [info objectForKey: NSGraphicsContextRepresentationFormatAttributeName]; if (([object_getClass(self) handlesPS] == NO) && contextType && [contextType isEqual: NSGraphicsContextPSFormat]) { /* Don't call self, since we aren't initialized */ [super dealloc]; return [[GSStreamContext allocWithZone: z] initWithContextInfo: info]; } self = [super initWithContextInfo: info]; if (self != nil) { id dest; /* Initialize lists and stacks */ opstack = NSZoneMalloc(z, sizeof(GSIArray_t)); GSIArrayInitWithZoneAndCapacity((GSIArray)opstack, z, 2); gstack = NSZoneMalloc(z, sizeof(GSIArray_t)); GSIArrayInitWithZoneAndCapacity((GSIArray)gstack, z, 2); /* Create a default gstate */ gstate = [[[object_getClass(self) GStateClass] allocWithZone: z] initWithDrawContext: self]; // Set some default values [self setShouldAntialias: YES]; [self setImageInterpolation: NSImageInterpolationNone]; [self setPatternPhase: NSMakePoint(0.0, 0.0)]; [self setCompositingOperation: NSCompositeSourceOver]; // Special handling for window drawing dest = [info objectForKey: NSGraphicsContextDestinationAttributeName]; if ((dest != nil) && [dest isKindOfClass: [NSWindow class]]) { /* A context is only associated with one server. Do not retain the server, however */ server = GSCurrentServer(); [server setWindowdevice: [(NSWindow*)dest windowNumber] forContext: self]; } } return self; } /** Closes all backend resources and dealloc other ivars. */ - (void) dealloc { NSDebugLog(@"Destroying GS Context"); GSIArrayEmpty((GSIArray)opstack); NSZoneFree([self zone], opstack); GSIArrayEmpty((GSIArray)gstack); NSZoneFree([self zone], gstack); DESTROY(gstate); [super dealloc]; } /** Returns YES, since this is a display context. */ - (BOOL)isDrawingToScreen { return YES; } /** Returns the current GSGState object */ - (GSGState *) currentGState { return gstate; } - (void) setShouldAntialias: (BOOL)antialias { [gstate setShouldAntialias: antialias]; } - (BOOL) shouldAntialias { return [gstate shouldAntialias]; } - (NSPoint) patternPhase { return [gstate patternPhase]; } - (void) setPatternPhase: (NSPoint)phase { [gstate setPatternPhase: phase]; } - (NSCompositingOperation) compositingOperation { return [gstate compositingOperation]; } - (void) setCompositingOperation: (NSCompositingOperation)operation { [gstate setCompositingOperation: operation]; } @end @implementation GSContext (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentalpha: (CGFloat *)a { [gstate DPScurrentalpha: a]; } - (void) DPScurrentcmykcolor: (CGFloat*)c : (CGFloat*)m : (CGFloat*)y : (CGFloat*)k { [gstate DPScurrentcmykcolor:c :m :y :k]; } - (void) DPScurrentgray: (CGFloat*)gray { CHECK_NULL_OUTPUT(gray); [gstate DPScurrentgray: gray]; } - (void) DPScurrenthsbcolor: (CGFloat*)h : (CGFloat*)s : (CGFloat*)b { CHECK_NULL_OUTPUT(h); CHECK_NULL_OUTPUT(s); CHECK_NULL_OUTPUT(b); [gstate DPScurrenthsbcolor:h :s :b]; } - (void) DPScurrentrgbcolor: (CGFloat*)r : (CGFloat*)g : (CGFloat*)b { CHECK_NULL_OUTPUT(r); CHECK_NULL_OUTPUT(g); CHECK_NULL_OUTPUT(b); [gstate DPScurrentrgbcolor:r :g :b]; } - (void) DPSsetalpha: (CGFloat)a { [gstate DPSsetalpha: a]; } - (void) DPSsetcmykcolor: (CGFloat)c : (CGFloat)m : (CGFloat)y : (CGFloat)k { [gstate DPSsetcmykcolor:c :m :y :k]; } - (void) DPSsetgray: (CGFloat)gray { [gstate DPSsetgray: gray]; } - (void) DPSsethsbcolor: (CGFloat)h : (CGFloat)s : (CGFloat)b { [gstate DPSsethsbcolor:h :s :b]; } - (void) DPSsetrgbcolor: (CGFloat)r : (CGFloat)g : (CGFloat)b { [gstate DPSsetrgbcolor:r :g :b]; } - (void) GSSetPatterColor: (NSImage*)image { [gstate GSSetPatterColor: image]; } - (void) GSSetFillColorspace: (void *)spaceref { [gstate GSSetFillColorspace: spaceref]; } - (void) GSSetStrokeColorspace: (void *)spaceref { [gstate GSSetStrokeColorspace: spaceref]; } - (void) GSSetFillColor: (const CGFloat *)values { [gstate GSSetFillColor: values]; } - (void) GSSetStrokeColor: (const CGFloat *)values { [gstate GSSetStrokeColor: values]; } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ - (void) DPSashow: (CGFloat)x : (CGFloat)y : (const char *)s { [gstate DPSashow: x : y : s]; } - (void) DPSawidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (CGFloat)ax : (CGFloat)ay : (const char *)s { [gstate DPSawidthshow: cx : cy : c : ax : ay : s]; } - (void) DPScharpath: (const char *)s : (int)b { [gstate DPScharpath: s : b]; } - (void) appendBezierPathWithPackedGlyphs: (const char *)packedGlyphs path: (NSBezierPath*)aPath { [gstate appendBezierPathWithPackedGlyphs: packedGlyphs path: aPath]; } - (void) DPSshow: (const char *)s { [gstate DPSshow: s]; } - (void) DPSwidthshow: (CGFloat)x : (CGFloat)y : (int)c : (const char *)s { [gstate DPSwidthshow: x : y : c : s]; } - (void) DPSxshow: (const char *)s : (const CGFloat*)numarray : (int)size { [gstate DPSxshow: s : numarray : size]; } - (void) DPSxyshow: (const char *)s : (const CGFloat*)numarray : (int)size { [gstate DPSxyshow: s : numarray : size]; } - (void) DPSyshow: (const char *)s : (const CGFloat*)numarray : (int)size { [gstate DPSyshow: s : numarray : size]; } - (void) GSSetCharacterSpacing: (CGFloat)extra { [gstate GSSetCharacterSpacing: extra]; } - (void) GSSetFont: (void *)fontref { [gstate GSSetFont: fontref]; } - (void) GSSetFontSize: (CGFloat)size { [gstate GSSetFontSize: size]; } - (NSAffineTransform *) GSGetTextCTM { return [gstate GSGetTextCTM]; } - (NSPoint) GSGetTextPosition { return [gstate GSGetTextPosition]; } - (void) GSSetTextCTM: (NSAffineTransform *)ctm { [gstate GSSetTextCTM: ctm]; } - (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode { [gstate GSSetTextDrawingMode: mode]; } - (void) GSSetTextPosition: (NSPoint)loc { [gstate GSSetTextPosition: loc]; } - (void) GSShowText: (const char *)string : (size_t) length { [gstate GSShowText: string : length]; } - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length { [gstate GSShowGlyphs: glyphs : length]; } - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { [gstate GSShowGlyphsWithAdvances: glyphs : advances : length]; } /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ - (void) DPSgrestore { if (GSIArrayCount((GSIArray)gstack) == 0) return; RELEASE(gstate); gstate = (GSIArrayLastItem((GSIArray)gstack)).obj; ctxt_pop(gstate, gstack, GSGState); RETAIN(gstate); } - (void) DPSgsave { ctxt_push(gstate, gstack); AUTORELEASE(gstate); gstate = [gstate copy]; } - (void) DPSinitgraphics { [gstate DPSinitgraphics]; } - (void) DPSsetgstate: (NSInteger)gst { if (gst) { [self DPSexecuserobject: gst]; RELEASE(gstate); ctxt_pop(gstate, opstack, GSGState); gstate = [gstate copy]; } else DESTROY(gstate); } - (NSInteger) GSDefineGState { if (gstate == nil) { DPS_ERROR(DPSundefined, @"No gstate"); return 0; } [object_getClass(self) insertObject: AUTORELEASE([gstate copy]) forKey: ++unique_index]; return unique_index; } - (void) GSUndefineGState: (NSInteger)gst { [self DPSundefineuserobject: gst]; } - (void) GSReplaceGState: (NSInteger)gst { if (gst <= 0) return; [object_getClass(self) insertObject: AUTORELEASE([gstate copy]) forKey: gst]; } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentflat: (CGFloat*)flatness { CHECK_NULL_OUTPUT(flatness); [gstate DPScurrentflat: flatness]; } - (void) DPScurrentlinecap: (int*)linecap { [gstate DPScurrentlinecap: linecap]; } - (void) DPScurrentlinejoin: (int*)linejoin { [gstate DPScurrentlinejoin: linejoin]; } - (void) DPScurrentlinewidth: (CGFloat*)width { [gstate DPScurrentlinewidth: width]; } - (void) DPScurrentmiterlimit: (CGFloat*)limit { CHECK_NULL_OUTPUT(limit); [gstate DPScurrentmiterlimit: limit]; } - (void) DPScurrentpoint: (CGFloat*)x : (CGFloat*)y { CHECK_NULL_OUTPUT(x); CHECK_NULL_OUTPUT(y); [gstate DPScurrentpoint:x :y]; } - (void) DPScurrentstrokeadjust: (int*)b { CHECK_NULL_OUTPUT(b); [gstate DPScurrentstrokeadjust: b]; } - (void) DPSsetdash: (const CGFloat*)pat : (NSInteger)size : (CGFloat)offset { [gstate DPSsetdash: pat : size : offset]; } - (void) DPSsetflat: (CGFloat)flatness { [gstate DPSsetflat: flatness]; } - (void) DPSsethalftonephase: (CGFloat)x : (CGFloat)y { [self notImplemented: _cmd]; } - (void) DPSsetlinecap: (int)linecap { [gstate DPSsetlinecap: linecap]; } - (void) DPSsetlinejoin: (int)linejoin { [gstate DPSsetlinejoin: linejoin]; } - (void) DPSsetlinewidth: (CGFloat)width { [gstate DPSsetlinewidth: width]; } - (void) DPSsetmiterlimit: (CGFloat)limit { [gstate DPSsetmiterlimit: limit]; } - (void) DPSsetstrokeadjust: (int)b { [gstate DPSsetstrokeadjust: b]; } /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ - (void) DPSconcat: (const CGFloat*)m { [gstate DPSconcat: m]; } - (void) DPSinitmatrix { [gstate DPSinitmatrix]; } - (void) DPSrotate: (CGFloat)angle { [gstate DPSrotate: angle]; } - (void) DPSscale: (CGFloat)x : (CGFloat)y { [gstate DPSscale:x :y]; } - (void) DPStranslate: (CGFloat)x : (CGFloat)y { [gstate DPStranslate:x :y]; } - (NSAffineTransform *) GSCurrentCTM { return [gstate GSCurrentCTM]; } - (void) GSSetCTM: (NSAffineTransform *)ctm { [gstate GSSetCTM: ctm]; } - (void) GSConcatCTM: (NSAffineTransform *)ctm { [gstate GSConcatCTM: ctm]; } /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ - (void) DPSarc: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { [gstate DPSarc: x : y : r : angle1 : angle2]; } - (void) DPSarcn: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { [gstate DPSarcn: x : y : r : angle1 : angle2]; } - (void) DPSarct: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)r; { [gstate DPSarct: x1 : y1 : x2 : y2 : r]; } - (void) DPSclip { [gstate DPSclip]; } - (void) DPSclosepath { [gstate DPSclosepath]; } - (void) DPScurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { [gstate DPScurveto: x1 : y1 : x2 : y2 : x3 : y3]; } - (void) DPSeoclip { [gstate DPSeoclip]; } - (void) DPSeofill { [gstate DPSeofill]; } - (void) DPSfill { [gstate DPSfill]; } - (void) DPSflattenpath { [gstate DPSflattenpath]; } - (void) DPSinitclip { [gstate DPSinitclip]; } - (void) DPSlineto: (CGFloat)x : (CGFloat)y { [gstate DPSlineto: x : y]; } - (void) DPSmoveto: (CGFloat)x : (CGFloat)y { [gstate DPSmoveto: x : y]; } - (void) DPSnewpath { [gstate DPSnewpath]; } - (void) DPSpathbbox: (CGFloat*)llx : (CGFloat*)lly : (CGFloat*)urx : (CGFloat*)ury { [gstate DPSpathbbox: llx : lly : urx : ury]; } - (void) DPSrcurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { [gstate DPSrcurveto: x1 : y1 : x2 : y2 : x3 : y3]; } - (void) DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { [gstate DPSrectclip: x : y : w : h]; } - (void) DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { [gstate DPSrectfill:x :y :w :h]; } - (void) DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { [gstate DPSrectstroke:x :y :w :h]; } - (void) DPSreversepath { [gstate DPSreversepath]; } - (void) DPSrlineto: (CGFloat)x : (CGFloat)y { [gstate DPSrlineto: x : y]; } - (void) DPSrmoveto: (CGFloat)x : (CGFloat)y { [gstate DPSrmoveto: x : y]; } - (void) DPSstroke { [gstate DPSstroke]; } - (void) GSSendBezierPath: (NSBezierPath *)path { [gstate GSSendBezierPath: path]; } - (void) GSRectClipList: (const NSRect *)rects : (int) count { [gstate GSRectClipList: rects : count]; } - (void) GSRectFillList: (const NSRect *)rects : (int) count { [gstate GSRectFillList: rects : count]; } /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentoffset: (int *)x : (int *)y { if (x && y) { NSPoint offset = [gstate offset]; *x = offset.x; *y = offset.y; } } - (void) DPSsetoffset: (short int)x : (short int)y { [gstate setOffset: NSMakePoint(x,y)]; } /*-------------------------------------------------------------------------*/ /* Graphics Extension Ops */ /*-------------------------------------------------------------------------*/ - (void) DPScomposite: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (NSCompositingOperation)op { [self GScomposite: gstateNum toPoint: NSMakePoint(dx, dy) fromRect: NSMakeRect(x, y, w, h) operation: op fraction: 1.0]; } - (void) DPScompositerect: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSCompositingOperation)op { [gstate compositerect: NSMakeRect(x, y, w, h) op: op]; } - (void) DPSdissolve: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (CGFloat)delta { [self GScomposite: gstateNum toPoint: NSMakePoint(dx, dy) fromRect: NSMakeRect(x, y, w, h) operation: NSCompositeSourceOver fraction: delta]; } - (void) GScomposite: (NSInteger)gstateNum toPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { GSGState *g = gstate; if (gstateNum) { [self DPSexecuserobject: gstateNum]; ctxt_pop(g, opstack, GSGState); } [gstate compositeGState: g fromRect: srcRect toPoint: aPoint op: op fraction: delta]; } - (void) GSdraw: (NSInteger)gstateNum toPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { GSGState *g = gstate; if (gstateNum) { [self DPSexecuserobject: gstateNum]; ctxt_pop(g, opstack, GSGState); } [gstate drawGState: g fromRect: srcRect toPoint: aPoint op: op fraction: delta]; } - (BOOL) isCompatibleBitmap: (NSBitmapImageRep*)bitmap { return ([bitmap bitmapFormat] == 0); } - (void) GSDrawImage: (NSRect) rect : (void *) imageref { NSBitmapImageRep *bitmap; unsigned char *data[5]; bitmap = (NSBitmapImageRep*)imageref; if (![self isCompatibleBitmap: bitmap]) { NSInteger bitsPerSample = 8; BOOL isPlanar = NO; NSInteger samplesPerPixel = [bitmap hasAlpha] ? 4 : 3; NSString *colorSpaceName = NSCalibratedRGBColorSpace; NSBitmapImageRep *new; new = [bitmap _convertToFormatBitsPerSample: bitsPerSample samplesPerPixel: samplesPerPixel hasAlpha: [bitmap hasAlpha] isPlanar: isPlanar colorSpaceName: colorSpaceName bitmapFormat: 0 bytesPerRow: 0 bitsPerPixel: 0]; if (new == nil) { NSLog(@"Could not convert bitmap data"); return; } bitmap = new; } [bitmap getBitmapDataPlanes: data]; [self NSDrawBitmap: rect : [bitmap pixelsWide] : [bitmap pixelsHigh] : [bitmap bitsPerSample] : [bitmap samplesPerPixel] : [bitmap bitsPerPixel] : [bitmap bytesPerRow] : [bitmap isPlanar] : [bitmap hasAlpha] : [bitmap colorSpaceName] : (const unsigned char**)data]; } /* ----------------------------------------------------------------------- */ /* Client functions */ /* ----------------------------------------------------------------------- */ - (void) DPSPrintf: (const char *)fmt : (va_list)args { /* Do nothing. We can't parse PostScript */ } - (void) DPSWriteData: (const char *)buf : (unsigned int)count { /* Do nothing. We can't parse PostScript */ } @end /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ @implementation GSContext (NSGraphics) - (NSDictionary *) GSReadRect: (NSRect)rect { return [gstate GSReadRect: rect]; } /* * Render Bitmap Images */ - (void) NSDrawBitmap: (NSRect) rect : (NSInteger) pixelsWide : (NSInteger) pixelsHigh : (NSInteger) bitsPerSample : (NSInteger) samplesPerPixel : (NSInteger) bitsPerPixel : (NSInteger) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data { NSAffineTransform *trans; NSSize scale; // Compute the transformation matrix scale = NSMakeSize(NSWidth(rect) / pixelsWide, NSHeight(rect) / pixelsHigh); trans = [NSAffineTransform transform]; [trans translateToPoint: rect.origin]; [trans scaleXBy: scale.width yBy: scale.height]; /* This does essentially what the DPS...image operators do, so as to avoid an extra method call */ [gstate DPSimage: trans : pixelsWide : pixelsHigh : bitsPerSample : samplesPerPixel : bitsPerPixel : bytesPerRow : isPlanar : hasAlpha : colorSpaceName : data]; } - (void) DPSshfill: (NSDictionary *)shader { [gstate DPSshfill: shader]; } - (void) GSWSetViewIsFlipped: (BOOL) flipped { if (gstate) gstate->viewIsFlipped = flipped; } /* ----------------------------------------------------------------------- */ /* Data operations - Obsolete but possibly still useful */ /* ----------------------------------------------------------------------- */ - (void)DPSdefineuserobject { int n; id obj; NSNumber *number; ctxt_pop(obj, opstack, NSObject); ctxt_pop(number, opstack, NSNumber); n = [number intValue]; if (n < 0) DPS_ERROR(DPSinvalidparam, @"Invalid userobject index"); else [object_getClass(self) insertObject: obj forKey: n]; } - (void)DPSexecuserobject: (NSInteger)index { id obj; if (index < 0 || (obj = [object_getClass(self) getObjectForKey: index]) == nil) { DPS_ERROR(DPSinvalidparam, @"Invalid userobject index"); return; } ctxt_push(obj, opstack); } - (void)DPSundefineuserobject: (NSInteger)index { if (index < 0 || [object_getClass(self) getObjectForKey: index] == nil) { DPS_ERROR(DPSinvalidparam, @"Invalid gstate index"); return; } [object_getClass(self) removeObjectForKey: index]; } - (void)DPSclear { GSIArrayEmpty((GSIArray)opstack); GSIArrayInitWithZoneAndCapacity((GSIArray)opstack, [self zone], 2); } - (void)DPScopy: (int)n { unsigned count = GSIArrayCount((GSIArray)opstack); int i; for (i = 0; i < n; i++) { NSObject *obj = (GSIArrayItemAtIndex((GSIArray)opstack, count - n + i)).obj; ctxt_push(obj, opstack); } } - (void)DPScount: (int *)n { CHECK_NULL_OUTPUT(n); *n = GSIArrayCount((GSIArray)opstack); } - (void)DPSdup { NSObject *obj = (GSIArrayLastItem((GSIArray)opstack)).obj; ctxt_push(obj, opstack); } - (void)DPSexch { unsigned count = GSIArrayCount((GSIArray)opstack); if (count < 2) { DPS_ERROR(DPSstackunderflow, @"Attempt to exch in empty stack"); return; } GSIArrayInsertItem((GSIArray)opstack, GSIArrayLastItem((GSIArray)opstack), count-2); GSIArrayRemoveLastItem((GSIArray)opstack); } - (void)DPSindex: (int)i { unsigned count = GSIArrayCount((GSIArray)opstack); NSObject *obj = (GSIArrayItemAtIndex((GSIArray)opstack, count - i)).obj; ctxt_push(obj, opstack); } - (void)DPSpop { id obj; ctxt_pop(obj, opstack, NSObject); } @end @implementation GSContext (NSGradient) - (void) drawGradient: (NSGradient*)gradient fromCenter: (NSPoint)startCenter radius: (CGFloat)startRadius toCenter: (NSPoint)endCenter radius: (CGFloat)endRadius options: (NSUInteger)options { [gstate drawGradient: gradient fromCenter: startCenter radius: startRadius toCenter: endCenter radius: endRadius options: options]; } - (void) drawGradient: (NSGradient*)gradient fromPoint: (NSPoint)startPoint toPoint: (NSPoint)endPoint options: (NSUInteger)options { [gstate drawGradient: gradient fromPoint: startPoint toPoint: endPoint options: options]; } @end gnustep-back-0.29.0/Source/gsc/GSFunction.m000066400000000000000000000226551404163720200204070ustar00rootroot00000000000000/* GSFunction - Function for GSGState Copyright (C) 2003 Free Software Foundation, Inc. Author: Alexander Malmberg Author: Fred Kiefer Extracted into separate class. This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // for floor #include #include #include #include #include #include #include "gsc/GSFunction.h" @implementation GSFunction - (id) initWith: (NSDictionary *)d { NSNumber * v = [d objectForKey: @"FunctionType"]; NSArray *a; NSData *data; int i, j; if ([v intValue] != 0) { NSDebugLLog(@"GSFunction", @"FunctionType != 0 not supported."); RELEASE(self); return nil; } bits_per_sample = [[d objectForKey: @"BitsPerSample"] intValue]; if (!(bits_per_sample == 8 || bits_per_sample == 16)) { NSDebugLLog(@"GSFunction", @"BitsPerSample other than 8 or 16 aren't supported."); RELEASE(self); return nil; } data = [d objectForKey: @"DataSource"]; if (!data || ![data isKindOfClass: [NSData class]]) { NSDebugLLog(@"GSFunction", @"No valid DataSource given."); RELEASE(self); return nil; } data_source =[data bytes]; a = [d objectForKey: @"Size"]; num_in = [a count]; if (!num_in) { NSDebugLLog(@"GSFunction", @"Size has no entries."); RELEASE(self); return nil; } num_out = [[d objectForKey: @"Range"] count] / 2; if (!num_out) { NSDebugLLog(@"GSFunction", @"Range has no entries."); RELEASE(self); return nil; } size = malloc(sizeof(int) * num_in); domain = malloc(sizeof(double) * num_in * 2); range = malloc(sizeof(double) * num_out * 2); encode = malloc(sizeof(double) * num_in * 2); decode = malloc(sizeof(double) * num_out * 2); if (!size || !domain || !range || !encode || !decode) { NSDebugLLog(@"GSFunction", @"Memory allocation failed."); RELEASE(self); return nil; } j = 1; for (i = 0; i < num_in; i++) { size[i] = [[a objectAtIndex: i] intValue]; j *= size[i]; } j *= bits_per_sample * num_out; j = (j +7)/8; if ([data length] < j) { NSDebugLLog(@"GSFunction", @"Need %i bytes of data, DataSource only has %lu bytes.", j, (unsigned long)[data length]); RELEASE(self); return nil; } a = [d objectForKey: @"Domain"]; for (i = 0; i < num_in * 2; i++) { domain[i] = [[a objectAtIndex: i] doubleValue]; } a = [d objectForKey: @"Range"]; for (i = 0; i < num_out * 2; i++) { range[i] = [[a objectAtIndex: i] doubleValue]; } a = [d objectForKey: @"Decode"]; if (a) { for (i = 0; i < num_out * 2; i++) { decode[i] = [[a objectAtIndex: i] doubleValue]; } } else { for (i = 0; i < num_out * 2; i++) { decode[i] = range[i]; } } a = [d objectForKey: @"Encode"]; if (a) { for (i = 0; i < num_in * 2; i++) { encode[i] = [[a objectAtIndex: i] doubleValue]; } } else { for (i = 0; i < num_in; i++) { encode[i * 2 + 0] = 0; encode[i * 2 + 1] = size[i] - 1; } } return self; } - (void)dealloc { if (size) free(size); if (domain) free(domain); if (range) free(range); if (encode) free(encode); if (decode) free(decode); [super dealloc]; } - (double)getsample: (int)sample : (int) i { double v; if (bits_per_sample == 8) { v = data_source[sample * num_out + i] / 255.0; } else if (bits_per_sample == 16) { int c0, c1; c0 = data_source[(sample * num_out + i) * 2 + 0]; c1 = data_source[(sample * num_out + i) * 2 + 1]; v = (c0 * 256 + c1) / 65535.0; } else { NSLog(@"unhandled bits per sample %i", bits_per_sample); v = 0.0; } v = decode[i * 2] + v * (decode[i * 2 + 1] - decode[i * 2]); if (v < range[i * 2]) v = range[i * 2]; if (v > range[i * 2 + 1]) v = range[i * 2 + 1]; return v; } - (void) eval: (double *)inValues : (double *)outValues; { double in[num_in]; int sample[num_in]; int i, j, sample_index, sample_factor; unsigned int u, v; double c; for (i = 0; i < num_in; i++) { in[i] =(inValues[i] - domain[i * 2]) / (domain[i * 2 + 1] - domain[i * 2]); if (in[i] < 0.0) in[i] = 0.0; if (in[i] > 1.0) in[i] = 1.0; in[i] = encode[i * 2] + in[i] * (encode[i * 2 + 1] - encode[i * 2]); sample[i] = floor(in[i]); /* we only want sample[i] == size[i] -1 when size[i] == 1 */ if (sample[i] >= size[i]-1) sample[i] = size[i]-2; if (sample[i] < 0) sample[i] = 0; in[i] = in[i] - sample[i]; if (in[i] < 0.0) in[i] = 0.0; if (in[i] > 1.0) in[i] = 1.0; // printf(" coord %i, sample %i, frac %g \n", i, sample[i], in[i]); } for (i = 0; i < num_out; i++) { double out_value; /* iterate over all corners in the num_in-dimensional hypercube we're in */ out_value = 0.0; for (u = 0; u < (1 << num_in); u++) { sample_index = 0; sample_factor = 1; c = 1; for (v = 1, j = 0; j < num_in; j ++, v <<= 1) { sample_index += sample[j] * sample_factor; if (u & v) { c *= in[j]; sample_index += sample_factor; } else { c *= (1.0 - in[j]); } sample_factor *= size[j]; if (c == 0.0) break; } // printf(" %08x index %i, factor %i, c =%g \n", u, sample_index, sample_factor, c); if (c > 0.0) out_value += c * [self getsample: sample_index : i]; } // printf(" final =%g \n", out_value); outValues[i] = out_value; } } @end @implementation GSFunction2in3out - (id) initWith: (NSDictionary *)d { if (!(self = [super initWith: d])) return nil; if (num_in != 2 || num_out != 3) { NSDebugLLog(@"GSFunction", @"Function doesn't have 2 inputs and 3 outputs."); RELEASE(self); return nil; } sample_index[0] = sample_index[1] = -1; return self; } /* special case: f->num_in == 2, f->num_out == 3 */ - (void) eval: (double *)inValues : (double *)outValues; { double in[2]; int sample[2]; int i; for (i = 0; i < 2; i ++) { in[i] = (inValues[i] - domain[i * 2]) / (domain[i * 2 + 1] - domain[i * 2]); if (in[i] < 0.0) in[i] = 0.0; if (in[i] > 1.0) in[i] = 1.0; in[i] = encode[i * 2]+in[i]* (encode[i * 2 + 1] - encode[i * 2]); sample[i] = floor(in[i]); /* we only want sample[i] == size[i]-1 when size[i] == 1 */ if (sample[i] >= size[i]-1) sample[i] = size[i]-2; if (sample[i] < 0) sample[i] = 0; in[i] = in[i] - sample[i]; if (in[i] < 0.0) in[i] = 0.0; if (in[i] > 1.0) in[i] = 1.0; // printf(" coord %i, sample %i, frac %g \n", i, sample[i], in[i]); } if (sample[0] != sample_index[0] || sample[1] != sample_index[1]) { sample_index[0] = sample[0]; sample_index[1] = sample[1]; for (i = 0; i < 3; i ++) { sample_cache[0][i] = [self getsample: sample[0] + sample[1] * size[0] : i]; if (sample[0] + 1 < size[0]) sample_cache[1][i] = [self getsample: sample[0] + 1 + sample[1] * size[0] : i]; if (sample[1] + 1 < size[1]) sample_cache[2][i] = [self getsample: sample[0] + (sample[1] + 1) * size[0] : i]; if (sample[0] + 1 < size[0] && sample[1] + 1 < size[1]) sample_cache[3][i] = [self getsample: sample[0] + 1 +(sample[1] + 1) * size[0] : i]; } } for (i = 0; i < 3; i++) { double out_value; double A, B, C, D; double p, q, pq; A = sample_cache[0][i]; B = sample_cache[1][i]; C = sample_cache[2][i]; D = sample_cache[3][i]; out_value = 0.0; p = in[0]; q = in[1]; pq = p * q; if (p != 1.0 && q != 1.0) out_value += A * (1 - p -q + pq); if (p != 0.0 && q != 1.0) out_value += B * (p - pq); if (p != 1.0 && q != 0.0) out_value += C * (q - pq); if (p != 0.0 && q != 0.0) out_value += D * pq; outValues[i] = out_value; } } - (NSRect) affectedRect { NSRect rect; rect.origin.x = domain[0]; rect.size.width = domain[1] - domain[0]; rect.origin.y = domain[2]; rect.size.height = domain[3] - domain[2]; return rect; } @end gnustep-back-0.29.0/Source/gsc/GSGState.m000066400000000000000000001016241404163720200200030ustar00rootroot00000000000000/* GSGState - Generic graphic state Copyright (C) 1998-2010 Free Software Foundation, Inc. Written by: Adam Fedor Date: Mar 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import #import #import #import #import "gsc/GSContext.h" #import "gsc/GSGState.h" #import "gsc/GSFunction.h" #include "math.h" #import #define CHECK_PATH \ if (!path) \ { \ path = [NSBezierPath new]; \ } @implementation GSGState /* Designated initializer. */ - initWithDrawContext: (GSContext *)drawContext { self = [super init]; if (!self) return nil; drawcontext = drawContext; offset = NSMakePoint(0, 0); path = nil; font = nil; fillColorS = nil; strokeColorS = nil; [self DPSinitgraphics]; return self; } - (void) dealloc { TEST_RELEASE(font); TEST_RELEASE(path); RELEASE(ctm); RELEASE(textCtm); RELEASE(fillColorS); RELEASE(strokeColorS); TEST_RELEASE(pattern); [super dealloc]; } - (id) deepen { NSZone *zone = [self zone]; if (path) self->path = [path copyWithZone: zone]; self->ctm = [ctm copyWithZone: zone]; self->textCtm = [textCtm copyWithZone: zone]; // Just retain the other objects if (font != nil) RETAIN(font); if (fillColorS != nil) RETAIN(fillColorS); if (strokeColorS != nil) RETAIN(strokeColorS); if (pattern != nil) RETAIN(pattern); return self; } - (NSString*) description { NSMutableString *description = [[super description] mutableCopy]; [description appendFormat: @" drawcontext: %@",drawcontext]; [description appendFormat: @" ctm: %@",ctm]; return [description copy]; } - (id)copyWithZone: (NSZone *)zone { GSGState *new = (GSGState *)NSCopyObject(self, 0, zone); /* Do a deep copy since gstates are isolated from each other */ return [new deepen]; } - (void) setOffset: (NSPoint)theOffset { offset = theOffset; } - (NSPoint) offset { return offset; } /** Subclasses should override this method to be notified of changes in the current color */ - (void) setColor: (device_color_t *)color state: (color_state_t)cState { if ((cState & COLOR_FILL) && (&fillColor != color)) { fillColor = *color; } if ((cState & COLOR_STROKE) && (&strokeColor != color)) { strokeColor = *color; } cstate = cState; DESTROY(pattern); } - (void) GSSetPatterColor: (NSImage*)image { ASSIGN(pattern, image); } - (void) setShouldAntialias: (BOOL)antialias { _antialias = antialias; } - (BOOL) shouldAntialias { return _antialias; } - (NSPoint) patternPhase { return _patternPhase; } - (void) setPatternPhase: (NSPoint)phase { _patternPhase = phase; } - (NSCompositingOperation) compositingOperation { return _compositingOperation; } - (void) setCompositingOperation: (NSCompositingOperation)operation { _compositingOperation = operation; } // This is only a fall back, the method should not be called any more. - (void) compositeGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op { [self compositeGState: source fromRect: aRect toPoint: aPoint op: op fraction: 1.0]; } // This is only a fall back, the method should not be called any more. - (void) dissolveGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint delta: (CGFloat)delta { [self compositeGState: source fromRect: aRect toPoint: aPoint op: NSCompositeSourceOver fraction: delta]; } - (void) compositeGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { [self subclassResponsibility: _cmd]; } - (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op { [self subclassResponsibility: _cmd]; } - (NSPoint) pointInMatrixSpace: (NSPoint)aPoint { return [ctm transformPoint: aPoint]; } - (NSPoint) deltaPointInMatrixSpace: (NSPoint)aPoint { return [ctm deltaPointInMatrixSpace: aPoint]; } - (NSRect) rectInMatrixSpace: (NSRect)rect { return [ctm rectInMatrixSpace: rect]; } @end @implementation GSGState (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentalpha: (CGFloat*)a { *a = fillColor.field[AINDEX]; } - (void) DPScurrentcmykcolor: (CGFloat*)c : (CGFloat*)m : (CGFloat*)y : (CGFloat*)k { device_color_t new = fillColor; gsColorToCMYK(&new); *c = new.field[0]; *m = new.field[1]; *y = new.field[2]; *k = new.field[3]; } - (void) DPScurrentgray: (CGFloat*)gray { device_color_t gcolor = fillColor; gsColorToGray(&gcolor); *gray = gcolor.field[0]; } - (void) DPScurrenthsbcolor: (CGFloat*)h : (CGFloat*)s : (CGFloat*)b { device_color_t gcolor = fillColor; gsColorToHSB(&gcolor); *h = gcolor.field[0]; *s = gcolor.field[1]; *b = gcolor.field[2]; } - (void) DPScurrentrgbcolor: (CGFloat*)r : (CGFloat*)g : (CGFloat*)b { device_color_t gcolor = fillColor; gsColorToRGB(&gcolor); *r = gcolor.field[0]; *g = gcolor.field[1]; *b = gcolor.field[2]; } #define CLAMP(x) \ if (x < 0.0) x = 0.0; \ if (x > 1.0) x = 1.0; - (void) DPSsetalpha: (CGFloat)a { CLAMP(a) fillColor.field[AINDEX] = strokeColor.field[AINDEX] = a; [self setColor: &fillColor state: COLOR_FILL]; [self setColor: &strokeColor state: COLOR_STROKE]; } - (void) DPSsetcmykcolor: (CGFloat)c : (CGFloat)m : (CGFloat)y : (CGFloat)k { device_color_t col; CLAMP(c) CLAMP(m) CLAMP(y) CLAMP(k) gsMakeColor(&col, cmyk_colorspace, c, m, y, k); // Keep the old alpha value col.field[AINDEX] = fillColor.field[AINDEX]; [self setColor: &col state: COLOR_BOTH]; } - (void) DPSsetgray: (CGFloat)gray { device_color_t col; CLAMP(gray) gsMakeColor(&col, gray_colorspace, gray, 0, 0, 0); // Keep the old alpha value col.field[AINDEX] = fillColor.field[AINDEX]; [self setColor: &col state: COLOR_BOTH]; } - (void) DPSsethsbcolor: (CGFloat)h : (CGFloat)s : (CGFloat)b { device_color_t col; CLAMP(h) CLAMP(s) CLAMP(b) gsMakeColor(&col, hsb_colorspace, h, s, b, 0); // Keep the old alpha value col.field[AINDEX] = fillColor.field[AINDEX]; [self setColor: &col state: COLOR_BOTH]; } - (void) DPSsetrgbcolor: (CGFloat)r : (CGFloat)g : (CGFloat)b { device_color_t col; CLAMP(r) CLAMP(g) CLAMP(b) gsMakeColor(&col, rgb_colorspace, r, g, b, 0); // Keep the old alpha value col.field[AINDEX] = fillColor.field[AINDEX]; [self setColor: &col state: COLOR_BOTH]; } - (void) GSSetFillColorspace: (void *)spaceref { device_color_t col; ASSIGN(fillColorS, (NSColorSpace*)spaceref); gsMakeColor(&col, rgb_colorspace, 0, 0, 0, 0); // Keep the old alpha value col.field[AINDEX] = fillColor.field[AINDEX]; [self setColor: &col state: COLOR_FILL]; } - (void) GSSetStrokeColorspace: (void *)spaceref { device_color_t col; ASSIGN(strokeColorS, (NSColorSpace*)spaceref); gsMakeColor(&col, rgb_colorspace, 0, 0, 0, 0); // Keep the old alpha value col.field[AINDEX] = fillColor.field[AINDEX]; [self setColor: &col state: COLOR_STROKE]; } - (void) GSSetFillColor: (const CGFloat *)values { device_color_t dcolor; NSColor *color; if ((fillColorS == nil) || ((color = [NSColor colorWithColorSpace: fillColorS components: values count: [fillColorS numberOfColorComponents] + 1]) == nil) || ((color = [color colorUsingColorSpaceName: NSDeviceRGBColorSpace]) == nil)) { DPS_ERROR(DPSundefined, @"No fill colorspace defined, assume DeviceRGB"); gsMakeColor(&dcolor, rgb_colorspace, values[0], values[1], values[2], values[3]); dcolor.field[AINDEX] = values[4]; } else { CGFloat r, g, b, a; [color getRed: &r green: &g blue: &b alpha: &a]; dcolor.space = rgb_colorspace; dcolor.field[0] = r; dcolor.field[1] = g; dcolor.field[2] = b; dcolor.field[AINDEX] = a; } [self setColor: &dcolor state: COLOR_FILL]; } - (void) GSSetStrokeColor: (const CGFloat *)values { device_color_t dcolor; NSColor *color; if ((strokeColorS == nil) || ((color = [NSColor colorWithColorSpace: strokeColorS components: values count: [strokeColorS numberOfColorComponents] + 1]) == nil) || ((color = [color colorUsingColorSpaceName: NSDeviceRGBColorSpace]) == nil)) { DPS_ERROR(DPSundefined, @"No stroke colorspace defined, assume DeviceRGB"); gsMakeColor(&dcolor, rgb_colorspace, values[0], values[1], values[2], values[3]); dcolor.field[AINDEX] = values[4]; } else { CGFloat r, g, b, a; [color getRed: &r green: &g blue: &b alpha: &a]; dcolor.space = rgb_colorspace; dcolor.field[0] = r; dcolor.field[1] = g; dcolor.field[2] = b; dcolor.field[AINDEX] = a; } [self setColor: &dcolor state: COLOR_STROKE]; } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ typedef enum { show_delta, show_array_x, show_array_y, show_array_xy } show_array_t; /* Omnibus show string routine that combines that characteristics of ashow, awidthshow, widthshow, xshow, xyshow, and yshow */ - (void) _showString: (const char *)s xCharAdj: (CGFloat)cx yCharAdj: (CGFloat)cy char: (char)c adjArray: (const CGFloat *)arr arrType: (show_array_t)type isRelative: (BOOL)relative; { NSPoint point = [path currentPoint]; unichar *uch; unsigned int ulen; int i; /* FIXME: We should use proper glyph generation here. */ uch = NULL; ulen = 0; GSToUnicode(&uch, &ulen, (const unsigned char*)s, strlen(s), [font mostCompatibleStringEncoding], NSDefaultMallocZone(), 0); for (i = 0; i < ulen; i++) { NSPoint delta; NSGlyph glyph; glyph = (NSGlyph)uch[i]; [self GSShowGlyphs: &glyph : 1]; /* Note we update the current point according to the current transformation scaling, although the text isn't currently scaled (FIXME). */ if (type == show_array_xy) { delta.x = arr[2*i]; delta.y = arr[2*i+1]; } else if (type == show_array_x) { delta.x = arr[i]; delta.y = 0; } else if (type == show_array_y) { delta.x = 0; delta.y = arr[i]; } else { delta.x = arr[0]; delta.y = arr[1]; } delta = [ctm deltaPointInMatrixSpace: delta]; if (relative == YES) { NSSize advancement; advancement = [font advancementForGlyph: glyph]; /* Use only delta transformations (no offset). Is this conversion needed?*/ advancement = [ctm transformSize: NSMakeSize(advancement.width, [font ascender])]; delta.x += advancement.width; delta.y += advancement.height; } if (c && *(s+i) == c) { NSPoint cdelta; cdelta.x = cx; cdelta.y = cy; cdelta = [ctm deltaPointInMatrixSpace: cdelta]; delta.x += cdelta.x; delta.y += cdelta.y; } point.x += delta.x; if (type != show_delta) { point.y += delta.y; } [path moveToPoint: point]; } free(uch); } - (void) DPSashow: (CGFloat)x : (CGFloat)y : (const char*)s { CGFloat arr[2]; arr[0] = x; arr[1] = y; [self _showString: s xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: arr arrType: show_delta isRelative: YES]; } - (void) DPSawidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (CGFloat)ax : (CGFloat)ay : (const char*)s { CGFloat arr[2]; arr[0] = ax; arr[1] = ay; [self _showString: s xCharAdj: cx yCharAdj: cy char: c adjArray: arr arrType: show_delta isRelative: YES]; } - (void) DPScharpath: (const char*)s : (int)count { NSGlyph glBuf[count]; int i; if (!font) return; // FIXME for (i = 0; i < count; i++) { glBuf[i] = [font glyphForCharacter: s[i]]; } CHECK_PATH; [font appendBezierPathWithGlyphs: glBuf count: count toBezierPath: path]; } - (void) appendBezierPathWithPackedGlyphs: (const char *)packedGlyphs path: (NSBezierPath*)aPath { unsigned int count = packedGlyphs[0]; NSMultibyteGlyphPacking packing; NSGlyph glBuf[count]; int i; int j; unsigned char a, b, c, d; if (!font) return; packing = [font glyphPacking]; j = 1; for (i = 0; i < count; i++) { switch (packing) { case NSOneByteGlyphPacking: glBuf[i] = (NSGlyph)packedGlyphs[j++]; break; case NSTwoByteGlyphPacking: a= packedGlyphs[j++]; glBuf[i] = (NSGlyph)((a << 8) | packedGlyphs[j++]); break; case NSFourByteGlyphPacking: a = packedGlyphs[j++]; b = packedGlyphs[j++]; c = packedGlyphs[j++]; d = packedGlyphs[j++]; glBuf[i] = (NSGlyph)((a << 24) | (b << 16) | (c << 8) | d); break; case NSJapaneseEUCGlyphPacking: case NSAsciiWithDoubleByteEUCGlyphPacking: default: // FIXME break; } } [font appendBezierPathWithGlyphs: glBuf count: count toBezierPath: aPath]; } - (void) DPSshow: (const char*)s { [self subclassResponsibility: _cmd]; } - (void) DPSwidthshow: (CGFloat)x : (CGFloat)y : (int)c : (const char*)s { CGFloat arr[2]; arr[0] = 0; arr[1] = 0; [self _showString: s xCharAdj: x yCharAdj: y char: c adjArray: arr arrType: show_delta isRelative: YES]; } - (void) DPSxshow: (const char*)s : (const CGFloat*)numarray : (int)size { [self _showString: s xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_x isRelative: NO]; } - (void) DPSxyshow: (const char*)s : (const CGFloat*)numarray : (int)size { [self _showString: s xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_xy isRelative: NO]; } - (void) DPSyshow: (const char*)s : (const CGFloat*)numarray : (int)size { [self _showString: s xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_y isRelative: NO]; } - (void) GSSetCharacterSpacing: (CGFloat)extra { charSpacing = extra; } - (void) GSSetFont: (GSFontInfo *)fontref { if (font == fontref) return; ASSIGN(font, fontref); } - (void) GSSetFontSize: (CGFloat)size { } - (NSAffineTransform *) GSGetTextCTM { return textCtm; } - (NSPoint) GSGetTextPosition { return [textCtm transformPoint: NSMakePoint(0,0)]; } - (void) GSSetTextCTM: (NSAffineTransform *)newCtm { ASSIGN(textCtm, newCtm); } - (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode { textMode = mode; } - (void) GSSetTextPosition: (NSPoint)loc { [textCtm translateToPoint: loc]; } - (void) GSShowText: (const char *)string : (size_t) length { [self subclassResponsibility: _cmd]; } - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length { int i; NSSize advances[length]; for (i=0; i Date: Nov 1995 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "gsc/GSContext.h" #include "gsc/GSStreamContext.h" #include "gsc/GSStreamGState.h" #include #include #include #include #include #import #include #include #include #include #include #include #include #include @interface GSFontInfo (experimental_glyph_printing_extension) // This method is currently only present in the libart backend -(const char *) nameOfGlyph: (NSGlyph)g; @end /* Print a floating point number regardless of localization */ static void fpfloat(FILE *stream, float f) { char buffer[80], *p; sprintf(buffer, "%g ", f); p = buffer; while (*p) { if (*p == ',') *p = '.'; p++; } fprintf(stream, "%s", buffer); } @interface GSStreamContext (Private) - (void) output: (const char*)s length: (size_t)length; - (void) output: (const char*)s; @end @implementation GSStreamContext + (Class) GStateClass { return [GSStreamGState class]; } + (BOOL) handlesPS { return YES; } - (void) dealloc { if (gstream) fclose(gstream); [super dealloc]; } - initWithContextInfo: (NSDictionary *)info { self = [super initWithContextInfo: info]; if (!self) return nil; if (info && [info objectForKey: @"NSOutputFile"]) { NSString *path = [info objectForKey: @"NSOutputFile"]; NSDebugLLog(@"GSContext", @"Printing to %@", path); #if defined(__MINGW32__) gstream = _wfopen([path fileSystemRepresentation], L"wb"); #else gstream = fopen([path fileSystemRepresentation], "w"); #endif if (!gstream) { NSDebugLLog(@"GSContext", @"%@: Could not open printer file %@", DPSinvalidfileaccess, path); return nil; } } else { NSDebugLLog(@"GSContext", @"%@: No stream file specified", DPSconfigurationerror); DESTROY(self); return nil; } return self; } - (BOOL)isDrawingToScreen { return NO; } @end @implementation GSStreamContext (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ - (void) DPSsetalpha: (CGFloat)a { [super DPSsetalpha: a]; /* This needs to be defined base on the the language level, etc. in the Prolog section. */ fpfloat(gstream, a); fprintf(gstream, "GSsetalpha\n"); } - (void) DPSsetcmykcolor: (CGFloat)c : (CGFloat)m : (CGFloat)y : (CGFloat)k { [super DPSsetcmykcolor: c : m : y : k]; fpfloat(gstream, c); fpfloat(gstream, m); fpfloat(gstream, y); fpfloat(gstream, k); fprintf(gstream, "setcmykcolor\n"); } - (void) DPSsetgray: (CGFloat)gray { [super DPSsetgray: gray]; fpfloat(gstream, gray); fprintf(gstream, "setgray\n"); } - (void) DPSsethsbcolor: (CGFloat)h : (CGFloat)s : (CGFloat)b { [super DPSsethsbcolor: h : s : b]; fpfloat(gstream, h); fpfloat(gstream, s); fpfloat(gstream, b); fprintf(gstream, "sethsbcolor\n"); } - (void) DPSsetrgbcolor: (CGFloat)r : (CGFloat)g : (CGFloat)b { [super DPSsetrgbcolor: r : g : b]; fpfloat(gstream, r); fpfloat(gstream, g); fpfloat(gstream, b); fprintf(gstream, "setrgbcolor\n"); } - (void) GSSetFillColor: (const CGFloat *)values { [self notImplemented: _cmd]; } - (void) GSSetStrokeColor: (const CGFloat *)values { [self notImplemented: _cmd]; } - (void) GSSetPatterColor: (NSImage*)image { [self notImplemented: _cmd]; } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ - (void) DPSashow: (CGFloat)x : (CGFloat)y : (const char*)s { fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "("); [self output:s]; fprintf(gstream, ") ashow\n"); } - (void) DPSawidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (CGFloat)ax : (CGFloat)ay : (const char*)s { fpfloat(gstream, cx); fpfloat(gstream, cy); fprintf(gstream, "%d ", c); fpfloat(gstream, ax); fpfloat(gstream, ay); fprintf(gstream, "("); [self output:s]; fprintf(gstream, ") awidthshow\n"); } - (void) DPScharpath: (const char*)s : (int)b { fprintf(gstream, "("); [self output:s]; fprintf(gstream, ") %d charpath\n", b); } - (void) DPSshow: (const char*)s { fprintf(gstream, "("); [self output:s]; fprintf(gstream, ") show\n"); } - (void) DPSwidthshow: (CGFloat)x : (CGFloat)y : (int)c : (const char*)s { fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "%d (", c); [self output:s]; fprintf(gstream, ") widthshow\n"); } - (void) DPSxshow: (const char*)s : (const CGFloat*)numarray : (int)size { [self notImplemented: _cmd]; } - (void) DPSxyshow: (const char*)s : (const CGFloat*)numarray : (int)size { [self notImplemented: _cmd]; } - (void) DPSyshow: (const char*)s : (const CGFloat*)numarray : (int)size { [self notImplemented: _cmd]; } - (void) GSSetCharacterSpacing: (CGFloat)extra { [self notImplemented: _cmd]; } - (void) GSSetFont: (void *)fontref { const CGFloat *m = [(GSFontInfo *)fontref matrix]; NSString *postscriptName; postscriptName = [[(GSFontInfo *)fontref fontDescriptor] postscriptName]; if (nil == postscriptName) { postscriptName = [(GSFontInfo *)fontref fontName]; } fprintf(gstream, "/%s findfont ", [postscriptName cString]); fprintf(gstream, "["); fpfloat(gstream, m[0]); fpfloat(gstream, m[1]); fpfloat(gstream, m[2]); fpfloat(gstream, m[3]); fpfloat(gstream, m[4]); fpfloat(gstream, m[5]); fprintf(gstream, "] "); fprintf(gstream, " makefont setfont\n"); [super GSSetFont: fontref]; } - (void) GSSetFontSize: (CGFloat)size { [self notImplemented: _cmd]; } - (void) GSShowText: (const char *)string : (size_t)length { fprintf(gstream, "("); [self output:string length: length]; fprintf(gstream, ") show\n"); } - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t)length { GSFontInfo *font = gstate->font; if ([font respondsToSelector: @selector(nameOfGlyph:)]) { unsigned int i; for (i = 0; i < length; i++) { fprintf(gstream, "/%s glyphshow\n", [font nameOfGlyph: glyphs[i]]); } } else { /* If backend doesn't handle nameOfGlyph, assume the glyphs are just mapped to characters. This is the case for the xlib backend (at least for now). */ char string[length + 1]; unsigned int i; for (i = 0; i < length; i++) { string[i] = glyphs[i]; } string[length] = 0; [self DPSshow: string]; } } - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t)length { // FIXME: Currently advances is ignored [self GSShowGlyphs: glyphs : length]; } /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ - (void) DPSgrestore { [super DPSgrestore]; fprintf(gstream, "grestore\n"); } - (void) DPSgsave { [super DPSgsave]; fprintf(gstream, "gsave\n"); } - (void) DPSgstate { [super DPSgsave]; fprintf(gstream, "gstaten"); } - (void) DPSinitgraphics { [super DPSinitgraphics]; fprintf(gstream, "initgraphics\n"); } - (void) DPSsetgstate: (int)gst { [self notImplemented: _cmd]; } - (int) GSDefineGState { [self notImplemented: _cmd]; return 0; } - (void) GSUndefineGState: (int)gst { [self notImplemented: _cmd]; } - (void) GSReplaceGState: (int)gst { [self notImplemented: _cmd]; } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - (void) DPSsetdash: (const CGFloat*)pat : (NSInteger)size : (CGFloat)offset { int i; fprintf(gstream, "["); for (i = 0; i < size; i++) fpfloat(gstream, pat[i]); fprintf(gstream, "] "); fpfloat(gstream, offset); fprintf(gstream, "setdash\n"); } - (void) DPSsetflat: (CGFloat)flatness { [super DPSsetflat: flatness]; fpfloat(gstream, flatness); fprintf(gstream, "setflat\n"); } - (void) DPSsethalftonephase: (CGFloat)x : (CGFloat)y { [super DPSsethalftonephase: x : y]; fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "sethalftonephase\n"); } - (void) DPSsetlinecap: (int)linecap { [super DPSsetlinecap: linecap]; fprintf(gstream, "%d setlinecap\n", linecap); } - (void) DPSsetlinejoin: (int)linejoin { [super DPSsetlinejoin: linejoin]; fprintf(gstream, "%d setlinejoin\n", linejoin); } - (void) DPSsetlinewidth: (CGFloat)width { [super DPSsetlinewidth: width]; fpfloat(gstream, width); fprintf(gstream, "setlinewidth\n"); } - (void) DPSsetmiterlimit: (CGFloat)limit { [super DPSsetmiterlimit: limit]; fpfloat(gstream, limit); fprintf(gstream, "setmiterlimit\n"); } - (void) DPSsetstrokeadjust: (int)b { [super DPSsetstrokeadjust: b]; fprintf(gstream, "%s setstrokeadjust\n", b? "true" : "false"); } /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ - (void) DPSconcat: (const CGFloat*)m { [super DPSconcat: m]; if ((m[0] == 1.0) && (m[1] == 0.0) && (m[2] == 0.0) && (m[3] == 1.0)) { if ((m[4] != 0.0) || (m[5] != 0.0)) { fpfloat(gstream, m[4]); fpfloat(gstream, m[5]); fprintf(gstream, "translate\n"); } } else { fprintf(gstream, "["); fpfloat(gstream, m[0]); fpfloat(gstream, m[1]); fpfloat(gstream, m[2]); fpfloat(gstream, m[3]); fpfloat(gstream, m[4]); fpfloat(gstream, m[5]); fprintf(gstream, "] concat\n"); } } - (void) DPSinitmatrix { [super DPSinitmatrix]; fprintf(gstream, "initmatrix\n"); } - (void) DPSrotate: (CGFloat)angle { [super DPSrotate: angle]; fpfloat(gstream, angle); fprintf(gstream, "rotate\n"); } - (void) DPSscale: (CGFloat)x : (CGFloat)y { [super DPSscale: x : y]; fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "scale\n"); } - (void) DPStranslate: (CGFloat)x : (CGFloat)y { [super DPStranslate: x : y]; fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "translate\n"); } - (void) GSSetCTM: (NSAffineTransform *)ctm { NSAffineTransformStruct matrix = [ctm transformStruct]; fprintf(gstream, "["); fpfloat(gstream, matrix.m11); fpfloat(gstream, matrix.m12); fpfloat(gstream, matrix.m21); fpfloat(gstream, matrix.m22); fpfloat(gstream, matrix.tX); fpfloat(gstream, matrix.tY); fprintf(gstream, "] setmatrix\n"); } - (void) GSConcatCTM: (NSAffineTransform *)ctm { NSAffineTransformStruct matrix = [ctm transformStruct]; fprintf(gstream, "["); fpfloat(gstream, matrix.m11); fpfloat(gstream, matrix.m12); fpfloat(gstream, matrix.m21); fpfloat(gstream, matrix.m22); fpfloat(gstream, matrix.tX); fpfloat(gstream, matrix.tY); fprintf(gstream, "] concat\n"); } /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ - (void) DPSarc: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { fpfloat(gstream, x); fpfloat(gstream, y); fpfloat(gstream, r); fpfloat(gstream, angle1); fpfloat(gstream, angle2); fprintf(gstream, "arc\n"); } - (void) DPSarcn: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { fpfloat(gstream, x); fpfloat(gstream, y); fpfloat(gstream, r); fpfloat(gstream, angle1); fpfloat(gstream, angle2); fprintf(gstream, "arcn\n"); } - (void) DPSarct: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)r { fpfloat(gstream, x1); fpfloat(gstream, y1); fpfloat(gstream, x2); fpfloat(gstream, y2); fpfloat(gstream, r); fprintf(gstream, "arct\n"); } - (void) DPSclip { fprintf(gstream, "clip\n"); } - (void) DPSclosepath { fprintf(gstream, "closepath\n"); } - (void)DPScurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { fpfloat(gstream, x1); fpfloat(gstream, y1); fpfloat(gstream, x2); fpfloat(gstream, y2); fpfloat(gstream, x3); fpfloat(gstream, y3); fprintf(gstream, "curveto\n"); } - (void) DPSeoclip { fprintf(gstream, "eoclip\n"); } - (void) DPSeofill { fprintf(gstream, "eofill\n"); } - (void) DPSfill { fprintf(gstream, "fill\n"); } - (void) DPSflattenpath { fprintf(gstream, "flattenpath\n"); } - (void) DPSinitclip { fprintf(gstream, "initclip\n"); } - (void) DPSlineto: (CGFloat)x : (CGFloat)y { fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "lineto\n"); } - (void) DPSmoveto: (CGFloat)x : (CGFloat)y { fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "moveto\n"); } - (void) DPSnewpath { fprintf(gstream, "newpath\n"); } - (void) DPSpathbbox: (CGFloat*)llx : (CGFloat*)lly : (CGFloat*)urx : (CGFloat*)ury { } - (void) DPSrcurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { fpfloat(gstream, x1); fpfloat(gstream, y1); fpfloat(gstream, x2); fpfloat(gstream, y2); fpfloat(gstream, x3); fpfloat(gstream, y3); fprintf(gstream, "rcurveto\n"); } - (void) DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { fpfloat(gstream, x); fpfloat(gstream, y); fpfloat(gstream, w); fpfloat(gstream, h); fprintf(gstream, "rectclip\n"); } - (void) DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { fpfloat(gstream, x); fpfloat(gstream, y); fpfloat(gstream, w); fpfloat(gstream, h); fprintf(gstream, "rectfill\n"); } - (void) DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { fpfloat(gstream, x); fpfloat(gstream, y); fpfloat(gstream, w); fpfloat(gstream, h); fprintf(gstream, "rectstroke\n"); } - (void) DPSreversepath { fprintf(gstream, "reversepath\n"); } - (void) DPSrlineto: (CGFloat)x : (CGFloat)y { fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "rlineto\n"); } - (void) DPSrmoveto: (CGFloat)x : (CGFloat)y { fpfloat(gstream, x); fpfloat(gstream, y); fprintf(gstream, "rmoveto\n"); } - (void) DPSstroke { fprintf(gstream, "stroke\n"); } - (void) GSSendBezierPath: (NSBezierPath *)path { NSBezierPathElement type; NSPoint pts[3]; NSInteger i, count = 10; CGFloat pattern[10]; CGFloat phase = 0.0; [self DPSnewpath]; [self DPSsetlinewidth: [path lineWidth]]; [self DPSsetlinejoin: [path lineJoinStyle]]; [self DPSsetlinecap: [path lineCapStyle]]; [self DPSsetmiterlimit: [path miterLimit]]; [self DPSsetflat: [path flatness]]; [path getLineDash: pattern count: &count phase: &phase]; // Always sent the dash pattern. When NULL this will reset to a solid line. [self DPSsetdash: pattern : count : phase]; count = [path elementCount]; for (i = 0; i < count; i++) { type = [path elementAtIndex: i associatedPoints: pts]; switch (type) { case NSMoveToBezierPathElement: [self DPSmoveto: pts[0].x : pts[0].y]; break; case NSLineToBezierPathElement: [self DPSlineto: pts[0].x : pts[0].y]; break; case NSCurveToBezierPathElement: [self DPScurveto: pts[0].x : pts[0].y : pts[1].x : pts[1].y : pts[2].x : pts[2].y]; break; case NSClosePathBezierPathElement: [self DPSclosepath]; break; default: break; } } } - (void) GSRectClipList: (const NSRect *)rects : (int)count { int i; NSRect union_rect; if (count == 0) return; /* The specification is not clear if the union of the rects should produce the new clip rect or if the outline of all rects should be used as clip path. */ union_rect = rects[0]; for (i = 1; i < count; i++) union_rect = NSUnionRect(union_rect, rects[i]); [self DPSrectclip: NSMinX(union_rect) : NSMinY(union_rect) : NSWidth(union_rect) : NSHeight(union_rect)]; } - (void) GSRectFillList: (const NSRect *)rects : (int)count { int i; for (i = 0; i < count; i++) [self DPSrectfill: NSMinX(rects[i]) : NSMinY(rects[i]) : NSWidth(rects[i]) : NSHeight(rects[i])]; } /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentgcdrawable: (void**)gc : (void**)draw : (int*)x : (int*)y { NSLog(@"DPSinvalidcontext: getting gcdrawable from stream context"); } - (void) DPScurrentoffset: (int*)x : (int*)y { NSLog(@"DPSinvalidcontext: getting drawable offset from stream context"); } - (void) DPSsetgcdrawable: (void*)gc : (void*)draw : (int)x : (int)y { NSLog(@"DPSinvalidcontext: setting gcdrawable from stream context"); } - (void) DPSsetoffset: (short int)x : (short int)y { NSLog(@"DPSinvalidcontext: setting drawable offset from stream context"); } /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ - (void) DPScomposite: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (NSCompositingOperation)op { fpfloat(gstream, x); fpfloat(gstream, y); fpfloat(gstream, w); fpfloat(gstream, h); fprintf(gstream, "%d ", (int)gstateNum); fpfloat(gstream, dx); fpfloat(gstream, dy); fprintf(gstream, "%d composite\n", (int)op); } - (void) DPScompositerect: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSCompositingOperation)op { fpfloat(gstream, x); fpfloat(gstream, y); fpfloat(gstream, w); fpfloat(gstream, h); fprintf(gstream, "%d compositerect\n", (int)op); } - (void) DPSdissolve: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (CGFloat)delta { NSLog(@"DPSinvalidcontext: dissolve in a stream context"); } - (void) GScomposite: (NSInteger)gstateNum toPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { [self DPScomposite: NSMinX(srcRect) : NSMinY(srcRect) : NSWidth(srcRect) : NSHeight(srcRect) : gstateNum : aPoint.x : aPoint.y : op]; } - (void) GSDrawImage: (NSRect)rect : (void *)imageref { id image = (id)imageref; unsigned char *imagePlanes[5]; if([image isKindOfClass: [NSBitmapImageRep class]]) { fprintf(gstream,"%%%% BeginImage\n"); [image getBitmapDataPlanes: imagePlanes]; [self NSDrawBitmap: rect : [image pixelsWide] : [image pixelsHigh] : [image bitsPerSample] : [image samplesPerPixel] : [image bitsPerPixel] : [image bytesPerRow] : [image isPlanar] : [image hasAlpha] : [image colorSpaceName] : (const unsigned char **)imagePlanes]; fprintf(gstream,"%%%% EndImage\n"); } } /* ----------------------------------------------------------------------- */ /* Client functions */ /* ----------------------------------------------------------------------- */ - (void) DPSPrintf: (const char *)fmt : (va_list)args { vfprintf(gstream, fmt, args); } - (void) DPSWriteData: (const char *)buf : (unsigned int)count { /* Not sure here. Should we translate to ASCII if it's not already? */ } @end static void writeHex(FILE *gstream, const unsigned char *data, int count) { static const char *hexdigits = "0123456789abcdef"; int i; for (i = 0; i < count; i++) { fputc(hexdigits[(int)(data[i] / 16)], gstream); fputc(hexdigits[(int)(data[i] % 16)], gstream); if (i && i % 40 == 0) fprintf(gstream, "\n"); } } @implementation GSStreamContext (Graphics) - (void) NSDrawBitmap: (NSRect)rect : (NSInteger)pixelsWide : (NSInteger)pixelsHigh : (NSInteger)bitsPerSample : (NSInteger)samplesPerPixel : (NSInteger)bitsPerPixel : (NSInteger)bytesPerRow : (BOOL)isPlanar : (BOOL)hasAlpha : (NSString *)colorSpaceName : (const unsigned char *const [5])data { NSInteger bytes, spp; CGFloat y; BOOL flipped = NO; /* In a flipped view, we don't want to flip the image again, which would make it come out upsidedown. FIXME: This can't be right, can it? */ if ([[NSView focusView] isFlipped]) flipped = YES; /* Save scaling */ fprintf(gstream, "matrix\ncurrentmatrix\n"); y = NSMinY(rect); if (flipped) y += NSHeight(rect); fpfloat(gstream, NSMinX(rect)); fpfloat(gstream, y); fprintf(gstream, "translate "); fpfloat(gstream, NSWidth(rect)); fpfloat(gstream, NSHeight(rect)); fprintf(gstream, "scale\n"); if (bitsPerSample == 0) bitsPerSample = 8; bytes = (bitsPerSample * pixelsWide * pixelsHigh + 7) / 8; if (bytes * samplesPerPixel != bytesPerRow * pixelsHigh) { NSLog(@"Image Rendering Error: Dodgy bytesPerRow value %d", (int)bytesPerRow); NSLog(@" pixelsHigh=%d, bytes=%d, samplesPerPixel=%d", (int)bytesPerRow, (int)pixelsHigh, (int)bytes); return; } if (hasAlpha) spp = samplesPerPixel - 1; else spp = samplesPerPixel; if (samplesPerPixel > 1) { if (isPlanar || hasAlpha) { if (bitsPerSample != 8) { NSLog(@"Image format conversion not supported for bps!=8"); return; } } fprintf(gstream, "%d %d %d [%d 0 0 %d 0 %d]\n", (int)pixelsWide, (int)pixelsHigh, (int)bitsPerSample, (int)pixelsWide, (flipped) ? (int)pixelsHigh : (int)-pixelsHigh, (int)pixelsHigh); fprintf(gstream, "{currentfile %d string readhexstring pop}\n", (int)(pixelsWide * spp)); fprintf(gstream, "false %d colorimage\n", (int)spp); } else { fprintf(gstream, "%d %d %d [%d 0 0 %d 0 %d]\n", (int)pixelsWide, (int)pixelsHigh, (int)bitsPerSample, (int)pixelsWide, (flipped) ? (int)pixelsHigh : (int)-pixelsHigh, (int)pixelsHigh); fprintf(gstream, "currentfile image\n"); } // The context is now waiting for data on its standard input if (isPlanar || hasAlpha) { // We need to do a format conversion. // We do this on the fly, sending data to the context as soon as // it is computed. int i, j; // Preset this variable to keep compiler happy. int alpha = 0; unsigned char val; for (j = 0; j < bytes; j++) { if (hasAlpha) { if (isPlanar) alpha = data[spp][j]; else alpha = data[0][spp + j * samplesPerPixel]; } for (i = 0; i < spp; i++) { if (isPlanar) val = data[i][j]; else val = data[0][i + j * samplesPerPixel]; if (hasAlpha) val = 255 - ((255 - val) * (long)alpha) / 255; writeHex(gstream, &val, 1); } if (j && j % 40 == 0) fprintf(gstream, "\n"); } fprintf(gstream, "\n"); } else { // The data is already in the format the context expects it in writeHex(gstream, data[0], bytes * samplesPerPixel); } /* Restore original scaling */ fprintf(gstream, "setmatrix\n"); } @end @implementation GSStreamContext (Private) - (void) output: (const char*)s length: (size_t)length { unsigned int i; for (i = 0; i < length; i++) { switch (s[i]) { case '(': fputs("\\(", gstream); break; case ')': fputs("\\)", gstream); break; default: fputc(s[i], gstream); break; } } } - (void) output: (const char*)s { [self output: s length: strlen(s)]; } @end gnustep-back-0.29.0/Source/gsc/GSStreamGState.m000066400000000000000000000045041404163720200211560ustar00rootroot00000000000000/* GSStreamGState - PS Stream graphic state Copyright (C) 2002 Free Software Foundation, Inc. Written by: Adam Fedor Date: Sep 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include "gsc/GSContext.h" #include "gsc/GSStreamGState.h" #include "math.h" @implementation GSStreamGState /* Designated initializer. */ - initWithDrawContext: (GSContext *)drawContext { [super initWithDrawContext: drawContext]; clinecap = 0; clinejoin = 0; clinewidth = 0; cmiterlimit = 0; cstrokeadjust = 0; return self; } - (void) DPScurrentlinecap: (int*)linecap { if (linecap) *linecap = clinecap; } - (void) DPScurrentlinejoin: (int*)linejoin { if (linejoin) *linejoin = clinejoin; } - (void) DPScurrentlinewidth: (CGFloat*)width { if (width) *width = clinewidth; } - (void) DPScurrentmiterlimit: (CGFloat*)limit { if (limit) *limit = cmiterlimit; } - (void) DPScurrentstrokeadjust: (int*)b { if (b) *b = cstrokeadjust; } - (void) DPSsetlinecap: (int)linecap { clinecap = linecap; } - (void) DPSsetlinejoin: (int)linejoin { clinejoin = linejoin; } - (void) DPSsetlinewidth: (CGFloat)width { clinewidth = width; } - (void) DPSsetmiterlimit: (CGFloat)limit { cmiterlimit = limit; } - (void) DPSsetstrokeadjust: (int)b { cstrokeadjust = b; } @end gnustep-back-0.29.0/Source/gsc/externs.m000066400000000000000000000044011404163720200200450ustar00rootroot00000000000000/* externs.m External data Copyright (C) 1997 Free Software Foundation, Inc. Author: Adam Fedor Date: Dec 1998 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include NSString *DPSconfigurationerror = @"DPSconfigurationerror: %@"; NSString *DPSinvalidaccess = @"DPSinvalidaccess: %@"; NSString *DPSinvalidcontext = @"DPSinvalidcontext: %@"; NSString *DPSinvalidexit = @"DPSinvalidexit: %@"; NSString *DPSinvalidfileaccess = @"DPSinvalidfileaccess: %@"; NSString *DPSinvalidfont = @"DPSinvalidfont: %@"; NSString *DPSinvalidid = @"DPSinvalidid: %@"; NSString *DPSinvalidrestore = @"DPSinvalidrestore: %@"; NSString *DPSinvalidparam = @"DPSinvalidparam: %@"; NSString *DPSioerror = @"DPSioerror: %@"; NSString *DPSlimitcheck = @"DPSlimitcheck: %@"; NSString *DPSnocurrentpoint = @"DPSnocurrentpoint: %@"; NSString *DPSnulloutput = @"DPSnulloutput: %@"; NSString *DPSrangecheck = @"DPSrangecheck: %@"; NSString *DPSstackoverflow = @"DPSstackoverflow: %@"; NSString *DPSstackunderflow = @"DPSstackunderflow: %@"; NSString *DPStypecheck = @"DPStypecheck: %@"; NSString *DPSundefined = @"DPSundefined: %@"; NSString *DPSundefinedfilename = @"DPSundefinedfilename: %@"; NSString *DPSundefinedresource = @"DPSundefinedresource: %@"; NSString *DPSundefinedresult = @"DPSundefinedresult: %@"; NSString *DPSunmatchedmark = @"DPSunmatchedmark: %@"; NSString *DPSunregistered = @"DPSunregistered: %@"; NSString *DPSVMerror = @"DPSVMerror: %@"; gnustep-back-0.29.0/Source/gsc/gscolors.c000066400000000000000000000146211404163720200202030ustar00rootroot00000000000000/* gscolors - Color conversion routines Copyright (C) 1998 Free Software Foundation, Inc. Written by: Adam Fedor Date: Oct 1998 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include "gsc/gscolors.h" void gsMakeColor(device_color_t *dst, device_colorspace_t space, float a, float b, float c, float d) { dst->space = space; dst->field[0] = a; dst->field[1] = b; dst->field[2] = c; dst->field[3] = d; } void gsGrayToRGB(device_color_t *color) { gsMakeColor(color, rgb_colorspace, color->field[0], color->field[0], color->field[0], 0); } void gsHSBToRGB(device_color_t *color) { int i; float h, s, v; float f, p, q, t; float red, green, blue; h = color->field[0]; s = color->field[1]; v = color->field[2]; if (s == 0) { gsMakeColor(color, rgb_colorspace, v, v, v, 0); return; } h = h * 6; i = (int)h; f = h - i; p = v * (1.0 - s); q = v * (1.0 - s * f); t = v * (1.0 - s * (1 - f)); switch (i) { default: /* catch h==1.0 */ case 0: red = v; green = t; blue = p; break; case 1: red = q; green = v; blue = p; break; case 2: red = p; green = v; blue = t; break; case 3: red = p; green = q; blue = v; break; case 4: red = t; green = p; blue = v; break; case 5: red = v; green = p; blue = q; break; } gsMakeColor(color, rgb_colorspace, red, green, blue, 0); } /* FIXME */ void gsCMYKToRGB(device_color_t *color) { float c, m, y, k; float red, green, blue; double white; c = color->field[0]; m = color->field[1]; y = color->field[2]; k = color->field[3]; white = 1 - k; if (k == 0) { red = 1 - c; green = 1 - m; blue = 1 - y; } else if (k == 1) { red = 0; green = 0; blue = 0; } else { red = (c > white ? 0 : white - c); green = (m > white ? 0 : white - m); blue = (y > white ? 0 : white - y); } gsMakeColor(color, rgb_colorspace, red, green, blue, 0); } void gsColorToRGB(device_color_t *color) { switch(color->space) { case gray_colorspace: gsGrayToRGB(color); break; case rgb_colorspace: break; case hsb_colorspace: gsHSBToRGB(color); break; case cmyk_colorspace: gsCMYKToRGB(color); break; default: break; } } void gsColorToGray(device_color_t *color) { switch(color->space) { case gray_colorspace: break; case hsb_colorspace: case cmyk_colorspace: gsColorToRGB(color); /* NO BREAK */ case rgb_colorspace: color->field[0] = ((0.3*color->field[0]) + (0.59*color->field[1]) + (0.11*color->field[2])); break; default: break; } color->space = gray_colorspace; } void gsColorToCMYK(device_color_t *color) { switch(color->space) { case gray_colorspace: color->field[3] = color->field[0]; color->field[0] = 0.0; color->field[1] = 0.0; color->field[2] = 0.0; break; case hsb_colorspace: gsColorToRGB(color); /* NO BREAK */ case rgb_colorspace: color->field[0] = 1.0 - color->field[0]; color->field[1] = 1.0 - color->field[1]; color->field[2] = 1.0 - color->field[2]; color->field[3] = 0; /* Add a bit of black if possible (for no reason, really). */ color->field[3] = color->field[0]; color->field[0] = 0.0; color->field[1] -= color->field[3]; color->field[2] -= color->field[3]; if (color->field[1] > color->field[2]) { if (color->field[2] < 0.0) { color->field[0] -= color->field[2]; color->field[1] -= color->field[2]; color->field[3] += color->field[2]; color->field[2] = 0; } } else { if (color->field[1] < 0.0) { color->field[0] -= color->field[1]; color->field[2] -= color->field[1]; color->field[3] += color->field[1]; color->field[1] = 0; } } break; case cmyk_colorspace: break; default: break; } color->space = cmyk_colorspace; } void gsColorToHSB(device_color_t *color) { switch(color->space) { case gray_colorspace: color->field[2] = color->field[0]; color->field[0] = 0.0; color->field[1] = 0.0; break; case cmyk_colorspace: gsColorToRGB(color); /* NO BREAK */ case rgb_colorspace: { float r = color->field[0]; float g = color->field[1]; float b = color->field[2]; float _hue_component, _saturation_component, _brightness_component; if (r == g && r == b) { _hue_component = 0; _saturation_component = 0; _brightness_component = r; } else { double H; double V; double Temp; double diff; V = (r > g ? r : g); V = (b > V ? b : V); Temp = (r < g ? r : g); Temp = (b < Temp ? b : Temp); diff = V - Temp; if (V == r) { H = (g - b)/diff; } else if (V == g) { H = (b - r)/diff + 2; } else { H = (r - g)/diff + 4; } if (H < 0) { H += 6; } _hue_component = H/6; _saturation_component = diff/V; _brightness_component = V; } color->field[0] = _hue_component; color->field[1] = _saturation_component; color->field[2] = _brightness_component; } break; case hsb_colorspace: break; default: break; } color->space = hsb_colorspace; } gnustep-back-0.29.0/Source/opal/000077500000000000000000000000001404163720200163575ustar00rootroot00000000000000gnustep-back-0.29.0/Source/opal/GNUmakefile000066400000000000000000000040021404163720200204250ustar00rootroot00000000000000# Copyright (C) 2013 Free Software Foundation, Inc. # # Author: Ivan Vucica # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make SUBPROJECT_NAME=opal # The Objective-C source files to be compiled opal_OBJC_FILES = OpalSurface.m \ OpalFontInfo.m \ OpalGState.m \ OpalContext.m \ OpalFontEnumerator.m \ OpalFaceInfo.m \ OpalPSSurface.m \ OpalPDFSurface.m \ OpalBridge.m \ ../fontconfig/FCFaceInfo.m \ ../fontconfig/FCFontEnumerator.m \ ../fontconfig/FCFontInfo.m \ ifeq ($(BUILD_SERVER),x11DISABLED) ifeq ($(WITH_GLITZ),yes) opal_OBJC_FILES += XGCairoGlitzSurface.m else opal_OBJC_FILES += XGCairoSurface.m XGCairoXImageSurface.m XGCairoModernSurface.m endif else ifeq ($(BUILD_GRAPHICS),opalDISABLED) ifeq ($(WITH_GLITZ),yes) opal_OBJC_FILES += Win32CairoGlitzSurface.m else opal_OBJC_FILES += Win32CairoSurface.m Win32CairoGState.m # Win32CairoXImageSurface.m endif endif endif opal_OBJC_FILES += -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/opal/GNUmakefile.preamble000066400000000000000000000031311404163720200222150ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler #ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS = -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) \ # Additional LDFLAGS to pass to the linker #ADDITIONAL_LDFLAGS = # Additional library directories the linker should search #ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/opal/OpalBridge.m000066400000000000000000000103671404163720200205540ustar00rootroot00000000000000/* OpalBridge.m Copyright (C) 2017 Free Software Foundation, Inc. Author: Daniel Ferreira Date: July 2017 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import @implementation NSColor (GSQuartz) /* * FIXME: * NOTE 1: GNUstep-GUI does not allow an NSColor to be created with a custom * NSColorSpace. If this were allowed, we'd have to: * 1) implement a bridge for -[NSColorSpace CGColorSpace] * 2) for each color, extract that color space and generate a CGColorRef. * NOTE 2: GNUstep-GUI makes no distinction of device and generic color spaces. * If this ever ceases to be the case, some adjustment might be necessary here. */ - (CGColorRef)CGColor { NSString *name = [self colorSpaceName]; // FIXME: we should handle black color spaces here, which we currently // ignore in the implementation. CFStringRef cgColorSpaceName = NULL; if ([name isEqualToString: NSCalibratedRGBColorSpace] || [name isEqualToString: NSDeviceRGBColorSpace]) cgColorSpaceName = kCGColorSpaceSRGB; else if ([name isEqualToString: NSCalibratedBlackColorSpace] || [name isEqualToString: NSCalibratedWhiteColorSpace] || [name isEqualToString: NSDeviceBlackColorSpace] || [name isEqualToString: NSDeviceWhiteColorSpace]) cgColorSpaceName = kCGColorSpaceGenericGray; else if ([name isEqualToString: NSDeviceCMYKColorSpace]) cgColorSpaceName = kCGColorSpaceGenericCMYK; else if ([name isEqualToString: NSNamedColorSpace]) return [[self colorUsingColorSpaceName: NSDeviceRGBColorSpace] CGColor]; if (cgColorSpaceName == NULL) return NULL; CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(cgColorSpaceName); CGFloat values[10]; [self getComponents: values]; CGColorRef color = CGColorCreate(colorSpace, values); CFRelease(colorSpace); return (CGColorRef)[(id)color autorelease]; } @end @implementation NSImageRep (GSQuartz) - (CGImageRef)CGImageForProposedRect: (NSRect *)proposedDestRect context: (NSGraphicsContext *)referenceContext hints: (NSDictionary *)hints { /* * FIXME Must implement this. * A note for future implementors: > Apparently each NSImageRep subclass implements this method, with the > base implementation being[1], as I understand it (which may be wrong): > i. create a new blank context with *proposedDestRect.size and set it > as the current context. This context should theoretically be > constructed with properties extracted from `referenceContext` and/or > `hints`, although I suppose our first implementation can go without > that. > ii. call [self draw]; > iii. adjust *proposedDestRect to round half-pixels > iv. extract a CGImage from the bitmap context > If NSImage.size == *proposedDestRect.size, we should just CGImageCreate > directly from our representation data. */ return NULL; } @end @implementation NSImage (GSQuartz) - (CGImageRef)CGImageForProposedRect: (NSRect *)proposedDestRect context: (NSGraphicsContext *)referenceContext hints: (NSDictionary *)hints { // FIXME: Must implement this. // This should pick the best NSImageRep for this NSImage and call // -[NSImageRep CGImageForProposedRect:...]. return NULL; } @end gnustep-back-0.29.0/Source/opal/OpalContext.m000066400000000000000000000135151404163720200210020ustar00rootroot00000000000000/* OpalContext.m Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "opal/OpalContext.h" #import "opal/OpalFontInfo.h" #import "opal/OpalFontEnumerator.h" #import "opal/OpalSurface.h" #import "opal/OpalGState.h" #include "config.h" #define OGSTATE ((OpalGState *)gstate) #if BUILD_SERVER == SERVER_x11 # import "x11/XGServerWindow.h" # import "x11/XWindowBuffer.h" #endif @implementation OpalContext + (void) initializeBackend { [NSGraphicsContext setDefaultContextClass: self]; [GSFontEnumerator setDefaultClass: [OpalFontEnumerator class]]; [GSFontInfo setDefaultClass: [OpalFontInfo class]]; } + (Class) GStateClass { return [OpalGState class]; } - (BOOL) supportsDrawGState { return YES; } - (BOOL) isDrawingToScreen { #warning isDrawingToScreen returning NO to fix DPSimage return NO; // NOTE: This was returning NO because it was not looking at the // return value of GSCurrentSurface. Now it returns YES, which // seems to have broken image drawing (yellow rectangles are drawn instead) OpalSurface *surface; [OGSTATE GSCurrentSurface: &surface : NULL : NULL]; return [surface isDrawingToScreen]; } - (void) flushGraphics { NSDebugLLog(@"OpalContext", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); OpalSurface *surface; [OGSTATE GSCurrentSurface: &surface : NULL : NULL]; CGContextFlush([surface CGContext]); //[surface handleExposeRect: [surface size]]; } /* Private backend methods */ /** This handles 'expose' event notifications that arrive from X11. */ + (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver { if ([(id)driver isKindOfClass: [OpalSurface class]]) { [(OpalSurface *)driver handleExposeRect: rect]; } } #if BUILD_SERVER == SERVER_x11 #ifdef XSHM + (void) _gotShmCompletion: (Drawable)d { [XWindowBuffer _gotShmCompletion: d]; } - (void) gotShmCompletion: (Drawable)d { [XWindowBuffer _gotShmCompletion: d]; } #endif // XSHM #endif // BUILD_SERVER = SERVER_x11 - (id) initWithGraphicsPort: (void *)port flipped: (BOOL)flag; { self = [super initWithGraphicsPort: port flipped: flag]; if (self != nil) { [self GSSetDevice: NULL : -1 : -1]; } return self; } @end @implementation OpalContext (Ops) - (BOOL) isCompatibleBitmap: (NSBitmapImageRep*)bitmap { NSString *colorSpaceName; if ([bitmap bitmapFormat] != 0) { return NO; } if ([bitmap isPlanar]) { return NO; } if ([bitmap bitsPerSample] != 8) { return NO; } // FIXME: Allow more image types as soon as the Opal backend handles them correctly colorSpaceName = [bitmap colorSpaceName]; if (![colorSpaceName isEqualToString: NSDeviceRGBColorSpace] && ![colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) { return NO; } else { return YES; } } - (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { OpalSurface *surface; [OGSTATE GSCurrentSurface: &surface : x : y]; if (device) { *device = [surface device]; } } - (void) GSSetDevice: (void *)device : (int)x : (int)y { OpalSurface *surface; /* * The "graphics port" associated to an OpalContext is necessarily a * CGContextRef supplied by the client to back the OpalContext, instead * of having us create the CGContextRef ourselves. * * Since -graphicsPort is overriden from NSGraphicsContext to compute the * CGContextRef for an OpalSurface (which is not initialized yet), we * get the _graphicsPort ivar directly to obtain the supplied CGContextRef * on initialization, and use that to init our surface. */ CGContextRef suppliedContext = self->_graphicsPort; surface = [[OpalSurface alloc] initWithDevice: device context: suppliedContext]; if (x == -1 && y == -1) { NSSize size = [surface size]; x = 0; y = size.height; } [OGSTATE GSSetSurface: surface : x : y]; [surface release]; } - (void) DPSgsave { [OGSTATE DPSgsave]; [super DPSgsave]; } - (void) DPSgrestore { [super DPSgrestore]; [OGSTATE DPSgrestore]; } /** For information about this method, please see description of i-var '_opGState' in OpalGState.h. **/ - (void) DPSsetgstate: (int)gstateID { OPGStateRef previousGState = OPContextCopyGState([OGSTATE CGContext]); [OGSTATE setOPGState: previousGState]; [previousGState release]; // FIXME [super DPSsetgstate: gstateID]; OPGStateRef newGState = [OGSTATE OPGState]; if (newGState) { OPContextSetGState([OGSTATE CGContext], newGState); [OGSTATE setOPGState: nil]; } } - (NSInteger) GSDefineGState { // FIXME return [super GSDefineGState]; } - (void *) graphicsPort { OpalSurface * surface; [OGSTATE GSCurrentSurface: &surface : NULL : NULL]; return [surface CGContext]; } @end gnustep-back-0.29.0/Source/opal/OpalFaceInfo.m000066400000000000000000000027541404163720200210330ustar00rootroot00000000000000/* OpalFaceInfo.m Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: September 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "opal/OpalFaceInfo.h" @implementation OpalFaceInfo - (void) dealloc { if (_fontFace) { CGFontRelease(_fontFace); } [super dealloc]; } - (void *)fontFace { if (!_fontFace) { FcPattern *resolved; resolved = [self matchedPattern]; _fontFace = OPFontCreateWithFcPattern(resolved); FcPatternDestroy(resolved); if (!_fontFace) { NSLog(@"Creating a font face failed %@", _familyName); return NULL; } } return _fontFace; } @end gnustep-back-0.29.0/Source/opal/OpalFontEnumerator.m000066400000000000000000000023651404163720200223270ustar00rootroot00000000000000/* OpalFontEnumerator.m Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: September 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "opal/OpalFontEnumerator.h" #import "opal/OpalFontInfo.h" @implementation OpalFontEnumerator + (Class) faceInfoClass { return [OpalFaceInfo class]; } + (OpalFaceInfo *) fontWithName: (NSString *) name { return (OpalFaceInfo *) [super fontWithName: name]; } @end gnustep-back-0.29.0/Source/opal/OpalFontInfo.m000066400000000000000000000363371404163720200211070ustar00rootroot00000000000000/* OpalFontInfo.m Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: September 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GNUstepBase/Unicode.h" #include #include #include "opal/OpalFontInfo.h" #include "opal/OpalFontEnumerator.h" #include /* #include */ @implementation OpalFontInfo - (CGFloat) _fontUnitToUserSpace: (CGFloat)fontDimension { CGFontRef face = [_faceInfo fontFace]; CGFloat unitsPerEm = CGFontGetUnitsPerEm(face); CGFloat pointSize = matrix[0]; // from GSFontInfo return (fontDimension / unitsPerEm) * pointSize; } - (BOOL) setupAttributes { /* cairo_font_extents_t font_extents; cairo_font_face_t *face; cairo_matrix_t font_matrix; cairo_matrix_t ctm; cairo_font_options_t *options; */ CGFontRef face; CGSize maximumAdvancementCG; CGRect fontBBoxCG; if (![super setupAttributes]) { return NO; } #if 0 /* setting GSFontInfo: * xHeight, pix_width, pix_height */ cairo_matrix_init(&font_matrix, matrix[0], matrix[1], -matrix[2], matrix[3], matrix[4], matrix[5]); //cairo_matrix_scale(&font_matrix, 0.9, 0.9); cairo_matrix_init_identity(&ctm); #endif face = [_faceInfo fontFace]; if (!face) { return NO; } ascender = [self _fontUnitToUserSpace: CGFontGetAscent(face)]; descender = [self _fontUnitToUserSpace: CGFontGetDescent(face)]; xHeight = [self _fontUnitToUserSpace: CGFontGetXHeight(face)]; CGFloat pointSize = matrix[0]; maximumAdvancementCG = OPFontGetMaximumAdvancement(face); maximumAdvancement = NSMakeSize(maximumAdvancementCG.width * pointSize, maximumAdvancementCG.height * pointSize); fontBBoxCG = CGFontGetFontBBox(face); fontBBox = NSMakeRect([self _fontUnitToUserSpace: fontBBoxCG.origin.x], [self _fontUnitToUserSpace: fontBBoxCG.origin.y], [self _fontUnitToUserSpace: fontBBoxCG.size.width], [self _fontUnitToUserSpace: fontBBoxCG.size.height]); CGFloat leading = [self _fontUnitToUserSpace: CGFontGetLeading(face)]; if (xHeight == 0.0) xHeight = ascender * 0.6; // derived from code calculating CGFontGetLeading() value. // we may instead want to extend Opal to include OPFontGetLineHeight(), // containing this code: // cairo_scaled_font_extents(_scaled, &font_extents); // lineHeight = font_extents.height // alternatively: line spacing = (ascent + descent + "external leading") // (internal discussion between ivucica and ericwa, 2013-09-17) lineHeight = leading + ascender + descender; #if 0 // Get default font options options = cairo_font_options_create(); if (cairo_font_options_status(options) != CAIRO_STATUS_SUCCESS) { return NO; } // We must not leave the hinting settings as their defaults, // because if we did, that would mean using the surface defaults // which might or might not use hinting (xlib does by default.) // // Since we make measurements outside of the context of a surface // (-advancementForGlyph:), we need to ensure that the same // hinting settings are used there as when we draw. For now, // just force hinting to be off. cairo_font_options_set_hint_metrics(options, CAIRO_HINT_METRICS_ON); cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE); _scaled = cairo_scaled_font_create(face, &font_matrix, &ctm, options); cairo_font_options_destroy(options); if (cairo_scaled_font_status(_scaled) != CAIRO_STATUS_SUCCESS) { return NO; } cairo_scaled_font_extents(_scaled, &font_extents); if (cairo_scaled_font_status(_scaled) != CAIRO_STATUS_SUCCESS) { return NO; } ascender = font_extents.ascent; descender = -font_extents.descent; xHeight = ascender * 0.6; lineHeight = font_extents.height; maximumAdvancement = NSMakeSize(font_extents.max_x_advance, font_extents.max_y_advance); fontBBox = NSMakeRect(0, descender, maximumAdvancement.width, ascender - descender); /* NSLog(@"Font matrix (%g, %g, %g, %g, %g, %g) type %d", matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], cairo_scaled_font_get_type(_scaled)); NSLog(@"(%@) h=%g a=%g d=%g max=(%g %g) (%g %g)+(%g %g)\n", fontName, xHeight, ascender, descender, maximumAdvancement.width, maximumAdvancement.height, fontBBox.origin.x, fontBBox.origin.y, fontBBox.size.width, fontBBox.size.height); */ #endif return YES; } - (id) initWithFontName: (NSString *)name matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont { self = [super init]; if (!self) return nil; _screenFont = p_screenFont; fontName = [name copy]; memcpy(matrix, fmatrix, sizeof(matrix)); if (_screenFont) { /* Round up; makes the text more legible. */ matrix[0] = ceil(matrix[0]); if (matrix[3] < 0.0) matrix[3] = floor(matrix[3]); else matrix[3] = ceil(matrix[3]); } if (![self setupAttributes]) { RELEASE(self); return nil; } return self; } - (void) dealloc { #if 0 if (_scaled) { cairo_scaled_font_destroy(_scaled); } #endif [super dealloc]; } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { CGFontRef face = [_faceInfo fontFace]; size_t numGlyphs = CGFontGetNumberOfGlyphs(face); return glyph < numGlyphs; } #if 0 static BOOL _cairo_extents_for_NSGlyph(cairo_scaled_font_t *scaled_font, NSGlyph glyph, cairo_text_extents_t *ctext) { unichar ustr[2]; char str[4]; unsigned char *b; unsigned int size = 4; int length = 1; ustr[0] = glyph; ustr[1] = 0; b = (unsigned char *)str; if (!GSFromUnicode(&b, &size, ustr, length, NSUTF8StringEncoding, NULL, GSUniTerminate)) { NSLog(@"Conversion failed for %@", [NSString stringWithCharacters: ustr length: length]); return NO; } cairo_scaled_font_text_extents(scaled_font, str, ctext); return cairo_scaled_font_status(scaled_font) == CAIRO_STATUS_SUCCESS; } #endif - (NSSize) advancementForGlyph: (NSGlyph)glyph { CGFontRef face = [_faceInfo fontFace]; int advance = 0; CGGlyph cgglyph = glyph; CGFontGetGlyphAdvances(face, &cgglyph, 1, &advance); CGFloat advanceUserSpace = [self _fontUnitToUserSpace: advance]; return NSMakeSize(advanceUserSpace, 0); #if 0 cairo_text_extents_t ctext; if (_cachedSizes) { int entry = glyph % _cacheSize; if (_cachedGlyphs[entry] == glyph) { return _cachedSizes[entry]; } if (_cairo_extents_for_NSGlyph(_scaled, glyph, &ctext)) { _cachedGlyphs[entry] = glyph; _cachedSizes[entry] = NSMakeSize(ctext.x_advance, ctext.y_advance); return _cachedSizes[entry]; } } else { if (_cairo_extents_for_NSGlyph(_scaled, glyph, &ctext)) { return NSMakeSize(ctext.x_advance, ctext.y_advance); } } #endif return NSZeroSize; } - (NSGlyph) glyphForCharacter: (unichar)theChar { CGFontRef face = [_faceInfo fontFace]; CGGlyph result = OPFontGetGlyphWithCharacter(face, theChar); //NSLog(@"%s: Mapped '%@' to glyph # %d", __PRETTY_FUNCTION__, str, (int)result); return result; } - (NSGlyph) glyphWithName: (NSString *) glyphName { CGFontRef face = [_faceInfo fontFace]; CGGlyph result = CGFontGetGlyphWithGlyphName(face, glyphName); // NSLog(@"%s: Mapped '%@' to glyph # %d", __PRETTY_FUNCTION__, glyphName, (int)result); return result; } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { #if 0 cairo_text_extents_t ctext; if (_cairo_extents_for_NSGlyph(_scaled, glyph, &ctext)) { return NSMakeRect(ctext.x_bearing, ctext.y_bearing, ctext.width, ctext.height); } #endif return NSMakeRect(0,0,10,10); } - (CGFloat) widthOfString: (NSString *)string { #if 0 cairo_text_extents_t ctext; if (!string) { return 0.0; } cairo_scaled_font_text_extents(_scaled, [string UTF8String], &ctext); if (cairo_scaled_font_status(_scaled) == CAIRO_STATUS_SUCCESS) { return ctext.width; } #endif return 100.0; } - (void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs count: (int)length toBezierPath: (NSBezierPath *)path { #if 0 cairo_format_t format = CAIRO_FORMAT_ARGB32; cairo_surface_t *isurface; cairo_t *ct; int ix = 400; int iy = 400; unsigned char *cdata; int i; unichar ustr[length+1]; char str[3*length+1]; unsigned char *b; unsigned int size = 3*length+1; cairo_status_t status; cairo_matrix_t font_matrix; for (i = 0; i < length; i++) { ustr[i] = glyphs[i]; } ustr[length] = 0; b = (unsigned char *)str; if (!GSFromUnicode(&b, &size, ustr, length, NSUTF8StringEncoding, NULL, GSUniTerminate)) { NSLog(@"Conversion failed for %@", [NSString stringWithCharacters: ustr length: length]); return; } cdata = malloc(sizeof(char) * 4 * ix * iy); if (!cdata) { NSLog(@"Could not allocate drawing space for glyphs"); return; } isurface = cairo_image_surface_create_for_data(cdata, format, ix, iy, 4*ix); status = cairo_surface_status(isurface); if (status != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while creating surface: %s", cairo_status_to_string(status)); cairo_surface_destroy(isurface); free(cdata); return; } ct = cairo_create(isurface); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while creating context: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } // Use flip matrix cairo_matrix_init(&font_matrix, matrix[0], matrix[1], matrix[2], -matrix[3], matrix[4], matrix[5]); cairo_set_font_matrix(ct, &font_matrix); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font matrix: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } cairo_set_font_face(ct, [_faceInfo fontFace]); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font face: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } // Set font options from the scaled font // FIXME: Instead of setting the matrix, setting the face, and setting // the options, we should be using cairo_set_scaled_font { cairo_font_options_t *options = cairo_font_options_create(); cairo_scaled_font_get_font_options(_scaled, options); cairo_set_font_options(ct, options); cairo_font_options_destroy(options); } if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font options: %s", cairo_status_to_string(cairo_status(ct))); cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); return; } if ([path elementCount] > 0) { NSPoint p; p = [path currentPoint]; cairo_move_to(ct, floorf(p.x), floorf(p.y)); } cairo_text_path(ct, str); if (cairo_status(ct) == CAIRO_STATUS_SUCCESS) { cairo_path_t *cpath; cairo_path_data_t *data; cpath = cairo_copy_path(ct); for (i = 0; i < cpath->num_data; i += cpath->data[i].header.length) { data = &cpath->data[i]; switch (data->header.type) { case CAIRO_PATH_MOVE_TO: [path moveToPoint: NSMakePoint(data[1].point.x, data[1].point.y)]; break; case CAIRO_PATH_LINE_TO: [path lineToPoint: NSMakePoint(data[1].point.x, data[1].point.y)]; break; case CAIRO_PATH_CURVE_TO: [path curveToPoint: NSMakePoint(data[3].point.x, data[3].point.y) controlPoint1: NSMakePoint(data[1].point.x, data[1].point.y) controlPoint2: NSMakePoint(data[2].point.x, data[2].point.y)]; break; case CAIRO_PATH_CLOSE_PATH: [path closePath]; break; } } cairo_path_destroy(cpath); } cairo_destroy(ct); cairo_surface_destroy(isurface); free(cdata); #endif } #if 0 - (void) drawGlyphs: (const NSGlyph*)glyphs length: (int)length on: (cairo_t*)ct { cairo_matrix_t font_matrix; unichar ustr[length+1]; char str[3*length+1]; unsigned char *b; int i; unsigned int size = 3*length+1; for (i = 0; i < length; i++) { ustr[i] = glyphs[i]; } ustr[length] = 0; b = (unsigned char *)str; if (!GSFromUnicode(&b, &size, ustr, length, NSUTF8StringEncoding, NULL, GSUniTerminate)) { NSLog(@"Conversion failed for %@", [NSString stringWithCharacters: ustr length: length]); return; } cairo_matrix_init(&font_matrix, matrix[0], matrix[1], -matrix[2], matrix[3], matrix[4], matrix[5]); cairo_set_font_matrix(ct, &font_matrix); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font matrix: %s", cairo_status_to_string(cairo_status(ct))); return; } cairo_set_font_face(ct, [_faceInfo fontFace]); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font face: %s", cairo_status_to_string(cairo_status(ct))); return; } // Set font options from the scaled font // FIXME: Instead of setting the matrix, setting the face, and setting // the options, we should be using cairo_set_scaled_font { cairo_font_options_t *options = cairo_font_options_create(); cairo_scaled_font_get_font_options(_scaled, options); cairo_set_font_options(ct, options); cairo_font_options_destroy(options); } if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error while setting font options: %s", cairo_status_to_string(cairo_status(ct))); return; } cairo_show_text(ct, str); if (cairo_status(ct) != CAIRO_STATUS_SUCCESS) { NSLog(@"Error drawing string: '%s' for string %s", cairo_status_to_string(cairo_status(ct)), str); } } #endif @end gnustep-back-0.29.0/Source/opal/OpalGState.m000066400000000000000000000743131404163720200205500ustar00rootroot00000000000000/* OpalGState.m Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import // NS*ColorSpace #import #import #import "opal/OpalGState.h" #import "opal/OpalSurface.h" #import "opal/OpalFontInfo.h" #define CGCTX [self CGContext] static inline NSString * _CGRectRepr(CGRect rect) { return [NSString stringWithFormat: @"(%g,%g,%g,%g)", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height]; } static inline CGRect _CGRectFromNSRect(NSRect nsrect) { return CGRectMake(nsrect.origin.x, nsrect.origin.y, nsrect.size.width, nsrect.size.height); } static inline NSPoint _NSPointFromCGPoint(CGPoint cgpoint) { return NSMakePoint(cgpoint.x, cgpoint.y); } @implementation OpalGState - (void) dealloc { RELEASE(_opalSurface); RELEASE(_opGState); [super dealloc]; } - (id)copyWithZone: (NSZone *)zone { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); OpalGState * theCopy = (OpalGState *) [super copyWithZone: zone]; CGContextRef cgctx = CGCTX; [_opalSurface retain]; if (cgctx) { theCopy->_opGState = OPContextCopyGState(cgctx); } return theCopy; } - (void) setOffset: (NSPoint)theOffset { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g", self, [self class], __PRETTY_FUNCTION__, theOffset.x, theOffset.y); CGContextRef cgctx = CGCTX; if (cgctx) { OPContextSetCairoDeviceOffset(cgctx, -theOffset.x, theOffset.y - [_opalSurface size].height); } [super setOffset: theOffset]; } - (void) setColor: (device_color_t *)color state: (color_state_t)cState { CGContextRef cgctx = CGCTX; NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); if (cgctx) { if (color->space == hsb_colorspace) { gsColorToRGB(color); } if (color->space == gray_colorspace) { if (cState & COLOR_STROKE) { CGContextSetGrayStrokeColor(cgctx, color->field[0], color->field[AINDEX]); } if (cState & COLOR_FILL) { CGContextSetGrayFillColor(cgctx, color->field[0], color->field[AINDEX]); } } else if (color->space == rgb_colorspace) { if (cState & COLOR_STROKE) { CGContextSetRGBStrokeColor(cgctx, color->field[0], color->field[1], color->field[2], color->field[AINDEX]); } if (cState & COLOR_FILL) { CGContextSetRGBFillColor(cgctx, color->field[0], color->field[1], color->field[2], color->field[AINDEX]); } } else if (color->space == cmyk_colorspace) { if (cState & COLOR_STROKE) { CGContextSetCMYKStrokeColor(cgctx, color->field[0], color->field[1], color->field[2], color->field[3], color->field[AINDEX]); } if (cState & COLOR_FILL) { CGContextSetCMYKFillColor(cgctx, color->field[0], color->field[1], color->field[2], color->field[3], color->field[AINDEX]); } } } [super setColor: color state: cState]; } @end @implementation OpalGState (Ops) - (void) DPSshow: (const char *)s { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextSaveGState(cgctx); CGContextSetRGBFillColor(cgctx, 0, 1, 0, 1); CGContextFillRect(cgctx, CGRectMake(0, 0, strlen(s) * 12, 12)); CGContextRestoreGState(cgctx); } } - (void) GSShowText: (const char *)s : (size_t) length { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextSaveGState(cgctx); CGContextSetRGBFillColor(cgctx, 0, 1, 0, 1); CGContextFillRect(cgctx, CGRectMake(0, 0, length * 12, 12)); CGContextRestoreGState(cgctx); // TODO: implement! } } - (void) GSSetFont: (GSFontInfo *)fontref { const CGFloat * matrix; NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); [super GSSetFont: fontref]; CGContextRef cgctx = CGCTX; if (cgctx) { CGFontRef opalFont = (CGFontRef)[((OpalFontInfo *)fontref)->_faceInfo fontFace]; CGContextSetFont(cgctx, opalFont); CGContextSetFontSize(cgctx, 1); matrix = [fontref matrix]; CGAffineTransform cgAT = CGAffineTransformMake(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); CGContextSetTextMatrix(cgctx, cgAT); } } - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { size_t i; NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { // NSGlyph = unsigned int, CGGlyph = unsigned short CGGlyph cgglyphs[length]; for (i = 0; i < length; i++) { cgglyphs[i] = glyphs[i]; } CGPoint pt = CGContextGetPathCurrentPoint(cgctx); // FIXME: why? pt.y += [self->font defaultLineHeightForFont] * 0.5; CGContextSetTextPosition(cgctx, pt.x, pt.y); CGContextShowGlyphsWithAdvances(cgctx, cgglyphs, (const CGSize *)advances, length); } } - (NSPoint) currentPoint { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGPoint pt = CGContextGetPathCurrentPoint(cgctx); return _NSPointFromCGPoint(pt); } else { return NSZeroPoint; } } - (void) DPSsetdash: (const CGFloat*)pat : (NSInteger)size : (CGFloat)dashOffset { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextSetLineDash(cgctx, dashOffset, pat, size); } } - (void) DPSsetlinecap: (int)linecap { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { // TODO: ensure match of linecap constants between Opal and DPS CGContextSetLineCap(cgctx, linecap); } } - (void) DPSsetlinejoin: (int)linejoin { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextSetLineJoin(cgctx, linejoin); } } - (void) DPSsetlinewidth: (CGFloat) width { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextSetLineWidth(cgctx, width); } } - (void) DPSsetmiterlimit: (CGFloat)miterlimit { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextSetMiterLimit(cgctx, miterlimit); } } - (void) DPSsetstrokeadjust: (int) b { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); // TODO: Opal doesn't implement this private API of Core Graphics } /* Matrix operations */ - (void)DPSconcat: (const CGFloat *)m { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g %g %g %g %g", self, [self class], __PRETTY_FUNCTION__, m[0], m[1], m[2], m[3], m[4], m[5]); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextConcatCTM(cgctx, CGAffineTransformMake(m[0], m[1], m[2], m[3], m[4], m[5])); } [super DPSconcat: m]; } - (void)DPSinitmatrix { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { OPContextSetIdentityCTM(cgctx); } [super DPSinitmatrix]; } - (void)DPSrotate: (CGFloat)angle { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextRotateCTM(cgctx, angle); } [super DPSrotate: angle]; } - (void)DPSscale: (CGFloat)x : (CGFloat)y { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g", self, [self class], __PRETTY_FUNCTION__, x, y); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextScaleCTM(cgctx, x, y); } [super DPSscale: x : y]; } - (void)DPStranslate: (CGFloat)x : (CGFloat)y { NSDebugLLog(@"OpalGState", @"%p (%@): %s - x %g y %g", self, [self class], __PRETTY_FUNCTION__, x, y); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextTranslateCTM(cgctx, x, y); } [super DPStranslate: x: y]; } - (NSAffineTransform *) GSCurrentCTM { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); return [super GSCurrentCTM]; /* CGAffineTransform cgCTM = CGContextGetCTM(CGCTX); NSAffineTransform * affineTransform = [NSAffineTransform transform]; // This depends on CGAffineTransform and NSAffineTransformStruct having // the same in-memory layout. // Here's an elementary check if that is true. // We should probably check this in -back's "configure" script. assert(sizeof(CGAffineTransform) == sizeof(NSAffineTransformStruct)); NSAffineTransformStruct nsCTM = *(NSAffineTransformStruct *)&cgCTM; [affineTransform setTransformStruct: nsCTM]; return affineTransform; */ } - (void) GSSetCTM: (NSAffineTransform *)newCTM { CGContextRef cgctx = CGCTX; if (cgctx) { // This depends on CGAffineTransform and NSAffineTransformStruct having // the same in-memory layout. // Here's an elementary check if that is true. // We should probably check this in -back's "configure" script. assert(sizeof(CGAffineTransform) == sizeof(NSAffineTransformStruct)); NSAffineTransformStruct nsAT = [newCTM transformStruct]; CGAffineTransform cgAT = *(CGAffineTransform *)&nsAT; OPContextSetIdentityCTM(cgctx); CGContextConcatCTM(cgctx, cgAT); } [super GSSetCTM: newCTM]; } - (void) GSConcatCTM: (NSAffineTransform *)newCTM { CGContextRef cgctx = CGCTX; if (cgctx) { assert(sizeof(CGAffineTransform) == sizeof(NSAffineTransformStruct)); NSAffineTransformStruct nsAT = [newCTM transformStruct]; CGAffineTransform cgAT = *(CGAffineTransform *)&nsAT; CGContextConcatCTM(cgctx, cgAT); } [super GSConcatCTM: newCTM]; } // MARK: Path operations // MARK: - - (void) DPSarc: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextAddArc(cgctx, x, y, r, angle1, angle2, YES); } [super DPSarc: x : y : r : angle1 : angle2]; } - (void) DPSarcn: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextAddArc(cgctx, x, y, r, angle1, angle2, NO); } [super DPSarcn: x : y : r : angle1 : angle2]; } - (void)DPSarct: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)r { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextAddArcToPoint(cgctx, x1, y1, x1, y2, r); } [super DPSarct: x1 : y1 : x2 : y2 : r]; } - (void) DPSclip { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextClip(cgctx); } [super DPSnewpath]; } - (void)DPSclosepath { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextClosePath(cgctx); } [super DPSclosepath]; } - (void)DPScurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextAddCurveToPoint(cgctx, x1, y1, x2, y2, x3, y3); } [super DPScurveto: x1 : y1 : x2 : y2 : x3 : y3]; } - (void) DPSeoclip { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextEOClip(cgctx); } [super DPSnewpath]; } - (void) DPSeofill { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextEOFillPath(cgctx); } [super DPSnewpath]; } - (void) DPSfill { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextFillPath(cgctx); } [super DPSnewpath]; } - (void) DPSinitclip { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { OPContextResetClip(cgctx); } } - (void) DPSlineto: (CGFloat) x : (CGFloat) y { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g", self, [self class], __PRETTY_FUNCTION__, x, y); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextAddLineToPoint(cgctx, x, y); } [super DPSlineto: x : y]; } - (void) DPSmoveto: (CGFloat) x : (CGFloat) y { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g", self, [self class], __PRETTY_FUNCTION__, x, y); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextMoveToPoint(cgctx, x, y); } [super DPSmoveto: x : y]; } - (void)DPSnewpath { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextBeginPath(cgctx); } [super DPSnewpath]; } - (void)DPSrcurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { CGContextRef cgctx = CGCTX; if (cgctx) { CGFloat x, y; [self DPScurrentpoint: &x : &y]; x1 += x; y1 += y; x2 += x; y2 += y; x3 += x; y3 += y; CGContextAddCurveToPoint(cgctx, x1, y1, x2, y2, x3, y3); } [super DPSrcurveto: x1 : y1 : x2 : y2 : x3 : y3]; } - (void) DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g %g %g", self, [self class], __PRETTY_FUNCTION__, x, y, w, h); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextClipToRect(cgctx, CGRectMake(x, y, w, h)); } } - (void) DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { NSDebugLLog(@"OpalGState", @"%p (%@): %s - rect %g %g %g %g", self, [self class], __PRETTY_FUNCTION__, x, y, w, h); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextFillRect(cgctx, CGRectMake(x, y, w, h)); } } - (void) DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { CGContextRef cgctx = CGCTX; if (cgctx) { CGContextStrokeRect(cgctx, CGRectMake(x, y, w, h)); } } - (void) DPSrlineto: (CGFloat) x : (CGFloat) y { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g", self, [self class], __PRETTY_FUNCTION__, x, y); CGContextRef cgctx = CGCTX; if (cgctx) { CGFloat x2, y2; [self DPScurrentpoint: &x2 : &y2]; x2 += x; y2 += y; CGContextAddLineToPoint(cgctx, x, y); } [super DPSrlineto: x : y]; } - (void) DPSrmoveto: (CGFloat) x : (CGFloat) y { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %g %g", self, [self class], __PRETTY_FUNCTION__, x, y); CGContextRef cgctx = CGCTX; if (cgctx) { CGFloat x2, y2; [self DPScurrentpoint: &x2 : &y2]; x2 += x; y2 += y; CGContextMoveToPoint(cgctx, x2, y2); } [super DPSrmoveto: x : y]; } - (void) DPSstroke { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextStrokePath(cgctx); } [super DPSnewpath]; } - (void) GSSendBezierPath: (NSBezierPath *)newpath { NSInteger count = [newpath elementCount]; NSInteger i; SEL elmsel = @selector(elementAtIndex:associatedPoints:); NSBezierPathElement (*elmidx)(id, SEL, NSInteger, NSPoint*) = (NSBezierPathElement (*)(id, SEL, NSInteger, NSPoint*))[newpath methodForSelector: elmsel]; [super GSSendBezierPath: newpath]; CGContextRef cgctx = CGCTX; if (cgctx) { CGContextBeginPath(cgctx); for (i = 0; i < count; i++) { NSBezierPathElement type; NSPoint points[3]; type = (NSBezierPathElement)(*elmidx)(newpath, elmsel, i, points); switch(type) { case NSMoveToBezierPathElement: CGContextMoveToPoint(cgctx, points[0].x, points[0].y); break; case NSLineToBezierPathElement: CGContextAddLineToPoint(cgctx, points[0].x, points[0].y); break; case NSCurveToBezierPathElement: CGContextAddCurveToPoint(cgctx, points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y); break; case NSClosePathBezierPathElement: CGContextClosePath(cgctx); break; default: break; } } } } - (NSDictionary *) GSReadRect: (NSRect)r { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); return nil; } - (void) DPSimage: (NSAffineTransform *)matrix : (NSInteger)pixelsWide : (NSInteger)pixelsHigh : (NSInteger)bitsPerSample // is this used correctly ? : (NSInteger)samplesPerPixel // < unused : (NSInteger)bitsPerPixel : (NSInteger)bytesPerRow : (BOOL)isPlanar // < unused : (BOOL)hasAlpha : (NSString *)colorSpaceName : (const unsigned char *const[5])data { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); NSDebugLLog(@"OpalGState", @" %s - %@ - cgctx %@", __PRETTY_FUNCTION__, _opalSurface, [self CGContext]); NSDebugLLog(@"OpalGState", @"Bits per component : bitspersample = %d", bitsPerSample); NSDebugLLog(@"OpalGState", @"Bits per pixel : bitsperpixel = %d", bitsPerPixel); NSDebugLLog(@"OpalGState", @" : samplesperpixel = %d", samplesPerPixel); NSDebugLLog(@"OpalGState", @"tf: %@ x %@", matrix, [self GSCurrentCTM]); // TODO: // We may want to normalize colorspace names between Opal and -gui, // to avoid this conversion? if ([colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) colorSpaceName = kCGColorSpaceGenericRGB; // SRGB? else if ([colorSpaceName isEqualToString: NSDeviceRGBColorSpace]) colorSpaceName = kCGColorSpaceGenericRGB; else if ([colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) colorSpaceName = kCGColorSpaceGenericGray; else if ([colorSpaceName isEqualToString: NSDeviceWhiteColorSpace]) colorSpaceName = kCGColorSpaceGenericGray; else { NSLog(@"Opal backend: Unhandled colorspace: %@", colorSpaceName); return; } CGContextRef cgctx = CGCTX; if (cgctx) { // This depends on CGAffineTransform and NSAffineTransformStruct having // the same in-memory layout. // Here's an elementary check if that is true. // We should probably check this in -back's "configure" script. assert(sizeof(CGAffineTransform) == sizeof(NSAffineTransformStruct)); NSAffineTransformStruct nsAT = [matrix transformStruct]; CGAffineTransform cgAT = *(CGAffineTransform *)&nsAT; CGContextSaveGState(cgctx); CGContextConcatCTM(cgctx, cgAT); CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(colorSpaceName); NSData *nsData = [NSData dataWithBytesNoCopy: (void*)*data length: pixelsHigh * bytesPerRow freeWhenDone: NO]; CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(nsData); CGImageRef img = CGImageCreate(pixelsWide, pixelsHigh, bitsPerSample, bitsPerPixel, bytesPerRow, colorSpace, kCGBitmapByteOrder32Big | (hasAlpha ? kCGImageAlphaPremultipliedLast : 0), dataProvider, NULL, /* const CGFloat decode[] is what? */ false, /* shouldInterpolate? */ kCGRenderingIntentDefault ); if (img != nil) { CGContextDrawImage(cgctx, CGRectMake(0, 0, pixelsWide, pixelsHigh), img); } CGImageRelease(img); CGDataProviderRelease(dataProvider); CGColorSpaceRelease(colorSpace); CGContextRestoreGState(cgctx); } } - (void) compositeGState: (OpalGState *)source fromRect: (NSRect)srcRect toPoint: (NSPoint)destPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta destCGContext: (CGContextRef) destCGContext { // NOTE: This method seems to need to paint to X11 context, too. NSDebugLLog(@"OpalGState", @"%p (%@): %s - from %@ of gstate %p (cgctx %p) to %@ of %p (cgctx %p)", self, [self class], __PRETTY_FUNCTION__, NSStringFromRect(srcRect), source, [source CGContext], NSStringFromPoint(destPoint), self, [self CGContext]); NSSize ssize = [source->_opalSurface size]; srcRect = [source rectInMatrixSpace: srcRect]; destPoint = [self pointInMatrixSpace: destPoint]; srcRect.origin.y = ssize.height-srcRect.origin.y-srcRect.size.height; CGRect srcCGRect = _CGRectFromNSRect(srcRect); CGRect destCGRect = CGRectMake(destPoint.x, destPoint.y, srcRect.size.width, srcRect.size.height); NSDebugLLog(@"OpalGState", @"Source cgctx: %p, self: %p - from %@ to %@ with ctm %@", [source CGContext], self, _CGRectRepr(srcCGRect), _CGRectRepr(destCGRect), [self GSCurrentCTM]); // FIXME: this presumes that the backing CGContext of 'source' is // an OpalSurface with a backing CGBitmapContext CGImageRef backingImage = CGBitmapContextCreateImage([source CGContext]); CGImageRef subImage = CGImageCreateWithImageInRect(backingImage, srcCGRect); CGContextSaveGState(destCGContext); OPContextSetIdentityCTM(destCGContext); OPContextSetCairoDeviceOffset(destCGContext, 0, 0); // TODO: this ignores op // TODO: this ignores delta CGContextDrawImage(destCGContext, destCGRect, subImage); OPContextSetCairoDeviceOffset(CGCTX, -offset.x, offset.y - [_opalSurface size].height); CGContextRestoreGState(destCGContext); CGImageRelease(subImage); CGImageRelease(backingImage); } - (void) compositeGState: (OpalGState *)source fromRect: (NSRect)srcRect toPoint: (NSPoint)destPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef destContexts[2] = { [_opalSurface backingCGContext], [_opalSurface x11CGContext] }; /* x11 context needs to have correct ctm applied */ CGContextSaveGState([_opalSurface x11CGContext]); OPContextSetIdentityCTM([_opalSurface x11CGContext]); CGContextConcatCTM([_opalSurface x11CGContext], CGContextGetCTM([_opalSurface backingCGContext])); int i; for (i = 0; i < 1; i++) // not drawing into x11cgctx after all. { CGContextRef ctx = destContexts[i]; [self compositeGState: source fromRect: srcRect toPoint: destPoint op: op fraction: delta destCGContext: ctx]; } /* restore x11 context's previous state */ CGContextRestoreGState([_opalSurface x11CGContext]); } /** Unlike -compositeGState, -drawGSstate fully respects the AppKit CTM but doesn't support to use the receiver cairo target as the source. */ /* This method is required if -[OpalContext supportsDrawGState] returns YES */ - (void) drawGState: (OpalGState *)source fromRect: (NSRect)srcRect toPoint: (NSPoint)destPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta destCGContext: (CGContextRef)destCGContext { // TODO: CairoGState has a lot more complex implementation. // For now, we'll just call compositeGState and live // with the fact that CTM is not respected. NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGRect srcCGRect = CGRectMake(srcRect.origin.x, srcRect.origin.y, srcRect.size.width, srcRect.size.height); CGRect destCGRect = CGRectMake(destPoint.x, destPoint.y, srcRect.size.width, srcRect.size.height); CGImageRef backingImage = CGBitmapContextCreateImage([source CGContext]); CGImageRef subImage = CGImageCreateWithImageInRect(backingImage, srcCGRect); // TODO: this ignores op // TODO: this ignores delta CGContextDrawImage(destCGContext, destCGRect, subImage); CGImageRelease(subImage); CGImageRelease(backingImage); } - (void) drawGState: (OpalGState *)source fromRect: (NSRect)srcRect toPoint: (NSPoint)destPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGContextRef destContexts[2] = { [_opalSurface backingCGContext], [_opalSurface x11CGContext] }; int i; for (i = 0; i < 1; i++) { CGContextRef ctx = destContexts[i]; [self drawGState: source fromRect: srcRect toPoint: destPoint op: op fraction: delta destCGContext: ctx]; } } - (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %@", self, [self class], __PRETTY_FUNCTION__, NSStringFromRect(aRect)); CGContextRef cgctx = CGCTX; if (cgctx) { CGContextSaveGState(cgctx); OPContextSetIdentityCTM(cgctx); // FIXME: Set operator CGContextFillRect(cgctx, CGRectMake(aRect.origin.x, [_opalSurface size].height - aRect.origin.y, aRect.size.width, aRect.size.height)); CGContextRestoreGState(cgctx); } } @end // MARK: Initialization methods // MARK: - @implementation OpalGState (InitializationMethods) - (void) DPSinitgraphics { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); [super DPSinitgraphics]; [self DPSinitmatrix]; } /* SOME NOTES: - GState approximates a cairo context: a drawing state. - Surface approximates a cairo surface: a place to draw things. - CGContext seems to be a mix of these two: surface + state. Should we unite these two somehow? Can we unite these two somehow? Possibly not. We still need to support bitmap contexts, pdf contexts etc which contain both state and contents. So, we will still need surfaces (containing CGContexts, hence including state) and GState as a wrapper around whatever context happens to be the current one. */ /** Makes the specified surface active in the current graphics state, ready for use. Also, sets the device offset to specified coordinates. **/ - (void) GSSetSurface: (OpalSurface *)opalSurface : (int)x : (int)y { NSDebugLLog(@"OpalGState", @"%p (%@): %s - %@ %d %d", self, [self class], __PRETTY_FUNCTION__, opalSurface, x, y); ASSIGN(_opalSurface, opalSurface); [self setOffset: NSMakePoint(x, y)]; [self DPSinitgraphics]; } - (void) GSCurrentSurface: (OpalSurface **)surface : (int *)x : (int *)y { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); if (x) *x = offset.x; if (y) *y = offset.y; if (surface) { *surface = _opalSurface; } } @end // MARK: Accessors // MARK: - @implementation OpalGState (Accessors) - (CGContextRef) CGContext { if (!_opalSurface) { NSDebugMLLog(@"OpalGState", @"No OpalSurface"); return nil; } else { CGContextRef context = [_opalSurface CGContext]; if (!context) { NSDebugMLLog(@"OpalGState", @"No OpalSurface CGContext"); return nil; } return context; } } - (OPGStateRef) OPGState { return _opGState; } - (void) setOPGState: (OPGStateRef)opGState { ASSIGN(_opGState, opGState); } @end // MARK: Non-required methods // MARK: - @implementation OpalGState (NonrequiredMethods) - (void) DPSgsave { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); if (CGCTX) { CGContextSaveGState(CGCTX); } } - (void) DPSgrestore { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); if (CGCTX) { CGContextRestoreGState(CGCTX); } } @end @implementation OpalGState (PatternColor) - (void *) saveClip { NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); CGRect *r = calloc(sizeof(CGRect), 1); *r = CGContextGetClipBoundingBox(CGCTX); return r; } - (void) restoreClip: (void *)savedClip { CGRect *r = (CGRect *)savedClip; NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__); OPContextResetClip(CGCTX); if (!CGRectIsNull(*r)) { CGContextClipToRect(CGCTX, *r); } free(savedClip); } @end gnustep-back-0.29.0/Source/opal/OpalPDFSurface.m000066400000000000000000000000001404163720200212610ustar00rootroot00000000000000gnustep-back-0.29.0/Source/opal/OpalPSSurface.m000066400000000000000000000000001404163720200211720ustar00rootroot00000000000000gnustep-back-0.29.0/Source/opal/OpalSurface.m000066400000000000000000000167631404163720200207560ustar00rootroot00000000000000/* OpalSurface.m Copyright (C) 2013 Free Software Foundation, Inc. Author: Ivan Vucica Date: June 2013 This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "opal/OpalSurface.h" #import "x11/XGServerWindow.h" /* TODO: expose these from within opal */ extern CGContextRef OPX11ContextCreate(Display *display, Drawable drawable); extern void OPContextSetSize(CGContextRef ctx, CGSize s); /* Taken from GSQuartzCore's CABackingStore */ static CGContextRef createCGBitmapContext(int pixelsWide, int pixelsHigh) { CGContextRef context = NULL; CGColorSpaceRef colorSpace; int bitmapBytesPerRow; bitmapBytesPerRow = (pixelsWide * 4); colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); // Let CGBitmapContextCreate() allocate the memory. // This should be good under Cocoa too. context = CGBitmapContextCreate(NULL, pixelsWide, pixelsHigh, 8, // bits per component bitmapBytesPerRow, colorSpace, kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst); // Note: our use of premultiplied alpha means that we need to // do alpha blending using: // GL_SRC_ALPHA, GL_ONE CGColorSpaceRelease(colorSpace); if (context == NULL) { NSLog(@"Context not created!"); return NULL; } return context; } @implementation OpalSurface - (void) createCGContextsWithSuppliedBackingContext: (CGContextRef)ctx { int pixelsWide; int pixelsHigh; // FIXME: this method and class presumes we are being passed // a window device. if (_x11CGContext || _backingCGContext) { NSLog(@"FIXME: Replacement of OpalSurface %p's CGContexts (x11=%p,backing=%p) without transfer of gstate", self, _x11CGContext, _backingCGContext); } if (ctx) { _x11CGContext = ctx; pixelsWide = CGBitmapContextGetWidth(ctx); pixelsHigh = CGBitmapContextGetHeight(ctx); } else { Display * display = _gsWindowDevice->display; Window window = _gsWindowDevice->ident; _x11CGContext = OPX11ContextCreate(display, window); pixelsWide = _gsWindowDevice->buffer_width; pixelsHigh = _gsWindowDevice->buffer_height; // Ask XGServerWindow to call +[OpalContext handleExposeRect:forDriver:] // to let us handle the back buffer -> front buffer copy using Opal. _gsWindowDevice->gdriverProtocol |= GDriverHandlesExpose | GDriverHandlesBacking; _gsWindowDevice->gdriver = self; } #if 0 if (_gsWindowDevice->type == NSBackingStoreNonretained) { // Don't double-buffer: // use the window surface as the drawing destination. } else #else #warning All windows have to be doublebuffered #endif { // Do double-buffer: // Create a similar surface to the window which supports alpha _backingCGContext = createCGBitmapContext(pixelsWide, pixelsHigh); } NSDebugLLog(@"OpalSurface", @"Created CGContexts: X11=%p, backing=%p, width=%d height=%d", _x11CGContext, _backingCGContext, pixelsWide, pixelsHigh); } // FIXME: *VERY* bad things will happen if a non-bitmap // context is passed here. - (id) initWithDevice: (void *)device context: (CGContextRef)ctx { self = [super init]; if (!self) return nil; // FIXME: this method and class presumes we are being passed // a window device. _gsWindowDevice = (gswindow_device_t *) device; [self createCGContextsWithSuppliedBackingContext: ctx]; return self; } - (void *) device { return _gsWindowDevice; } - (CGContextRef) CGContext { return _backingCGContext ? _backingCGContext : _x11CGContext; } - (CGContextRef) backingCGContext { return _backingCGContext; } - (CGContextRef) x11CGContext { return _x11CGContext; } - (void) handleExposeRect: (NSRect)rect { NSDebugLLog(@"OpalSurface", @"handleExposeRect %@", NSStringFromRect(rect)); if (!_backingCGContext) { return; } CGImageRef backingImage = CGBitmapContextCreateImage(_backingCGContext); if (!backingImage) // FIXME: writing a nil image fails with Opal return; CGRect cgRect = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); cgRect = CGRectIntegral(cgRect); cgRect = CGRectIntersection(cgRect, CGRectMake(0, 0, CGImageGetWidth(backingImage), CGImageGetHeight(backingImage))); CGRect subimageCGRect = cgRect; CGImageRef subImage = CGImageCreateWithImageInRect(backingImage, subimageCGRect); CGContextSaveGState(_x11CGContext); OPContextResetClip(_x11CGContext); OPContextSetIdentityCTM(_x11CGContext); cgRect.origin.y = [self size].height - cgRect.origin.y - cgRect.size.height; NSDebugLLog(@"OpalSurface", @" ... actually from %@ to %@", NSStringFromRect(*(NSRect *)&subimageCGRect), NSStringFromRect(*(NSRect *)&cgRect)); CGContextDrawImage(_x11CGContext, cgRect, subImage); #if 0 #warning Saving debug images [self _saveImage: backingImage withPrefix:@"/tmp/opalback-backing-" size: CGSizeZero]; [self _saveImage: subImage withPrefix:@"/tmp/opalback-subimage-" size: subimageCGRect.size ]; #endif CGImageRelease(backingImage); CGImageRelease(subImage); CGContextRestoreGState(_x11CGContext); } - (void) _saveImage: (CGImageRef) img withPrefix: (NSString *) prefix size: (CGSize) size { #if 1 #warning Opal bug: cannot properly save subimage created with CGImageCreateWithImageInRect() if (size.width != 0 || size.height != 0) { CGContextRef tmp = createCGBitmapContext(size.width, size.height); CGContextDrawImage(tmp, CGRectMake(0, 0, size.width, size.height), img); img = CGBitmapContextCreateImage(tmp); [(id)img autorelease]; } #endif // FIXME: Opal tries to access -path from CFURLRef //CFURLRef fileUrl = CFURLCreateWithFileSystemPath(NULL, @"/tmp/opalback.jpg", kCFURLPOSIXPathStyle, NO); NSString * path = [NSString stringWithFormat: @"%@%dx%d.png", prefix, CGImageGetWidth(img), CGImageGetHeight(img)]; CFURLRef fileUrl = (CFURLRef)[[NSURL fileURLWithPath: path] retain]; NSLog(@"FileURL %@", fileUrl); //CGImageDestinationRef outfile = CGImageDestinationCreateWithURL(fileUrl, @"public.jpeg"/*kUTTypeJPEG*/, 1, NULL); CGImageDestinationRef outfile = CGImageDestinationCreateWithURL(fileUrl, @"public.png"/*kUTTypePNG*/, 1, NULL); CGImageDestinationAddImage(outfile, img, NULL); CGImageDestinationFinalize(outfile); CFRelease(fileUrl); CFRelease(outfile); } - (BOOL) isDrawingToScreen { // TODO: stub return YES; } - (NSSize) size { return NSMakeSize(CGBitmapContextGetWidth(_backingCGContext), CGBitmapContextGetHeight(_backingCGContext)); } @end gnustep-back-0.29.0/Source/wayland/000077500000000000000000000000001404163720200170635ustar00rootroot00000000000000gnustep-back-0.29.0/Source/wayland/GNUmakefile000066400000000000000000000031461404163720200211410ustar00rootroot00000000000000# # Main makefile for GNUstep Backend wayland # # Copyright (C) 2020 Free Software Foundation, Inc. # # Author: Adam Fedor # Author: Sergio L. Pascual # Author: Ladislav Michl # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make # The library to be compiled, as a library or as a bundle SUBPROJECT_NAME=wayland wayland_LOCALIZED_RESOURCE_FILES = \ # The C source files to be compiled wayland_C_FILES = \ xdg-shell-protocol.c \ # The Objective-C source files to be compiled wayland_OBJC_FILES = \ WaylandServer.m \ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/wayland/GNUmakefile.preamble000066400000000000000000000032021404163720200227200ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2020 Free Software Foundation, Inc. # # Author: Adam Fedor # Author: Sergio L. Pascual # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS = # Additional library directories the linker should search ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/wayland/README.md000066400000000000000000000027651404163720200203540ustar00rootroot00000000000000# Wayland backend for GNUstep This directory (along with `Headers/wayland/`, and a file in `Source/cairo/` and `Headers/cairo`) contains the Wayland backend for GNUstep GUI. This display server backend depends on Cairo graphics backend; it will currently not work with any other combination. As of April 2020, it is incomplete and broken. Help getting it functional will be appreciated. ## Known issues Last updated 25 April 2020: * Under Weston, some backing Cairo surfaces, which should not be visible in the compositor, are nonetheless drawn randomly onto the screen. * Backing view surfaces may never get blitted onto the main window. * After a while, Weston assumes that the application is not responding (there is a spinner when hovering over the windows, and the surfaces can be rotated by holding the right mouse button). Some events still get delivered, visible in the debug output, but otherwise the application appears frozen. ## Use on Debian As of April 2020, it requires the stable XDG Shell protocol to be available in the compositor you may be using. Weston included in Debian buster does _not_ include the stable XDG Shell protocol; this was only checked into Weston in February 2019, and seemingly released with Weston 6, which does not ship in Debian buster. ## Regenerating protocol files To regenerate protocol sources from protocol IDLs in XML format, please use `wayland-regenerate.sh`. Paths to the XML files are hardcoded to the values on a Debian testing system. gnustep-back-0.29.0/Source/wayland/WaylandServer.m000066400000000000000000001331241404163720200220330ustar00rootroot00000000000000/* -*- mode:ObjC -*- WaylandServer - Wayland Server Class Copyright (C) 2020 Free Software Foundation, Inc. Author: Sergio L. Pascual Date: February 2016 This file is part of the GNU Objective C Backend Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "wayland/WaylandServer.h" static void handle_geometry(void *data, struct wl_output *wl_output, int x, int y, int physical_width, int physical_height, int subpixel, const char *make, const char *model, int transform) { NSDebugLog(@"handle_geometry"); struct output *output = data; output->alloc_x = x; output->alloc_y = y; output->transform = transform; if (output->make) free(output->make); output->make = strdup(make); if (output->model) free(output->model); output->model = strdup(model); } static void handle_done(void *data, struct wl_output *wl_output) { NSDebugLog(@"handle_done"); } static void handle_scale(void *data, struct wl_output *wl_output, int32_t scale) { NSDebugLog(@"handle_scale"); struct output *output = data; output->scale = scale; } static void handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, int width, int height, int refresh) { NSDebugLog(@"handle_mode"); struct output *output = data; if (flags & WL_OUTPUT_MODE_CURRENT) { output->width = width; output->height = height /*- 30*/; NSDebugLog(@"handle_mode output=%dx%d", width, height); /* XXX - Should we implement this? if (display->output_configure_handler) (*display->output_configure_handler) (output, display->user_data); */ } } static const struct wl_output_listener output_listener = { handle_geometry, handle_mode, handle_done, handle_scale }; /* static void destroy_output(WaylandConfig *wlconfig, uint32_t id) { struct output *output; wl_list_for_each(output, &wlconfig->output_list, link) { if (output->server_output_id == id) { wl_output_destroy(output->output); wl_list_remove(&output->link); free(output); wlconfig->output_count--; break; } } } */ static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w) { NSDebugLog(@"pointer_handle_enter"); if (!surface) { NSDebugLog(@"no surface"); return; } WaylandConfig *wlconfig = data; struct window *window = wl_surface_get_user_data(surface); float sx = wl_fixed_to_double(sx_w); float sy = wl_fixed_to_double(sy_w); [GSCurrentServer() initializeMouseIfRequired]; wlconfig->pointer.x = sx; wlconfig->pointer.y = sy; wlconfig->pointer.focus = window; // FIXME: Send NSMouseEntered event. } static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) { NSDebugLog(@"pointer_handle_leave"); if (!surface) { NSDebugLog(@"no surface"); return; } WaylandConfig *wlconfig = data; struct window *window = wl_surface_get_user_data(surface); [GSCurrentServer() initializeMouseIfRequired]; if (wlconfig->pointer.focus->window_id == window->window_id) { wlconfig->pointer.focus = NULL; wlconfig->pointer.serial = 0; } // FIXME: Send NSMouseExited event. } static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) { WaylandConfig *wlconfig = data; struct window *window; float sx = wl_fixed_to_double(sx_w); float sy = wl_fixed_to_double(sy_w); NSDebugLog(@"pointer_handle_motion: %fx%f", sx, sy); [GSCurrentServer() initializeMouseIfRequired]; if (wlconfig->pointer.focus && wlconfig->pointer.serial) { window = wlconfig->pointer.focus; NSEvent *event; NSEventType eventType; NSPoint eventLocation; NSGraphicsContext *gcontext; unsigned int eventFlags; float deltaX = sx - window->wlconfig->pointer.x; float deltaY = sy - window->wlconfig->pointer.y; NSDebugLog(@"obtaining locations: wayland=%fx%f pointer=%fx%f", sx, sy, window->wlconfig->pointer.x, window->wlconfig->pointer.y); gcontext = GSCurrentContext(); eventLocation = NSMakePoint(sx, window->height - sy); eventFlags = 0; eventType = NSLeftMouseDragged; NSDebugLog(@"sending pointer delta: %fx%f, window=%d", deltaX, deltaY, window->window_id); event = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval) time / 1000.0 windowNumber: (int)window->window_id context: gcontext eventNumber: time clickCount: 1 pressure: 1.0 buttonNumber: 0 /* FIXME */ deltaX: deltaX deltaY: deltaY deltaZ: 0.]; [GSCurrentServer() postEvent: event atStart: NO]; } wlconfig->pointer.x = sx; wlconfig->pointer.y = sy; } static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w) { NSDebugLog(@"pointer_handle_button: button=%d", button); WaylandConfig *wlconfig = data; NSEvent *event; NSEventType eventType; NSPoint eventLocation; NSGraphicsContext *gcontext; unsigned int eventFlags; float deltaX = 0.0; float deltaY = 0.0; int clickCount = 1; int tick; int buttonNumber; enum wl_pointer_button_state state = state_w; struct window *window = wlconfig->pointer.focus; [GSCurrentServer() initializeMouseIfRequired]; gcontext = GSCurrentContext(); eventLocation = NSMakePoint(wlconfig->pointer.x, window->height - wlconfig->pointer.y); eventFlags = 0; if (state == WL_POINTER_BUTTON_STATE_PRESSED) { if (button == wlconfig->pointer.last_click_button && time - wlconfig->pointer.last_click_time < 300 && abs(wlconfig->pointer.x - wlconfig->pointer.last_click_x) < 3 && abs(wlconfig->pointer.y - wlconfig->pointer.last_click_y) < 3) { NSDebugLog(@"handle_button HIT: b=%d t=%d x=%f y=%f", button, time, wlconfig->pointer.x, wlconfig->pointer.y); wlconfig->pointer.last_click_time = 0; clickCount++; } else { NSDebugLog(@"handle_button MISS: b=%d t=%d x=%f y=%f", button, time, wlconfig->pointer.x, wlconfig->pointer.y); wlconfig->pointer.last_click_button = button; wlconfig->pointer.last_click_time = time; wlconfig->pointer.last_click_x = wlconfig->pointer.x; wlconfig->pointer.last_click_y = wlconfig->pointer.y; } switch (button) { case BTN_LEFT: eventType = NSLeftMouseDown; break; case BTN_RIGHT: eventType = NSRightMouseDown; break; case BTN_MIDDLE: eventType = NSOtherMouseDown; break; // TODO: handle BTN_SIDE, BTN_EXTRA, BTN_FORWARD, BTN_BACK and other // constants in libinput. // We may just want to send NSOtherMouseDown and populate buttonNumber // with the libinput constant? } wlconfig->pointer.serial = serial; } else if (state == WL_POINTER_BUTTON_STATE_RELEASED) { switch (button) { case BTN_LEFT: eventType = NSLeftMouseUp; break; case BTN_RIGHT: eventType = NSRightMouseUp; break; case BTN_MIDDLE: eventType = NSOtherMouseUp; break; } wlconfig->pointer.serial = 0; } else { NSDebugLog(@"unhandled wayland pointer state 0x%02x", state); return; } /* FIXME: unlike in _motion and _axis handlers, the argument used in _button is the "serial" of the event, not passed and unavailable in _motion and _axis handlers. Is it allowed to pass "serial" as the eventNumber: in _button handler, but "time" as the eventNumber: in the _motion and _axis handlers? */ tick = serial; NSDebugLog(@"sending pointer event at: %fx%f, window=%d", wlconfig->pointer.x, wlconfig->pointer.y, window->window_id); /* FIXME: X11 backend uses the XGetPointerMapping()-returned values from its map_return argument as constants for buttonNumber. As the variant with buttonNumber: seems to be a GNUstep extension, and the value internal, it might be ok to just provide libinput constant as we're doing here. If this is truly correct, please update this comment to document the correctness of doing so. */ buttonNumber = button; event = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval) time / 1000.0 windowNumber: (int)window->window_id context: gcontext eventNumber: tick clickCount: clickCount pressure: 1.0 buttonNumber: buttonNumber deltaX: deltaX /* FIXME unused */ deltaY: deltaY /* FIXME unused */ deltaZ: 0.]; [GSCurrentServer() postEvent: event atStart: NO]; } static void pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { NSDebugLog(@"pointer_handle_axis: axis=%d value=%g", axis, wl_fixed_to_double(value)); WaylandConfig *wlconfig = data; NSEvent *event; NSEventType eventType; NSPoint eventLocation; NSGraphicsContext *gcontext; unsigned int eventFlags; float deltaX = 0.0; float deltaY = 0.0; int clickCount = 1; int buttonNumber; struct window *window = wlconfig->pointer.focus; [GSCurrentServer() initializeMouseIfRequired]; gcontext = GSCurrentContext(); eventLocation = NSMakePoint(wlconfig->pointer.x, window->height - wlconfig->pointer.y); eventFlags = 0; /* FIXME: we should get axis_source out of wl_pointer; however, the wl_pointer is not defined in wayland-client.h. How does one get the axis_source out of it to confirm the source is the physical mouse wheel? */ #if 0 if (pointer->axis_source != WL_POINTER_AXIS_SOURCE_WHEEL) return; #endif float mouse_scroll_multiplier = wlconfig->mouse_scroll_multiplier; /* For smooth-scroll events, we're not doing any cross-event or delta calculations, as is done in button event handling. */ switch(axis) { case WL_POINTER_AXIS_VERTICAL_SCROLL: eventType = NSScrollWheel; deltaY = wl_fixed_to_double(value) * wlconfig->mouse_scroll_multiplier; case WL_POINTER_AXIS_HORIZONTAL_SCROLL: eventType = NSScrollWheel; deltaX = wl_fixed_to_double(value) * wlconfig->mouse_scroll_multiplier; } NSDebugLog(@"sending pointer scroll at: %fx%f, value %fx%f, window=%d", wlconfig->pointer.x, wlconfig->pointer.y, deltaX, deltaY, window->window_id); /* FIXME: X11 backend uses the XGetPointerMapping()-returned values from its map_return argument as constants for buttonNumber. As the variant with buttonNumber: seems to be a GNUstep extension, and the value internal, it might be ok to just not provide any value here. If this is truly correct, please update this comment to document the correctness of doing so. */ buttonNumber = 0; event = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval) time / 1000.0 windowNumber: (int)window->window_id context: gcontext eventNumber: time clickCount: clickCount pressure: 1.0 buttonNumber: buttonNumber deltaX: deltaX deltaY: deltaY deltaZ: 0.]; [GSCurrentServer() postEvent: event atStart: NO]; } static const struct wl_pointer_listener pointer_listener = { pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, }; static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) { NSDebugLog(@"keyboard_handle_keymap"); WaylandConfig *wlconfig = data; struct xkb_keymap *keymap; struct xkb_state *state; char *map_str; if (!data) { close(fd); return; } if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { close(fd); return; } map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (map_str == MAP_FAILED) { close(fd); return; } wlconfig->xkb_context = xkb_context_new(0); if (wlconfig->xkb_context == NULL) { fprintf(stderr, "Failed to create XKB context\n"); return; } keymap = xkb_keymap_new_from_string(wlconfig->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, 0); munmap(map_str, size); close(fd); if (!keymap) { fprintf(stderr, "failed to compile keymap\n"); return; } state = xkb_state_new(keymap); if (!state) { fprintf(stderr, "failed to create XKB state\n"); xkb_keymap_unref(keymap); return; } xkb_keymap_unref(wlconfig->xkb.keymap); xkb_state_unref(wlconfig->xkb.state); wlconfig->xkb.keymap = keymap; wlconfig->xkb.state = state; wlconfig->xkb.control_mask = 1 << xkb_keymap_mod_get_index(wlconfig->xkb.keymap, "Control"); wlconfig->xkb.alt_mask = 1 << xkb_keymap_mod_get_index(wlconfig->xkb.keymap, "Mod1"); wlconfig->xkb.shift_mask = 1 << xkb_keymap_mod_get_index(wlconfig->xkb.keymap, "Shift"); } static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { NSDebugLog(@"keyboard_handle_enter"); } static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) { NSDebugLog(@"keyboard_handle_leave"); } static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { NSDebugLog(@"keyboard_handle_modifiers"); WaylandConfig *wlconfig = data; xkb_mod_mask_t mask; /* If we're not using a keymap, then we don't handle PC-style modifiers */ if (!wlconfig->xkb.keymap) return; xkb_state_update_mask(wlconfig->xkb.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); mask = xkb_state_serialize_mods(wlconfig->xkb.state, XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED); wlconfig->modifiers = 0; if (mask & wlconfig->xkb.control_mask) wlconfig->modifiers |= NSCommandKeyMask; if (mask & wlconfig->xkb.alt_mask) wlconfig->modifiers |= NSAlternateKeyMask; if (mask & wlconfig->xkb.shift_mask) wlconfig->modifiers |= NSShiftKeyMask; } static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state_w) { NSDebugLog(@"keyboard_handle_key: %d", key); WaylandConfig *wlconfig = data; uint32_t code, num_syms; enum wl_keyboard_key_state state = state_w; const xkb_keysym_t *syms; xkb_keysym_t sym; struct window *window = wlconfig->pointer.focus; if (!window) return; code = 0; if (key == 28) { sym = NSCarriageReturnCharacter; } else if (key == 14) { sym = NSDeleteCharacter; } else { code = key + 8; num_syms = xkb_state_key_get_syms(wlconfig->xkb.state, code, &syms); sym = XKB_KEY_NoSymbol; if (num_syms == 1) sym = syms[0]; } NSString *s = [NSString stringWithUTF8String: &sym]; NSEventType eventType; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { eventType = NSKeyDown; } else { eventType = NSKeyUp; } NSEvent *ev = [NSEvent keyEventWithType: eventType location: NSZeroPoint modifierFlags: wlconfig->modifiers timestamp: time / 1000.0 windowNumber: window->window_id context: GSCurrentContext() characters: s charactersIgnoringModifiers: s isARepeat: NO keyCode: code]; [GSCurrentServer() postEvent: ev atStart: NO]; NSDebugLog(@"keyboard_handle_key: %@", s); } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay) { NSDebugLog(@"keyboard_handle_repeat_info"); } static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, keyboard_handle_repeat_info }; static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { WaylandConfig *wlconfig = data; if ((caps & WL_SEAT_CAPABILITY_POINTER) && !wlconfig->pointer.wlpointer) { wlconfig->pointer.wlpointer = wl_seat_get_pointer(seat); wl_pointer_set_user_data(wlconfig->pointer.wlpointer, wlconfig); wl_pointer_add_listener(wlconfig->pointer.wlpointer, &pointer_listener, wlconfig); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && wlconfig->pointer.wlpointer) { if (wlconfig->seat_version >= WL_POINTER_RELEASE_SINCE_VERSION) wl_pointer_release(wlconfig->pointer.wlpointer); else wl_pointer_destroy(wlconfig->pointer.wlpointer); wlconfig->pointer.wlpointer = NULL; } wl_display_dispatch_pending(wlconfig->display); wl_display_flush(wlconfig->display); if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !wlconfig->keyboard) { wlconfig->keyboard = wl_seat_get_keyboard(seat); wl_keyboard_set_user_data(wlconfig->keyboard, wlconfig); wl_keyboard_add_listener(wlconfig->keyboard, &keyboard_listener, wlconfig); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && wlconfig->keyboard) { if (wlconfig->seat_version >= WL_KEYBOARD_RELEASE_SINCE_VERSION) wl_keyboard_release(wlconfig->keyboard); else wl_keyboard_destroy(wlconfig->keyboard); wlconfig->keyboard = NULL; } #if 0 if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) { input->touch = wl_seat_get_touch(seat); wl_touch_set_user_data(input->touch, input); wl_touch_add_listener(input->touch, &touch_listener, input); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { if (input->seat_version >= WL_TOUCH_RELEASE_SINCE_VERSION) wl_touch_release(input->touch); else wl_touch_destroy(input->touch); input->touch = NULL; } #endif } static const struct wl_seat_listener seat_listener = { seat_handle_capabilities, }; static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { } struct wl_shm_listener shm_listener = { shm_format }; #define XDG_SHELL #ifdef XDG_SHELL static void xdg_surface_on_configure(void *data, struct xdg_surface *xdg_surface, uint32_t serial) { struct window *window = data; WaylandConfig *wlconfig = window->wlconfig; NSDebugLog(@"xdg_surface_on_configure: win=%d", window->window_id); NSEvent *ev = nil; NSWindow *nswindow = GSWindowWithNumber(window->window_id); NSDebugLog(@"Acknowledging surface configure %p %d (window_id=%d)", xdg_surface, serial, window->window_id); xdg_surface_ack_configure(xdg_surface, serial); window->configured = YES; // TODO: do we need to check that the surface has been painted to? if (window->surface) { // TODO: is this ever going to be null when we get here? wl_surface_commit(window->surface); wl_display_dispatch_pending(window->wlconfig->display); wl_display_flush(window->wlconfig->display); } if (wlconfig->pointer.focus && wlconfig->pointer.focus->window_id == window->window_id) { ev = [NSEvent otherEventWithType: NSAppKitDefined location: NSZeroPoint modifierFlags: 0 timestamp: 0 windowNumber: (int)window->window_id context: GSCurrentContext() subtype: GSAppKitWindowFocusIn data1: 0 data2: 0]; [nswindow sendEvent: ev]; } #if 0 struct window *window = data; int moved = 0; NSDebugLog(@"configure window=%d pos=%dx%d size=%dx%d", window->window_id, x, y, width, height); NSDebugLog(@"current values pos=%dx%d size=%dx%d", window->pos_x, window->pos_y, window->width, window->height); if (!window->is_out && (window->pos_x != x || window->pos_y != y)) { window->pos_x = x; window->pos_y = y; moved = 1; } xdg_surface_ack_configure(window->xdg_surface, serial); NSRect rect = NSMakeRect(0, 0, window->width, window->height); [window->instance flushwindowrect:rect :window->window_id]; wl_display_dispatch_pending(window->wlconfig->display); wl_display_flush(window->wlconfig->display); if (moved) { NSDebugLog(@"window moved, notifying AppKit"); NSEvent *ev = nil; NSWindow *nswindow = GSWindowWithNumber(window->window_id); ev = [NSEvent otherEventWithType: NSAppKitDefined location: NSZeroPoint modifierFlags: 0 timestamp: 0 windowNumber: (int)window->window_id context: GSCurrentContext() subtype: GSAppKitWindowMoved data1: window->pos_x data2: WaylandToNS(window, window->pos_y)]; [nswindow sendEvent: ev]; } #endif } static const struct xdg_surface_listener xdg_surface_listener = { xdg_surface_on_configure, }; #else static void wl_shell_surface_on_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial) { wl_shell_surface_pong(shell_surface, serial); } static void wl_shell_surface_on_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t edges, int32_t width, int32_t height) { } static void wl_shell_surface_on_popup_done(void *data, struct wl_shell_surface *shell_surface) { } static const struct wl_shell_surface_listener shell_surface_listener = { wl_shell_surface_on_ping, wl_shell_surface_on_configure, wl_shell_surface_on_popup_done, }; #endif static void handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { WaylandConfig *wlconfig = data; NSDebugLog(@"wayland: registering interface '%s'", interface); if (strcmp(interface, xdg_wm_base_interface.name) == 0) { wlconfig->wm_base = wl_registry_bind(registry, name, &xdg_wm_base_interface, 1); NSDebugLog(@"wayland: found wm_base interface"); } else if (strcmp(interface, wl_shell_interface.name) == 0) { wlconfig->shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); NSDebugLog(@"wayland: found shell interface"); } else if (strcmp(interface, wl_compositor_interface.name) == 0) { wlconfig->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); NSDebugLog(@"wayland: found compositor interface"); } else if (strcmp(interface, wl_shm_interface.name) == 0) { wlconfig->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); NSDebugLog(@"wayland: found shm interface"); wl_shm_add_listener(wlconfig->shm, &shm_listener, wlconfig); } else if (strcmp(interface, wl_output_interface.name) == 0) { struct output *output = (struct output *)malloc(sizeof(struct output)); memset(output, 0, sizeof(struct output)); output->wlconfig = wlconfig; output->scale = 1; output->output = wl_registry_bind(registry, name, &wl_output_interface, 2); output->server_output_id = name; NSDebugLog(@"wayland: found output interface"); wl_list_insert(wlconfig->output_list.prev, &output->link); wlconfig->output_count++; wl_output_add_listener(output->output, &output_listener, output); } else if (strcmp(interface, wl_seat_interface.name) == 0) { wlconfig->pointer.wlpointer = NULL; wlconfig->seat_version = version; wlconfig->seat = wl_registry_bind(wlconfig->registry, name, &wl_seat_interface, 1); NSDebugLog(@"wayland: found seat interface"); wl_seat_add_listener(wlconfig->seat, &seat_listener, wlconfig); } } static void handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { handle_global, handle_global_remove }; struct window * get_window_with_id(WaylandConfig *wlconfig, int winid) { struct window *window; wl_list_for_each(window, &wlconfig->window_list, link) { if (window->window_id == winid) { return window; } } return NULL; } float WaylandToNS(struct window *window, float wl_y) { return (window->output->height - wl_y - window->height); } int NSToWayland(struct window *window, int ns_y) { return (window->output->height - ns_y - window->height); } @implementation WaylandServer /* Initialize AppKit backend */ + (void) initializeBackend { NSDebugLog(@"Initializing GNUstep Wayland backend"); [GSDisplayServer setDefaultServerClass: [WaylandServer class]]; } - (id) _initWaylandContext { wlconfig = (WaylandConfig *) malloc(sizeof(WaylandConfig)); memset(wlconfig, 0, sizeof(WaylandConfig)); wlconfig->last_window_id = 1; wlconfig->mouse_scroll_multiplier = 1.0f; wl_list_init(&wlconfig->output_list); wl_list_init(&wlconfig->window_list); wlconfig->display = wl_display_connect(NULL); if (!wlconfig->display) { [NSException raise: NSWindowServerCommunicationException format: @"Unable to connect Wayland Server"]; } wlconfig->registry = wl_display_get_registry(wlconfig->display); if (!wlconfig->registry) { [NSException raise: NSWindowServerCommunicationException format: @"Unable to get global registry"]; } wl_registry_add_listener(wlconfig->registry, ®istry_listener, wlconfig); wl_display_dispatch(wlconfig->display); wl_display_roundtrip(wlconfig->display); if (!wlconfig->compositor) { [NSException raise: NSWindowServerCommunicationException format: @"Unable to get compositor"]; } if (!wlconfig->wm_base) { /* Note: this was merged into Weston only as of Feb 2019, and is probably in Weston only as of 6.0 release, therefore not in Weston 5.x present in Debian buster (current stable). See Weston merge request !103. */ [NSException raise: NSWindowServerCommunicationException format: @"Unable to get xdg-shell / xdg_wm_base - your Wayland compositor must support the stable XDG Shell protocol"]; } return self; } - (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode { if (type == ET_RDESC){ NSDebugLog(@"receivedEvent ET_RDESC"); if (wl_display_dispatch(wlconfig->display) == -1) { [NSException raise: NSWindowServerCommunicationException format: @"Connection to Wayland Server lost"]; } } } - (void) setupRunLoopInputSourcesForMode: (NSString*)mode { NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; long fdWaylandHandle = wl_display_get_fd(wlconfig->display); [currentRunLoop addEvent: (void*)fdWaylandHandle type: ET_RDESC watcher: (id)self forMode: mode]; } - (id) initWithAttributes: (NSDictionary *)info { NSDebugLog(@"WaylandServer initWithAttributes"); [super initWithAttributes: info]; [self _initWaylandContext]; [self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode]; [self setupRunLoopInputSourcesForMode: NSConnectionReplyMode]; [self setupRunLoopInputSourcesForMode: NSModalPanelRunLoopMode]; [self setupRunLoopInputSourcesForMode: NSEventTrackingRunLoopMode]; return self; } - (void) dealloc { NSDebugLog(@"Destroying Wayland Server"); [super dealloc]; } - (BOOL) handlesWindowDecorations { return NO; } - (void) restrictWindow: (int)win toImage: (NSImage*)image { NSDebugLog(@"restrictWindow"); } - (NSRect) boundsForScreen: (int)screen { NSDebugLog(@"boundsForScreen: %d", screen); struct output *output; wl_list_for_each(output, &wlconfig->output_list, link) { NSDebugLog(@"screen found: %dx%d", output->width, output->height); return NSMakeRect(0, 0, output->width, output->height); } NSDebugLog(@"can't find screen"); return NSZeroRect; } - (NSWindowDepth) windowDepthForScreen: (int)screen { NSDebugLog(@"windowDepthForScreen: %d", screen); return (_GSRGBBitValue | 8); } - (const NSWindowDepth *) availableDepthsForScreen: (int)screen { NSDebugLog(@"availableDepthsForScreen"); return NULL; } - (NSArray *) screenList { NSDebugLog(@"screenList"); NSMutableArray *screens = [NSMutableArray arrayWithCapacity: wlconfig->output_count]; struct output *output; wl_list_for_each(output, &wlconfig->output_list, link) { [screens addObject: [NSNumber numberWithInt: output->server_output_id]]; NSDebugLog(@"adding screen with output_id=%d", output->server_output_id); NSDebugLog(@"output dimensions: %dx%d %dx%d", output->alloc_x, output->alloc_y, output->width, output->height); } return screens; } - (void *) serverDevice { NSDebugLog(@"serverDevice"); return NULL; } - (void *) windowDevice: (int)win { NSDebugLog(@"windowDevice"); return NULL; } - (void) beep { NSDebugLog(@"beep"); } @end @implementation WaylandServer (WindowOps) - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style : (int)screen { NSDebugLog(@"window: screen=%d frame=%@", screen, NSStringFromRect(frame)); struct window *window; struct output *output; int width; int height; int altered = 0; /* We're not allowed to create a zero rect window */ if (NSWidth(frame) <= 0 || NSHeight(frame) <= 0) { NSDebugLog(@"trying to create a zero rect window"); frame.size.width = 2; frame.size.height = 2; } window = malloc(sizeof(struct window)); memset(window, 0, sizeof(struct window)); wl_list_for_each(output, &wlconfig->output_list, link) { if (output->server_output_id == screen) { window->output = output; break; } } if (!window->output) { NSDebugLog(@"can't find screen %d", screen); free(window); return 0; } window->wlconfig = wlconfig; window->instance = self; window->is_out = 0; window->width = width = NSWidth(frame); window->height = height = NSHeight(frame); window->pos_x = frame.origin.x; window->pos_y = NSToWayland(window, frame.origin.y); window->window_id = wlconfig->last_window_id; window->surface = wl_compositor_create_surface(wlconfig->compositor); if (!window->surface) { NSDebugLog(@"can't create wayland surface"); free(window); return 0; } wl_surface_set_user_data(window->surface, window); window->xdg_surface = xdg_wm_base_get_xdg_surface(wlconfig->wm_base, window->surface); #if 0 // TODO: xdg_shell_get_xdg_surface_special() no longer exists, // so we need to find another way, see *get_popup for menus if (style & NSMainMenuWindowMask) { NSDebugLog(@"window id=%d will be a panel", window->window_id); } else if (style & NSBackgroundWindowMask) { NSDebugLog(@"window id=%d will be a ?", window->window_id); } else { NSDebugLog(@"window id=%d will be ordinary", window->window_id); } #endif window->toplevel = xdg_surface_get_toplevel(window->xdg_surface); xdg_surface_set_user_data(window->xdg_surface, window); xdg_surface_add_listener(window->xdg_surface, &xdg_surface_listener, window); if (window->pos_x < 0) { window->pos_x = 0; altered = 1; } #if 0 if (window->pos_y < 31) { window->pos_y = 31; altered = 1; } #endif NSDebugLog(@"creating new window with id=%d: pos=%fx%f, size=%fx%f", window->window_id, window->pos_x, window->pos_y, window->width, window->height); xdg_surface_set_window_geometry(window->xdg_surface, window->pos_x, window->pos_y, window->width, window->height); wl_surface_commit(window->surface); wl_display_flush(wlconfig->display); wl_list_insert(wlconfig->window_list.prev, &window->link); wlconfig->last_window_id++; wlconfig->window_count++; [self _setWindowOwnedByServer: (int)window->window_id]; if (altered) { NSEvent *ev = [NSEvent otherEventWithType: NSAppKitDefined location: NSZeroPoint modifierFlags: 0 timestamp: 0 windowNumber: (int)window->window_id context: GSCurrentContext() subtype: GSAppKitWindowMoved data1: window->pos_x data2: WaylandToNS(window, window->pos_y)]; [(GSWindowWithNumber(window->window_id)) sendEvent: ev]; NSDebugLog(@"window: notifying of move=%fx%f", window->pos_x, WaylandToNS(window, window->pos_y)); } return window->window_id; } - (void) termwindow: (int) win { NSDebugLog(@"termwindow: win=%d", win); struct window *window = get_window_with_id(wlconfig, win); xdg_surface_destroy(window->xdg_surface); wl_buffer_destroy(window->buffer); wl_list_remove(&window->link); free(window); } - (int) nativeWindow: (void *)winref : (NSRect*)frame : (NSBackingStoreType*)type : (unsigned int*)style : (int*)screen { NSDebugLog(@"nativeWindow"); return 0; } - (void) stylewindow: (unsigned int) style : (int) win { NSDebugLog(@"stylewindow"); } - (void) windowbacking: (NSBackingStoreType)type : (int) win { NSDebugLog(@"windowbacking"); } - (void) titlewindow: (NSString *) window_title : (int) win { NSDebugLog(@"titlewindow: win=%d title=%@", win, window_title); if (window_title == @"Window") { return; } struct window *window = get_window_with_id(wlconfig, win); const char *cString = [window_title UTF8String]; xdg_toplevel_set_title(window->toplevel, cString); } - (void) miniwindow: (int) win { NSDebugLog(@"miniwindow"); [self orderwindow: NSWindowOut :0 :win]; } - (void) setWindowdevice: (int) winId forContext: (NSGraphicsContext *)ctxt { NSDebugLog(@"setWindowdevice: %d", winId); struct window *window; window = get_window_with_id(wlconfig, winId); GSSetDevice(ctxt, window, 0.0, window->height); DPSinitmatrix(ctxt); DPSinitclip(ctxt); } - (void) orderwindow: (int) op : (int) otherWin : (int) win { NSDebugLog(@"orderwindow: %d", win); struct window *window = get_window_with_id(wlconfig, win); if (op == NSWindowOut) { NSDebugLog(@"orderwindow: NSWindowOut"); window->is_out = 1; xdg_surface_set_window_geometry(window->xdg_surface, window->pos_x + 32000, window->pos_y + 32000, window->width, window->height); NSRect rect = NSMakeRect(0, 0, window->width, window->height); [window->instance flushwindowrect:rect :window->window_id]; xdg_toplevel_set_minimized(window->toplevel); wl_display_dispatch_pending(window->wlconfig->display); wl_display_flush(window->wlconfig->display); } else /*if (window->is_out)*/ { NSDebugLog(@"orderwindow: restoring to %fx%f", window->pos_x, window->pos_y); xdg_surface_set_window_geometry(window->xdg_surface, window->pos_x, window->pos_y, window->width, window->height); NSRect rect = NSMakeRect(0, 0, window->width, window->height); [window->instance flushwindowrect:rect :window->window_id]; // xdg_toplevel_set_minimized(window->toplevel); // xdg_toplevel_set_fullscreen(window->toplevel, window->output); wl_display_dispatch_pending(window->wlconfig->display); wl_display_flush(window->wlconfig->display); window->is_out = 0; } } - (void) movewindow: (NSPoint)loc : (int) win { NSDebugLog(@"movewindow"); } - (NSRect) _OSFrameToWFrame: (NSRect)o for: (void*)win { struct window *window = (struct window *)win; NSRect x; x.size.width = o.size.width; x.size.height = o.size.height; x.origin.x = o.origin.x; x.origin.y = o.origin.y + o.size.height; x.origin.y = window->output->height - x.origin.y; return x; } - (void) placewindow: (NSRect)rect : (int) win { NSDebugLog(@"placewindow: %d %@", win, NSStringFromRect(rect)); struct window *window = get_window_with_id(wlconfig, win); WaylandConfig *config = window->wlconfig; if (0 && config->pointer.serial && config->pointer.focus && config->pointer.focus->window_id == win) { // FIXME: remove dead branch NSEvent *event; NSEventType eventType; NSPoint eventLocation; NSGraphicsContext *gcontext; unsigned int eventFlags; float deltaX = 0.0; float deltaY = 0.0; int tick; gcontext = GSCurrentContext(); eventLocation = NSMakePoint(config->pointer.x, window->height - config->pointer.y); eventFlags = 0; eventType = NSLeftMouseUp; tick = 0; NSDebugLog(@"sending pointer event at: %fx%f, window=%d", config->pointer.x, config->pointer.y, window->window_id); event = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval) 0 windowNumber: (int)window->window_id context: gcontext eventNumber: tick clickCount: 1 pressure: 1.0 buttonNumber: 0 /* FIXME */ deltaX: deltaX deltaY: deltaY deltaZ: 0.]; [GSCurrentServer() postEvent: event atStart: NO]; xdg_toplevel_move(window->toplevel, config->seat, config->pointer.serial); } else { NSDebugLog(@"placewindow: oldpos=%fx%f", window->pos_x, window->pos_y); NSDebugLog(@"placewindow: oldsize=%fx%f", window->width, window->height); NSRect frame; NSRect wframe; BOOL resize = NO; BOOL move = NO; frame = [(GSWindowWithNumber(window->window_id)) frame]; if (NSEqualRects(rect, frame) == YES) return; if (NSEqualSizes(rect.size, frame.size) == NO) { resize = YES; move = YES; } if (NSEqualPoints(rect.origin, frame.origin) == NO) { move = YES; } wframe = [self _OSFrameToWFrame: rect for: window]; if (config->pointer.focus && config->pointer.focus->window_id == window->window_id) { config->pointer.y -= (wframe.origin.y - window->pos_y); config->pointer.x -= (wframe.origin.x - window->pos_x); } window->width = wframe.size.width; window->height = wframe.size.height; window->pos_x = wframe.origin.x; window->pos_y = wframe.origin.y; xdg_surface_set_window_geometry(window->xdg_surface, window->pos_x, window->pos_y, window->width, window->height); /* NSRect flushRect = NSMakeRect(0, 0, window->width, window->height); */ [window->instance flushwindowrect:rect :window->window_id]; wl_display_dispatch_pending(window->wlconfig->display); wl_display_flush(window->wlconfig->display); if (resize == YES) { NSEvent *ev = [NSEvent otherEventWithType: NSAppKitDefined location: rect.origin modifierFlags: 0 timestamp: 0 windowNumber: win context: GSCurrentContext() subtype: GSAppKitWindowResized data1: rect.size.width data2: rect.size.height]; [(GSWindowWithNumber(window->window_id)) sendEvent: ev]; NSDebugLog(@"placewindow notify resized=%fx%f", rect.size.width, rect.size.height); } else if (move == YES) { NSEvent *ev = [NSEvent otherEventWithType: NSAppKitDefined location: NSZeroPoint modifierFlags: 0 timestamp: 0 windowNumber: (int)window->window_id context: GSCurrentContext() subtype: GSAppKitWindowMoved data1: rect.origin.x data2: rect.origin.y]; [(GSWindowWithNumber(window->window_id)) sendEvent: ev]; NSDebugLog(@"placewindow notify moved=%fx%f", rect.origin.x, rect.origin.y); } NSDebugLog(@"placewindow: newpos=%fx%f", window->pos_x, window->pos_y); NSDebugLog(@"placewindow: newsize=%fx%f", window->width, window->height); } } - (NSRect) windowbounds: (int) win { struct window *window = get_window_with_id(wlconfig, win); NSDebugLog(@"windowbounds: win=%d, pos=%dx%d size=%dx%d", window->window_id, window->pos_x, window->pos_y, window->width, window->height); return NSMakeRect(window->pos_x, window->output->height - window->pos_y, window->width, window->height); } - (void) setwindowlevel: (int) level : (int) win { NSDebugLog(@"setwindowlevel: level=%d win=%d", level, win); } - (int) windowlevel: (int) win { NSDebugLog(@"windowlevel: %d", win); return 0; } - (int) windowdepth: (int) win { NSDebugLog(@"windowdepth"); return 0; } - (void) setmaxsize: (NSSize)size : (int) win { NSDebugLog(@"setmaxsize"); } - (void) setminsize: (NSSize)size : (int) win { NSDebugLog(@"setminsize"); } - (void) setresizeincrements: (NSSize)size : (int) win { NSDebugLog(@"setresizeincrements"); } - (void) flushwindowrect: (NSRect)rect : (int) win { NSDebugLog(@"flushwindowrect: %d %fx%f", win, NSWidth(rect), NSHeight(rect)); struct window *window = get_window_with_id(wlconfig, win); [[GSCurrentContext() class] handleExposeRect: rect forDriver: window->wcs]; } - (void) styleoffsets: (float*) l : (float*) r : (float*) t : (float*) b : (unsigned int) style { NSDebugLog(@"styleoffsets"); /* XXX - Assume we don't decorate */ *l = *r = *t = *b = 0.0; } - (void) docedited: (int) edited : (int) win { NSDebugLog(@"docedited"); } - (void) setinputstate: (int)state : (int)win { NSDebugLog(@"setinputstate"); } - (void) setinputfocus: (int) win { NSDebugLog(@"setinputfocus"); } - (void) setalpha: (float)alpha : (int) win { NSDebugLog(@"setalpha"); } - (void) setShadow: (BOOL)hasShadow : (int)win { NSDebugLog(@"setshadow"); } - (NSPoint) mouselocation { int aScreen = -1; struct output *output; NSDebugLog(@"mouselocation"); // FIXME: find a cleaner way to get the first element of a wl_list wl_list_for_each(output, &wlconfig->output_list, link) { aScreen = output->server_output_id; break; } if (aScreen < 0) // No outputs in the wl_list. return NSZeroPoint; return [self mouseLocationOnScreen: aScreen window: NULL]; } - (NSPoint) mouseLocationOnScreen: (int)aScreen window: (int *)win { NSDebugLog(@"mouseLocationOnScreen: %d %fx%f", win, wlconfig->pointer.x, wlconfig->pointer.y); struct window *window = wlconfig->pointer.focus; struct output *output; float x; float y; /*if (wlconfig->pointer.serial) { NSDebugLog(@"captured"); x = wlconfig->pointer.captured_x; y = wlconfig->pointer.captured_y; } else*/ { NSDebugLog(@"NOT captured"); x = wlconfig->pointer.x; y = wlconfig->pointer.y; if (window) { x += window->pos_x; y += window->pos_y; if (win) { *win = &window->window_id; } } } wl_list_for_each(output, &wlconfig->output_list, link) { if (output->server_output_id == aScreen) { y = output->height - y; break; } } NSDebugLog(@"mouseLocationOnScreen: returning %fx%f", x, y); return NSMakePoint(x, y); } - (BOOL) capturemouse: (int) win { NSDebugLog(@"capturemouse: %d", win); return NO; } - (void) releasemouse { NSDebugLog(@"releasemouse"); } - (void) setMouseLocation: (NSPoint)mouseLocation onScreen: (int)aScreen { NSDebugLog(@"setMouseLocation"); } - (void) hidecursor { NSDebugLog(@"hidecursor"); } - (void) showcursor { NSDebugLog(@"showcursor"); } - (void) standardcursor: (int) style : (void**) cid { NSDebugLog(@"standardcursor"); } - (void) imagecursor: (NSPoint)hotp : (NSImage *) image : (void**) cid { NSDebugLog(@"imagecursor"); } - (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid { NSLog(@"Call to obsolete method -setcursorcolor:::"); [self recolorcursor: fg : bg : cid]; [self setcursor: cid]; } - (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid { NSDebugLog(@"recolorcursor"); } - (void) setcursor: (void*) cid { NSDebugLog(@"setcursor"); } - (void) freecursor: (void*) cid { NSDebugLog(@"freecursor"); } - (void) setParentWindow: (int)parentWin forChildWindow: (int)childWin { NSDebugLog(@"setParentWindow: parent=%d child=%d", parentWin, childWin); struct window *parent = get_window_with_id(wlconfig, parentWin); struct window *child = get_window_with_id(wlconfig, childWin); if (parent) { xdg_toplevel_set_parent(child->toplevel, parent->toplevel); } else { xdg_toplevel_set_parent(child->toplevel, NULL); } xdg_toplevel_set_minimized(child->toplevel); wl_display_dispatch_pending(wlconfig->display); wl_display_flush(wlconfig->display); } - (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win { NSDebugLog(@"setIgnoreMouse"); } - (void) initializeMouseIfRequired { if (!_mouseInitialized) [self initializeMouse]; } - (void) initializeMouse { _mouseInitialized = YES; [self mouseOptionsChanged: nil]; [[NSDistributedNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseOptionsChanged:) name: NSUserDefaultsDidChangeNotification object: nil]; } - (void) mouseOptionsChanged: (NSNotification *)aNotif { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; wlconfig->mouse_scroll_multiplier = [defs integerForKey:@"GSMouseScrollMultiplier"]; if (wlconfig->mouse_scroll_multiplier < 0.0001f) wlconfig->mouse_scroll_multiplier = 1.0f; } @end gnustep-back-0.29.0/Source/wayland/xdg-shell-protocol.c000066400000000000000000000114701404163720200227600ustar00rootroot00000000000000/* Generated by wayland-scanner 1.17.0 */ /* * Copyright © 2008-2013 Kristian Høgsberg * Copyright © 2013 Rafael Antognolli * Copyright © 2013 Jasper St. Pierre * Copyright © 2010-2013 Intel Corporation * Copyright © 2015-2017 Samsung Electronics Co., Ltd * Copyright © 2015-2017 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include "wayland-util.h" extern const struct wl_interface wl_output_interface; extern const struct wl_interface wl_seat_interface; extern const struct wl_interface wl_surface_interface; extern const struct wl_interface xdg_popup_interface; extern const struct wl_interface xdg_positioner_interface; extern const struct wl_interface xdg_surface_interface; extern const struct wl_interface xdg_toplevel_interface; static const struct wl_interface *types[] = { NULL, NULL, NULL, NULL, &xdg_positioner_interface, &xdg_surface_interface, &wl_surface_interface, &xdg_toplevel_interface, &xdg_popup_interface, &xdg_surface_interface, &xdg_positioner_interface, &xdg_toplevel_interface, &wl_seat_interface, NULL, NULL, NULL, &wl_seat_interface, NULL, &wl_seat_interface, NULL, NULL, &wl_output_interface, &wl_seat_interface, NULL, }; static const struct wl_message xdg_wm_base_requests[] = { { "destroy", "", types + 0 }, { "create_positioner", "n", types + 4 }, { "get_xdg_surface", "no", types + 5 }, { "pong", "u", types + 0 }, }; static const struct wl_message xdg_wm_base_events[] = { { "ping", "u", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_wm_base_interface = { "xdg_wm_base", 2, 4, xdg_wm_base_requests, 1, xdg_wm_base_events, }; static const struct wl_message xdg_positioner_requests[] = { { "destroy", "", types + 0 }, { "set_size", "ii", types + 0 }, { "set_anchor_rect", "iiii", types + 0 }, { "set_anchor", "u", types + 0 }, { "set_gravity", "u", types + 0 }, { "set_constraint_adjustment", "u", types + 0 }, { "set_offset", "ii", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_positioner_interface = { "xdg_positioner", 2, 7, xdg_positioner_requests, 0, NULL, }; static const struct wl_message xdg_surface_requests[] = { { "destroy", "", types + 0 }, { "get_toplevel", "n", types + 7 }, { "get_popup", "n?oo", types + 8 }, { "set_window_geometry", "iiii", types + 0 }, { "ack_configure", "u", types + 0 }, }; static const struct wl_message xdg_surface_events[] = { { "configure", "u", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_surface_interface = { "xdg_surface", 2, 5, xdg_surface_requests, 1, xdg_surface_events, }; static const struct wl_message xdg_toplevel_requests[] = { { "destroy", "", types + 0 }, { "set_parent", "?o", types + 11 }, { "set_title", "s", types + 0 }, { "set_app_id", "s", types + 0 }, { "show_window_menu", "ouii", types + 12 }, { "move", "ou", types + 16 }, { "resize", "ouu", types + 18 }, { "set_max_size", "ii", types + 0 }, { "set_min_size", "ii", types + 0 }, { "set_maximized", "", types + 0 }, { "unset_maximized", "", types + 0 }, { "set_fullscreen", "?o", types + 21 }, { "unset_fullscreen", "", types + 0 }, { "set_minimized", "", types + 0 }, }; static const struct wl_message xdg_toplevel_events[] = { { "configure", "iia", types + 0 }, { "close", "", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_toplevel_interface = { "xdg_toplevel", 2, 14, xdg_toplevel_requests, 2, xdg_toplevel_events, }; static const struct wl_message xdg_popup_requests[] = { { "destroy", "", types + 0 }, { "grab", "ou", types + 22 }, }; static const struct wl_message xdg_popup_events[] = { { "configure", "iiii", types + 0 }, { "popup_done", "", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_popup_interface = { "xdg_popup", 2, 2, xdg_popup_requests, 2, xdg_popup_events, }; gnustep-back-0.29.0/Source/win32/000077500000000000000000000000001404163720200163665ustar00rootroot00000000000000gnustep-back-0.29.0/Source/win32/.cvsignore000066400000000000000000000000171404163720200203640ustar00rootroot00000000000000Resources *obj gnustep-back-0.29.0/Source/win32/GNUmakefile000066400000000000000000000031601404163720200204400ustar00rootroot00000000000000# # Main makefile for GNUstep Backend win32 # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make # The library to be compiled, as a library or as a bundle SUBPROJECT_NAME=win32 win32_LOCALIZED_RESOURCE_FILES = \ # The C source files to be compiled win32_C_FILES = \ # The Objective-C source files to be compiled win32_OBJC_FILES = \ WIN32Server.m \ w32_activate.m \ w32_create.m \ w32_general.m \ w32_movesize.m \ w32_text_focus.m \ w32_windowdisplay.m \ w32_GLformat.m \ w32_GLcontext.m \ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/win32/GNUmakefile.preamble000066400000000000000000000031611404163720200222270ustar00rootroot00000000000000 # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS = -DWINVER=0x0500 # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS = -DWINVER=0x0500 # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS = # Additional library directories the linker should search ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/win32/WIN32Server.m000066400000000000000000002606761404163720200205560ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2002, 2005 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 Part of this code have been re-written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "win32/WIN32Server.h" #include "win32/WIN32Geometry.h" #ifdef HAVE_WGL #include "win32/WIN32OpenGL.h" #endif #ifdef __CYGWIN__ #include #endif #include // To update the cursor.. static BOOL update_cursor = NO; static BOOL should_handle_cursor = NO; static NSCursor *current_cursor = nil; // Forward declarations... static unsigned int mask_for_keystate(BYTE *keyState); @interface W32DisplayMonitorInfo : NSObject { HMONITOR _hMonitor; RECT _rect; NSRect _frame; } - (id)initWithHMonitor:(HMONITOR)hMonitor rect:(LPRECT)lprcMonitor; - (HMONITOR)hMonitor; - (RECT)rect; - (NSRect)frame; - (void)setFrame:(NSRect)frame; @end @implementation W32DisplayMonitorInfo - (id)initWithHMonitor:(HMONITOR)hMonitor rect:(LPRECT)lprcMonitor { self = [self init]; if (self) { CGFloat w = lprcMonitor->right - lprcMonitor->left; CGFloat h = lprcMonitor->bottom - lprcMonitor->top; CGFloat x = lprcMonitor->left; CGFloat y = h - lprcMonitor->bottom; _hMonitor = hMonitor; _frame = NSMakeRect(x, y, w, h); memcpy(&_rect, lprcMonitor, sizeof(RECT)); } return self; } - (HMONITOR)hMonitor { return _hMonitor; } - (RECT)rect { return _rect; } - (NSRect)frame { return _frame; } - (void)setFrame:(NSRect)frame { _frame = frame; } @end static BOOL _enableCallbacks = YES; static NSEvent *process_key_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, NSEventType eventType); static NSEvent *process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, NSEventType eventType, UINT uMsg); LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); BOOL CALLBACK LoadDisplayMonitorInfo(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { NSMutableArray *monitors = (NSMutableArray*)dwData; W32DisplayMonitorInfo *info = [[W32DisplayMonitorInfo alloc] initWithHMonitor:hMonitor rect:lprcMonitor]; NSDebugLog(@"screen %ld:hdc: %ld frame:top:%ld left:%ld right:%ld bottom:%ld frame:x:%f y:%f w:%f h:%f\n", [monitors count], (long)hMonitor, lprcMonitor->top, lprcMonitor->left, lprcMonitor->right, lprcMonitor->bottom, [info frame].origin.x, [info frame].origin.y, [info frame].size.width, [info frame].size.height); [monitors addObject:info]; return TRUE; } @implementation WIN32Server - (BOOL) handlesWindowDecorations { return handlesWindowDecorations; } - (void) setHandlesWindowDecorations: (BOOL) b { handlesWindowDecorations = b; } - (BOOL) usesNativeTaskbar { return usesNativeTaskbar; } - (void) setUsesNativeTaskbar: (BOOL) b { usesNativeTaskbar = b; } - (void) callback: (id)sender { MSG msg; WINBOOL bRet; //NSLog(@"Callback"); while ((bRet = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) != 0) { if (msg.message == WM_QUIT) { // Exit the program return; } if (bRet == -1) { // handle the error and possibly exit } else { // Original author disregarded a translate message call here stating // that it would give extra character messages - BUT THIS KILLS IME // MESSAGE PROCESSING!!!!! TranslateMessage(&msg); DispatchMessage(&msg); } } } - (BOOL) hasEvent { return (GetQueueStatus(QS_ALLEVENTS) != 0); } - (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode { #ifdef __CYGWIN__ if (type == ET_RDESC) #else if (type == ET_WINMSG) #endif { MSG *m = (MSG*)extra; if (m->message == WM_QUIT) { [NSApp terminate: nil]; // Exit the program return; } else { TranslateMessage(m); DispatchMessage(m); } } // if (mode != nil) [self callback: mode]; } - (NSEvent*) getEventMatchingMask: (unsigned)mask beforeDate: (NSDate*)limit inMode: (NSString*)mode dequeue: (BOOL)flag { // [self callback: nil]; return [super getEventMatchingMask: mask beforeDate: limit inMode: mode dequeue: flag]; } - (void) discardEventsMatchingMask: (unsigned)mask beforeEvent: (NSEvent*)limit { // [self callback: nil]; [super discardEventsMatchingMask: mask beforeEvent: limit]; } // server /* Initialize AppKit backend */ + (void) initializeBackend { NSDebugLog(@"Initializing GNUstep win32 backend.\n"); [GSDisplayServer setDefaultServerClass: [WIN32Server class]]; } - (void) _initWin32Context { WNDCLASSEXW wc; hinstance = (HINSTANCE)GetModuleHandle(NULL); // Register the main window class. wc.cbSize = sizeof(wc); wc.style = 0; wc.lpfnWndProc = (WNDPROC) MainWndProc; wc.cbClsExtra = 0; // Keep extra space for each window, for OFF_LEVEL and OFF_ORDERED wc.cbWndExtra = WIN_EXTRABYTES; wc.hInstance = hinstance; wc.hIcon = NULL;//currentAppIcon; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = L"GNUstepWindowClass"; wc.hIconSm = NULL;//currentAppIcon; if (!RegisterClassExW(&wc)) return; // FIXME We should use GetSysColor to get standard colours from MS Window and // use them in NSColor // Should we create a message only window here, so we can get events, even when // no windows are created? } - (void) setupRunLoopInputSourcesForMode: (NSString*)mode { NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; #ifdef __CYGWIN__ int fdMessageQueue; #define WIN_MSG_QUEUE_FNAME "/dev/windows" // Open a file descriptor for the windows message queue fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY); if (fdMessageQueue == -1) { NSLog(@"Failed opening %s\n", WIN_MSG_QUEUE_FNAME); exit(1); } [currentRunLoop addEvent: (void*)fdMessageQueue type: ET_RDESC watcher: (id)self forMode: mode]; #else [currentRunLoop addEvent: (void*)0 type: ET_WINMSG watcher: (id)self forMode: mode]; #endif } /** */ - (id) initWithAttributes: (NSDictionary *)info { // NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; self = [super initWithAttributes: info]; if (self) { [self _initWin32Context]; [super initWithAttributes: info]; monitorInfo = [[NSMutableArray alloc] init]; EnumDisplayMonitors(NULL, NULL, (MONITORENUMPROC)LoadDisplayMonitorInfo, (LPARAM)monitorInfo); [self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode]; [self setupRunLoopInputSourcesForMode: NSConnectionReplyMode]; [self setupRunLoopInputSourcesForMode: NSModalPanelRunLoopMode]; [self setupRunLoopInputSourcesForMode: NSEventTrackingRunLoopMode]; [self setHandlesWindowDecorations: YES]; [self setUsesNativeTaskbar: YES]; [GSTheme theme]; { // Check user defaults NSUserDefaults *defs; defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSUseWMStyles"]) { NSWarnLog(@"Usage of 'GSUseWMStyles' as user default option is deprecated. " @"This option will be ignored in future versions. " @"You should use 'GSBackHandlesWindowDecorations' option."); [self setHandlesWindowDecorations: ![defs boolForKey: @"GSUseWMStyles"]]; } if ([defs objectForKey: @"GSUsesWMTaskbar"]) { NSWarnLog(@"Usage of 'GSUseWMTaskbar' as user default option is deprecated. " @"This option will be ignored in future versions. " @"You should use 'GSBackUsesNativeTaskbar' option."); [self setUsesNativeTaskbar: [defs boolForKey: @"GSUseWMTaskbar"]]; } if ([defs objectForKey: @"GSBackHandlesWindowDecorations"]) { [self setHandlesWindowDecorations: [defs boolForKey: @"GSBackHandlesWindowDecorations"]]; } if ([defs objectForKey: @"GSBackUsesNativeTaskbar"]) { [self setUsesNativeTaskbar: [defs boolForKey: @"GSBackUsesNativeTaskbar"]]; } } } return self; } - (void) _destroyWin32Context { UnregisterClass("GNUstepWindowClass", hinstance); } - (void) dealloc { [self _destroyWin32Context]; RELEASE(monitorInfo); [super dealloc]; } - (void) restrictWindow: (int)win toImage: (NSImage*)image { //TODO [self subclassResponsibility: _cmd]; } static HWND foundWindowHwnd = 0; static POINT findWindowAtPoint; LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam) { if (foundWindowHwnd == 0 && hwnd != (HWND)lParam) { RECT r; GetWindowRect(hwnd, &r); if (PtInRect(&r,findWindowAtPoint) && IsWindowVisible(hwnd)) { NSWindow *window = GSWindowWithNumber((int)hwnd); if (![window ignoresMouseEvents]) foundWindowHwnd = hwnd; } } return true; } - (int) findWindowAt: (NSPoint)screenLocation windowRef: (int*)windowRef excluding: (int)win { HWND hwnd; POINT p; p = GSScreenPointToMS(screenLocation); /* * This is insufficient: hwnd = WindowFromPoint(p); * * We must look through all windows until we find one * which contains the specified point, does not have * the ignoresMouseEvents property set, and is not * the excluded window. This is done through the * EnumWindows function which makes a call back to us * for each window. */ foundWindowHwnd = 0; findWindowAtPoint = p; EnumWindows((WNDENUMPROC)windowEnumCallback, win); hwnd = foundWindowHwnd; *windowRef = (int)hwnd; // Any windows return (int)hwnd; } // FIXME: The following methods wont work for multiple screens. // However, GetDeviceCaps docs say that on a system with multiple screens, // LOGPIXELSX/Y will be the same for all screens, so the following is OK. /* Screen information */ - (NSSize) resolutionForScreen: (int)screen { int windowsXRes, windowsYRes; NSSize gnustepRes; HDC hdc; hdc = GetDC(NULL); windowsXRes = GetDeviceCaps(hdc, LOGPIXELSX); windowsYRes = GetDeviceCaps(hdc, LOGPIXELSY); ReleaseDC(NULL, hdc); // We want to return 72 to indicate no scaling factor, but the default // DPI on Windows is 96. So, multiply the result by (72/96) = 0.75 gnustepRes = NSMakeSize(0.75 * windowsXRes, 0.75 * windowsYRes); return gnustepRes; } - (NSRect) boundsForScreen: (int)screen { if (screen < [monitorInfo count]) { return [[monitorInfo objectAtIndex: screen] frame]; } return NSZeroRect; } - (HMONITOR) monitorHandleForScreen: (int)screen { if (screen < [monitorInfo count]) { return [[monitorInfo objectAtIndex: screen] hMonitor]; } else { NSWarnMLog(@"invalid screen number: %d", screen); return NULL; } } - (HDC) createHdcForScreen: (int)screen { HDC hdc = NULL; HMONITOR hMonitor = [self monitorHandleForScreen: screen]; if (hMonitor == NULL) { NSWarnMLog(@"error obtaining monitor handle for screen: %d", screen); } else { MONITORINFOEX mix = { 0 }; mix.cbSize = sizeof(MONITORINFOEX); if (GetMonitorInfo(hMonitor, (LPMONITORINFO)&mix) == 0) { NSWarnMLog(@"error obtaining monitor info for screen: %d status: %d", screen, GetLastError()); } else { hdc = CreateDC("DISPLAY", mix.szDevice, NULL, NULL); if (hdc == NULL) { NSWarnMLog(@"error creating HDC for screen: %d - status: %d", screen, GetLastError()); } } } return hdc; } - (void) deleteScreenHdc: (HDC)hdc { if (hdc == NULL) { NSWarnMLog(@"HDC is NULL"); } else { DeleteDC(hdc); } } - (NSWindowDepth) windowDepthForScreen: (int)screen { HDC hdc = [self createHdcForScreen:screen]; int bits = 0; if (hdc) { bits = GetDeviceCaps(hdc, BITSPIXEL) / 3; //planes = GetDeviceCaps(hdc, PLANES); //NSLog(@"bits %d planes %d", bits, planes); [self deleteScreenHdc:hdc]; } return (_GSRGBBitValue | bits); } - (const NSWindowDepth *) availableDepthsForScreen: (int)screen { int ndepths = 1; NSZone *defaultZone = NSDefaultMallocZone(); NSWindowDepth *depths = 0; depths = NSZoneMalloc(defaultZone, sizeof(NSWindowDepth)*(ndepths + 1)); // FIXME depths[0] = [self windowDepthForScreen: screen]; depths[1] = 0; return depths; } - (NSArray *) screenList { NSInteger index; NSInteger nMonitors = [monitorInfo count]; NSMutableArray *screenList = [NSMutableArray arrayWithCapacity:nMonitors]; for (index = 0; index < nMonitors; ++index) [screenList addObject:[NSNumber numberWithInt:index]]; return [[screenList copy] autorelease]; } /** Returns the handle of the module instance. */ - (void *) serverDevice { return hinstance; } /** As the number of the window is actually is handle we return this. */ - (void *) windowDevice: (int)win { return (void *)win; } - (void) beep { Beep(400, 500); } /* styles are mapped between the two systems NSBorderlessWindowMask 0 NSTitledWindowMask 1 NSClosableWindowMask 2 NSMiniaturizableWindowMask 4 NSResizableWindowMask 8 NSIconWindowMask 64 NSMiniWindowMask 128 NSMenu(style) = NSTitledWindowMask | NSClosableWindowMask =3; */ - (DWORD) windowStyleForGSStyle: (unsigned int) style { DWORD wstyle = 0; if ([self handlesWindowDecorations] == NO) return WS_POPUP | WS_CLIPCHILDREN; if (style == 0) { wstyle = WS_POPUP; } else { if ((style & NSTitledWindowMask) == NSTitledWindowMask) wstyle |= WS_CAPTION; if ((style & NSClosableWindowMask) == NSClosableWindowMask) wstyle |= WS_CAPTION | WS_SYSMENU; if ((style & NSMiniaturizableWindowMask) == NSMiniaturizableWindowMask) wstyle |= WS_MINIMIZEBOX | WS_SYSMENU; if ((style & NSResizableWindowMask) == NSResizableWindowMask) wstyle |= WS_SIZEBOX | WS_MAXIMIZEBOX; if (((style & NSMiniWindowMask) == NSMiniWindowMask) || ((style & NSIconWindowMask) == NSIconWindowMask)) wstyle |= WS_ICONIC; if (wstyle == 0) wstyle = WS_POPUP; } //NSLog(@"Window wstyle %d for style %d", wstyle, style); return wstyle | WS_CLIPCHILDREN; } - (DWORD) exwindowStyleForGSStyle: (unsigned int) style { DWORD estyle = 0; if ((style & NSUtilityWindowMask) == NSUtilityWindowMask) { // WS_EX_TOOLWINDOW gives windows a thinner frame, like NSUtilityWindowMask estyle |= WS_EX_TOOLWINDOW; } if ([self usesNativeTaskbar]) { // We will put all bordered windows except utility windows in the // taskbar. Utility windows don't need to be in the taskbar since // they are in the floating window level, so always visible. if (style == NSBorderlessWindowMask) { // WS_EX_TOOLWINDOW also prevents windows from appearing in the taskbar. estyle |= WS_EX_TOOLWINDOW; } else if ((style & NSUtilityWindowMask) == 0) { // WS_EX_APPWINDOW requests that the window appear in the taskbar estyle |= WS_EX_APPWINDOW; } } else /* (NO == [self usesNativeTaskbar]) */ { // Prevent all windows from appearing in the taskbar. As an undesired // side effect this will give all windows with frames thin "tool window" // frames. We could also get rid of the taskbar buttons by creating // a hidden window, and setting it as the parent of all other windows, // but that would be more complicated to manage. // See http://msdn.microsoft.com/en-us/library/bb776822(v=VS.85).aspx#Managing_Taskbar_But estyle |= WS_EX_TOOLWINDOW; } return estyle; } - (void) resizeBackingStoreFor: (HWND)hwnd { #if (BUILD_GRAPHICS==GRAPHICS_winlib) WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)hwnd, GWLP_USERDATA); // FIXME: We should check if the size really did change. if (win->useHDC) { HDC hdc, hdc2; HBITMAP hbitmap; HGDIOBJ old; RECT r; old = SelectObject(win->hdc, win->old); DeleteObject(old); DeleteDC(win->hdc); win->hdc = NULL; win->old = NULL; GetClientRect((HWND)hwnd, &r); hdc = GetDC((HWND)hwnd); hdc2 = CreateCompatibleDC(hdc); hbitmap = CreateCompatibleBitmap(hdc, r.right - r.left, r.bottom - r.top); win->old = SelectObject(hdc2, hbitmap); win->hdc = hdc2; ReleaseDC((HWND)hwnd, hdc); // After resizing the backing store, we need to redraw the window win->backingStoreEmpty = YES; } #endif } - (BOOL) displayEvent: (unsigned int)uMsg; // diagnotic filter { [self subclassResponsibility: _cmd]; return YES; } // main event loop /* * Reset all of our flags before the next run through the event switch * */ - (void) setFlagsforEventLoop: (HWND)hwnd { flags._eventHandled = NO; // future house keeping can go here } - (void) freeCompositionStringForWindow: (HWND)hwnd { IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); // Free any buffer(s)... if (imeInfo->compString) free(imeInfo->compString); imeInfo->compString = NULL; imeInfo->compStringLength = 0; } - (void) freeReadStringForWindow: (HWND)hwnd { IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); // Free any buffer(s)... if (imeInfo->readString) free(imeInfo->readString); imeInfo->readString = NULL; imeInfo->readStringLength = 0; } - (void) freeCompositionInfoForWindow: (HWND)hwnd { // Clear information... [self freeCompositionStringForWindow: hwnd]; [self freeReadStringForWindow: hwnd]; } - (void) getCompositionStringForWindow: (HWND)hwnd { IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); HIMC immc = ImmGetContext(hwnd); // Current composition string... imeInfo->compStringLength = ImmGetCompositionStringW(immc, GCS_COMPSTR, NULL, 0); imeInfo->compString = malloc(imeInfo->compStringLength+sizeof(TCHAR)); ImmGetCompositionStringW(immc, GCS_COMPSTR, imeInfo->compString, imeInfo->compStringLength); // Cleanup... ImmReleaseContext(hwnd, immc); } - (void) getReadStringForWindow: (HWND)hwnd { IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); HIMC immc = ImmGetContext(hwnd); // Current read string... imeInfo->readStringLength = ImmGetCompositionStringW(immc, GCS_COMPREADSTR, NULL, 0); imeInfo->readString = malloc(imeInfo->readStringLength+sizeof(TCHAR)); ImmGetCompositionStringW(immc, GCS_COMPREADSTR, imeInfo->readString, imeInfo->readStringLength); // Cleanup... ImmReleaseContext(hwnd, immc); } - (void) saveCompositionInfoForWindow: (HWND)hwnd { // First, ensure we've cleared out any saved information... [self freeCompositionInfoForWindow: hwnd]; // Current composition string... [self getCompositionStringForWindow: hwnd]; // Current read string... [self getReadStringForWindow: hwnd]; } - (void) setCompositionStringForWindow: (HWND)hwnd { IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); HIMC immc = ImmGetContext(hwnd); // Restore the state... ImmSetCompositionStringW(immc, SCS_SETSTR, imeInfo->compString, imeInfo->compStringLength, NULL, 0); // Clear out any saved information... [self freeCompositionInfoForWindow: hwnd]; // Cleanup... ImmReleaseContext(hwnd, immc); } - (void) setReadStringForWindow: (HWND)hwnd { IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); HIMC immc = ImmGetContext(hwnd); // Restore the state... ImmSetCompositionStringW(immc, SCS_SETSTR, NULL, 0, imeInfo->readString, imeInfo->readStringLength); // Clear out any saved information... [self freeReadStringForWindow: hwnd]; // Cleanup... ImmReleaseContext(hwnd, immc); } - (void) restoreCompositionInfoForWindow: (HWND)hwnd { // Restore the state... [self setCompositionStringForWindow: hwnd]; // Restore the read string... [self setReadStringForWindow: hwnd]; } - (LRESULT) imnMessage: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { HIMC immc = ImmGetContext(hwnd); switch (wParam) { case IMN_CLOSESTATUSWINDOW: { NSDebugLog(@"IMN_CLOSESTATUSWINDOW: hwnd: %p wParam: %p lParam: %p immc: %p\n", hwnd, wParam, lParam, immc); if (immc) { ImmNotifyIME(immc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); HideCaret(hwnd); DestroyCaret(); } break; } case IMN_SETOPENSTATUS: { NSDebugLog(@"IMN_SETOPENSTATUS: hwnd: %p wParam: %p lParam: %p immc: %p\n", hwnd, wParam, lParam, immc); if (immc) { NSDebugLog(@"IMN_SETOPENSTATUS: openstatus: %d\n", ImmGetOpenStatus(immc)); IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); if (imeInfo == NULL) { NSDebugLog(@"IMN_SETOPENSTATUS: IME info pointer is NULL\n"); } else { if (ImmGetOpenStatus(immc)) { if (imeInfo->isOpened == NO) { // Restore previous information... #if defined(IME_SAVERESTORE_COMPOSITIONINFO) [self restoreCompositionInfoForWindow: hwnd]; #else ImmNotifyIME(immc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); #endif } } else if (imeInfo->isOpened == YES) { // Save current information... [self saveCompositionInfoForWindow: hwnd]; } // Save state... imeInfo->isOpened = ImmGetOpenStatus(immc); } #if defined(USE_SYSTEM_CARET) if (ImmGetOpenStatus(immc)) ShowCaret(hwnd); else HideCaret(hwnd); #endif #if defined(IME_SETCOMPOSITIONFONT) { LOGFONT logFont; ImmGetCompositionFont(immc, &logFont); LOGFONT newFont = logFont; newFont.lfCharSet = ((logFont.lfCharSet == DEFAULT_CHARSET) ? OEM_CHARSET : DEFAULT_CHARSET); ImmSetCompositionFont(immc, &newFont); NSDebugLog(@"IMN_SETOPENSTATUS: changing logfont from: %d to: %d\n", logFont.lfCharSet, newFont.lfCharSet); } #endif } break; } case IMN_OPENSTATUSWINDOW: { NSDebugLog(@"IMN_OPENSTATUSWINDOW: hwnd: %p wParam: %p lParam: %p immc: %p\n", hwnd, wParam, lParam, immc); if (immc) { NSDebugLog(@"IMN_OPENSTATUSWINDOW: openstatus: %d\n", ImmGetOpenStatus(immc)); LOGFONT logFont; { ImmGetCompositionFont(immc, &logFont); NSDebugLog(@"IMN_OPENSTATUSWINDOW: logfont - width: %d height: %d\n", logFont.lfWidth, logFont.lfHeight); } #if defined(USE_SYSTEM_CARET) CreateCaret(hwnd, NULL, logFont.lfWidth, logFont.lfHeight); if (ImmGetOpenStatus(immc)) ShowCaret(hwnd); else HideCaret(hwnd); #endif } break; } case IMN_CHANGECANDIDATE: NSDebugLog(@"IMN_CHANGECANDIDATE: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case IMN_CLOSECANDIDATE: NSDebugLog(@"IMN_CLOSECANDIDATE: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case IMN_OPENCANDIDATE: NSDebugLog(@"IMN_OPENCANDIDATE: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case IMN_SETCONVERSIONMODE: { NSDebugLog(@"IMN_SETCONVERSIONMODE: hwnd: %p wParam: %p lParam: %p immc: %p\n", hwnd, wParam, lParam, immc); if (immc) { DWORD conversion; DWORD sentence; if (ImmGetConversionStatus(immc, &conversion, &sentence) == 0) NSDebugLog(@"IMN_SETCONVERSIONMODE: error getting conversion status: %d\n", GetLastError()); else NSDebugLog(@"IMN_SETCONVERSIONMODE: conversion: %p sentence: %p\n", conversion, sentence); } break; } case IMN_SETSENTENCEMODE: { NSDebugLog(@"IMN_SETSENTENCEMODE: hwnd: %p wParam: %p lParam: %p immc: %p\n", hwnd, wParam, lParam, immc); if (immc) { DWORD conversion; DWORD sentence; if (ImmGetConversionStatus(immc, &conversion, &sentence) == 0) NSDebugLog(@"IMN_SETSENTENCEMODE: error getting conversion status: %d\n", GetLastError()); else NSDebugLog(@"IMN_SETSENTENCEMODE: conversion: %p sentence: %p\n", conversion, sentence); } break; } case IMN_SETCANDIDATEPOS: NSDebugLog(@"IMN_SETCANDIDATEPOS: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case IMN_SETCOMPOSITIONFONT: { NSDebugLog(@"IMN_SETCOMPOSITIONFONT: hwnd: %p wParam: %p lParam: %p immc: %p\n", hwnd, wParam, lParam, immc); if (immc) { #if defined(IME_SETCOMPOSITIONFONT) { LOGFONT logFont; ImmGetCompositionFont(immc, &logFont); NSDebugLog(@"IMN_SETCOMPOSITIONFONT: new character set: %d\n", logFont.lfCharSet); } #endif } break; } case IMN_SETCOMPOSITIONWINDOW: NSDebugLog(@"IMN_SETCOMPOSITIONWINDOW: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case IMN_SETSTATUSWINDOWPOS: NSDebugLog(@"IMN_SETSTATUSWINDOWPOS: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case IMN_GUIDELINE: NSDebugLog(@"IMN_GUIDELINE: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case IMN_PRIVATE: NSDebugLog(@"IMN_PRIVATE: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; default: NSDebugLog(@"Unknown IMN message: %p hwnd: %p\n", wParam, hwnd); break; } // Release the IME context... ImmReleaseContext(hwnd, immc); return 0; } - (NSEvent*)imeCompositionMessage: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { NSDebugLog(@"WM_IME_COMPOSITION: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); HIMC immc = ImmGetContext(hwnd); if (immc == 0) { NSWarnMLog(@"IMMContext is NULL\n"); } else if (lParam & GCS_RESULTSTR) { // Update our composition string information... LONG length = ImmGetCompositionStringW(immc, GCS_RESULTSTR, NULL, 0); NSDebugLog(@"length: %d\n", length); if (length) { TCHAR composition[length+sizeof(TCHAR)]; length = ImmGetCompositionStringW(immc, GCS_RESULTSTR, &composition, length); { int index; for (index = 0; index < length; ++index) NSDebugLog(@"%2.2X ", composition[index]); } NSDebugLog(@"composition (uKeys): %@\n", [NSString stringWithCharacters: (unichar*)composition length: length]); } ImmReleaseContext(hwnd, immc); } return 0; } - (LRESULT) imeCharacter: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { BYTE keyState[256]; // Get the current key states... GetKeyboardState(keyState); // key events should go to the key window if we have one (Windows' focus window isn't always appropriate) int windowNumber = [[NSApp keyWindow] windowNumber]; if (windowNumber == 0) windowNumber = (int)hwnd; /* FIXME: How do you guarentee a context is associated with an event? */ NSGraphicsContext *gcontext = GSCurrentContext(); LONG ltime = GetMessageTime(); NSTimeInterval time = ltime / 1000.0f; BOOL repeat = (lParam & 0xFFFF) != 0; unsigned int eventFlags = mask_for_keystate(keyState); DWORD pos = GetMessagePos(); NSPoint eventLocation = MSWindowPointToGS(self, hwnd, GET_X_LPARAM(pos), GET_Y_LPARAM(pos)); NSString *keys = [NSString stringWithCharacters: (unichar*)&wParam length: 1]; NSString *ukeys = [NSString stringWithCharacters: (unichar*)&wParam length: 1]; // Create a NSKeyDown message... NSEvent *ev = [NSEvent keyEventWithType: NSKeyDown location: eventLocation modifierFlags: eventFlags timestamp: time windowNumber: windowNumber context: gcontext characters: keys charactersIgnoringModifiers: ukeys isARepeat: repeat keyCode: wParam]; // Post it... [GSCurrentServer() postEvent: ev atStart: NO]; // then an associated NSKeyUp message... ev = [NSEvent keyEventWithType: NSKeyUp location: eventLocation modifierFlags: eventFlags timestamp: time windowNumber: windowNumber context: gcontext characters: keys charactersIgnoringModifiers: ukeys isARepeat: repeat keyCode: wParam]; // Post it... [GSCurrentServer() postEvent: ev atStart: NO]; return 0; } - (LRESULT) windowEventProc: (HWND)hwnd : (UINT)uMsg : (WPARAM)wParam : (LPARAM)lParam { NSEvent *ev = nil; [self setFlagsforEventLoop: hwnd]; switch (uMsg) { case WM_MOUSELEAVE: { /* If the cursor leave the window remove the GNUstep cursors, send * the appropriate message and tell GNUstep stop handling * the cursor. */ NSEvent *e; e = [NSEvent otherEventWithType: NSAppKitDefined location: NSMakePoint(-1,-1) modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowLeave data1: 0 data2: 0]; [GSCurrentServer() postEvent: e atStart: YES]; should_handle_cursor = NO; } break; case WM_SIZING: return [self decodeWM_SIZINGParams: hwnd : wParam : lParam]; break; case WM_NCCREATE: return [self decodeWM_NCCREATEParams: wParam : lParam : hwnd]; break; case WM_NCCALCSIZE: [self decodeWM_NCCALCSIZEParams: wParam : lParam : hwnd]; break; case WM_NCACTIVATE: [self decodeWM_NCACTIVATEParams: wParam : lParam : hwnd]; break; case WM_NCPAINT: if ([self handlesWindowDecorations]) [self decodeWM_NCPAINTParams: wParam : lParam : hwnd]; break; case WM_SHOWWINDOW: //[self decodeWM_SHOWWINDOWParams: wParam : lParam : hwnd]; break; case WM_NCDESTROY: [self decodeWM_NCDESTROYParams: wParam : lParam : hwnd]; break; case WM_GETTEXT: [self decodeWM_GETTEXTParams: wParam : lParam : hwnd]; break; case WM_STYLECHANGING: break; case WM_STYLECHANGED: break; case WM_GETMINMAXINFO: return [self decodeWM_GETMINMAXINFOParams: wParam : lParam : hwnd]; break; case WM_CREATE: return [self decodeWM_CREATEParams: wParam : lParam : hwnd]; break; case WM_WINDOWPOSCHANGING: [self decodeWM_WINDOWPOSCHANGINGParams: wParam : lParam : hwnd]; break; case WM_WINDOWPOSCHANGED: [self decodeWM_WINDOWPOSCHANGEDParams: wParam : lParam : hwnd]; break; case WM_MOVE: return [self decodeWM_MOVEParams: hwnd : wParam : lParam]; break; case WM_MOVING: return [self decodeWM_MOVINGParams: hwnd : wParam : lParam]; break; case WM_SIZE: return [self decodeWM_SIZEParams: hwnd : wParam : lParam]; break; case WM_ENTERSIZEMOVE: return [self decodeWM_ENTERSIZEMOVEParams: wParam : lParam : hwnd]; break; case WM_EXITSIZEMOVE: return [self decodeWM_EXITSIZEMOVEParams: wParam : lParam : hwnd]; break; case WM_ACTIVATE: if ((int)lParam !=0) [self decodeWM_ACTIVEParams: wParam : lParam : hwnd]; break; case WM_ACTIVATEAPP: return [self decodeWM_ACTIVEAPPParams: hwnd : wParam : lParam]; break; case WM_SETFOCUS: return [self decodeWM_SETFOCUSParams: wParam : lParam : hwnd]; break; case WM_KILLFOCUS: if (wParam == (int)hwnd) return 0; else [self decodeWM_KILLFOCUSParams: wParam : lParam : hwnd]; break; case WM_SETCURSOR: if (wParam == (int)hwnd) { // Check if GNUstep should handle the cursor. if (should_handle_cursor) { flags._eventHandled = YES; } } break; case WM_QUERYOPEN: [self decodeWM_QUERYOPENParams: wParam : lParam : hwnd]; break; case WM_CAPTURECHANGED: [self decodeWM_CAPTURECHANGEDParams: wParam : lParam : hwnd]; break; case WM_ERASEBKGND: return [self decodeWM_ERASEBKGNDParams: wParam : lParam : hwnd]; break; case WM_PAINT: [self decodeWM_PAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd]; break; case WM_SYNCPAINT: if ([self handlesWindowDecorations]) [self decodeWM_SYNCPAINTParams: wParam : lParam : hwnd]; break; case WM_CLOSE: [self decodeWM_CLOSEParams: wParam : lParam : hwnd]; break; case WM_DESTROY: [self decodeWM_DESTROYParams: wParam : lParam : hwnd]; break; case WM_QUIT: break; case WM_USER: break; case WM_APP: break; case WM_ENTERMENULOOP: /* If the user open a native contextual menu (a non GNUstep window) * send the appropriate message and tell GNUstep stop handling * the cursor. */ if (wParam) { NSEvent *e; [GSWindowWithNumber((int)hwnd) resetCursorRects]; e = [NSEvent otherEventWithType: NSAppKitDefined location: NSMakePoint(-1,-1) modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowLeave data1: 0 data2: 0]; [GSCurrentServer() postEvent: e atStart: YES]; should_handle_cursor = NO; } break; case WM_EXITMENULOOP: break; case WM_INITMENU: break; case WM_MENUSELECT: break; case WM_ENTERIDLE: break; case WM_COMMAND: [self decodeWM_COMMANDParams: wParam : lParam : hwnd]; break; case WM_THEMECHANGED: [self decodeWM_THEMECHANGEDParams: wParam : lParam : hwnd]; break; case WM_SYSKEYDOWN: //KEYBOARD NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "SYSKEYDOWN", hwnd); ev = process_key_event(self, hwnd, wParam, lParam, NSKeyDown); break; case WM_SYSKEYUP: //KEYBOARD NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "SYSKEYUP", hwnd); ev = process_key_event(self, hwnd, wParam, lParam, NSKeyUp); break; case WM_SYSCOMMAND: [self decodeWM_SYSCOMMANDParams: wParam : lParam : hwnd]; break; case WM_HELP: break; //case WM_GETICON: //return [self decodeWM_GETICONParams: wParam : lParam : hwnd]; //break; //case WM_SETICON: //return [self decodeWM_SETICONParams: wParam : lParam : hwnd]; //break; case WM_CANCELMODE: break; case WM_ENABLE: case WM_CHILDACTIVATE: break; case WM_NULL: break; case WM_NCHITTEST: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCHITTEST", hwnd); break; case WM_NCMOUSEMOVE: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCMOUSEMOVE", hwnd); break; case WM_NCLBUTTONDOWN: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCLBUTTONDOWN", hwnd); break; case WM_NCLBUTTONUP: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCLBUTTONUP", hwnd); break; case WM_MOUSEACTIVATE: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "MOUSEACTIVATE", hwnd); break; case WM_MOUSEMOVE: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "MOUSEMOVE", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSMouseMoved, uMsg); break; case WM_LBUTTONDOWN: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "LBUTTONDOWN", hwnd); //[self decodeWM_LBUTTONDOWNParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd]; ev = process_mouse_event(self, hwnd, wParam, lParam, NSLeftMouseDown, uMsg); break; case WM_LBUTTONUP: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "LBUTTONUP", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSLeftMouseUp, uMsg); break; case WM_LBUTTONDBLCLK: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "LBUTTONDBLCLK", hwnd); break; case WM_MBUTTONDOWN: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "MBUTTONDOWN", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSOtherMouseDown, uMsg); break; case WM_MBUTTONUP: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "MBUTTONUP", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSOtherMouseUp, uMsg); break; case WM_MBUTTONDBLCLK: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "MBUTTONDBLCLK", hwnd); break; case WM_RBUTTONDOWN: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "RBUTTONDOWN", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSRightMouseDown, uMsg); break; case WM_RBUTTONUP: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "RBUTTONUP", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSRightMouseUp, uMsg); break; case WM_RBUTTONDBLCLK: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "RBUTTONDBLCLK", hwnd); break; case WM_MOUSEHWHEEL: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "MOUSEHWHEEL", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSScrollWheel, uMsg); break; case WM_MOUSEWHEEL: //MOUSE NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "MOUSEWHEEL", hwnd); ev = process_mouse_event(self, hwnd, wParam, lParam, NSScrollWheel, uMsg); break; // WINDOWS IME PROCESSING MESSAGES... case WM_IME_NOTIFY: [self imnMessage: hwnd : wParam : lParam]; break; case WM_IME_REQUEST: NSDebugLog(@"WM_IME_REQUEST: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_IME_SELECT: NSDebugLog(@"WM_IME_SELECT: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_IME_SETCONTEXT: NSDebugLog(@"WM_IME_SETCONTEXT: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_IME_STARTCOMPOSITION: { NSDebugLog(@"WM_IME_STARTCOMPOSITION: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); if (imeInfo) imeInfo->isComposing = YES; break; } case WM_IME_ENDCOMPOSITION: { NSDebugLog(@"WM_IME_ENDCOMPOSITION: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); if (imeInfo) imeInfo->isComposing = NO; break; } case WM_IME_COMPOSITION: { IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); if (imeInfo && imeInfo->isComposing) ev = [self imeCompositionMessage: hwnd : wParam : lParam]; break; } case WM_IME_COMPOSITIONFULL: NSDebugLog(@"WM_IME_COMPOSITIONFULL: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_IME_KEYDOWN: NSDebugLog(@"WM_IME_KEYDOWN: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); if (wParam == 0xd) // Carriage return... { HIMC immc = ImmGetContext(hwnd); if (immc) { // If currently in a composition sequence in the IMM... ImmNotifyIME(immc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); // Release the context... ImmReleaseContext(hwnd, immc); } } // Don't pass this message on for processing... flags._eventHandled = YES; break; case WM_IME_KEYUP: NSDebugLog(@"WM_IME_KEYUP: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_IME_CHAR: return [self imeCharacter: hwnd : wParam : lParam]; break; case WM_CHAR: NSDebugLog(@"WM_CHAR: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_INPUTLANGCHANGEREQUEST: NSDebugLog(@"WM_INPUTLANGCHANGEREQUEST: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_INPUTLANGCHANGE: NSDebugLog(@"WM_INPUTLANGCHANGE: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); break; case WM_KEYDOWN: //KEYBOARD NSDebugLog(@"WM_KEYDOWN: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "KEYDOWN", hwnd); ev = process_key_event(self, hwnd, wParam, lParam, NSKeyDown); break; case WM_KEYUP: //KEYBOARD NSDebugLog(@"WM_KEYUP: hwnd: %p wParam: %p lParam: %p\n", hwnd, wParam, lParam); NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "KEYUP", hwnd); ev = process_key_event(self, hwnd, wParam, lParam, NSKeyUp); break; case WM_POWERBROADCAST: //SYSTEM NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "POWERBROADCAST", hwnd); break; case WM_TIMECHANGE: //SYSTEM NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "TIMECHANGE", hwnd); break; case WM_DEVICECHANGE: //SYSTEM NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "DEVICECHANGE", hwnd); break; default: // Process all other messages. NSDebugLLog(@"NSEvent", @"Got unhandled Message %d for %d", uMsg, hwnd); break; } /* * see if the event was handled in the the main loop or in the * menu loop. if eventHandled = YES then we are done and need to * tell the windows event handler we are finished */ if (flags._eventHandled == YES) return 0; if (ev != nil) { [GSCurrentServer() postEvent: ev atStart: NO]; return 0; } /* * We did not care about the event, return it back to the windows * event handler */ return DefWindowProcW(hwnd, uMsg, wParam, lParam); } - glContextClass { #ifdef HAVE_WGL return [Win32GLContext class]; #else return nil; #endif } - glPixelFormatClass { #ifdef HAVE_WGL return [Win32GLPixelFormat class]; #else return nil; #endif } @end @implementation WIN32Server (WindowOps) /* styleMask specifies the receiver's style. It can either be NSBorderlessWindowMask, or it can contain any of the following options, combined using the C bitwise OR operator: Option Meaning NSTitledWindowMask The NSWindow displays a title bar. NSClosableWindowMask The NSWindow displays a close button. NSMiniaturizableWindowMask The NSWindow displays a miniaturize button. NSResizableWindowMask The NSWindow displays a resize bar or border. NSBorderlessWindowMask NSBorderlessWindowMask 0 NSTitledWindowMask 1 NSClosableWindowMask 2 NSMiniaturizableWindowMask 4 NSResizableWindowMask 8 NSIconWindowMask 64 NSMiniWindowMask 128 Borderless windows display none of the usual peripheral elements and are generally useful only for display or caching purposes; you should normally not need to create them. Also, note that an NSWindow's style mask should include NSTitledWindowMask if it includes any of the others. backingType specifies how the drawing done in the receiver is buffered by the object's window device: NSBackingStoreBuffered NSBackingStoreRetained NSBackingStoreNonretained flag determines whether the Window Server creates a window device for the new object immediately. If flag is YES, it defers creating the window until the receiver is moved on screen. All display messages sent to the NSWindow or its NSViews are postponed until the window is created, just before it's moved on screen. Deferring the creation of the window improves launch time and minimizes the virtual memory load on the Window Server. The new NSWindow creates an instance of NSView to be its default content view. You can replace it with your own object by using the setContentView: method. */ - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style : (int) screen { HWND hwnd; RECT r; DWORD wstyle; DWORD estyle; wstyle = [self windowStyleForGSStyle: style]; estyle = [self exwindowStyleForGSStyle: style]; r = GSScreenRectToMS(frame); NSDebugLLog(@"WTrace", @"window: %@ : %d : %d : %d", NSStringFromRect(frame), type, style, screen); NSDebugLLog(@"WTrace", @" device frame: %d, %d, %d, %d", r.left, r.top, r.right - r.left, r.bottom - r.top); hwnd = CreateWindowEx(estyle | WS_EX_LAYERED, "GNUstepWindowClass", "GNUstepWindow", #if (BUILD_GRAPHICS==GRAPHICS_cairo) ((wstyle & WS_POPUP) ? ((wstyle & ~WS_POPUP) | WS_OVERLAPPED) : wstyle), #else wstyle, #endif r.left, r.top, r.right - r.left, r.bottom - r.top, (HWND)NULL, (HMENU)NULL, hinstance, (void*)type); NSDebugLLog(@"WCTrace", @" num/handle: %d", hwnd); if (hwnd == NULL) { NSLog(@"CreateWindowEx Failed %d", GetLastError()); } else { #if (BUILD_GRAPHICS==GRAPHICS_cairo) // Borderless window request... if (wstyle & WS_POPUP) { LONG_PTR wstyleOld = GetWindowLongPtr(hwnd, GWL_STYLE); LONG_PTR estyleOld = GetWindowLongPtr(hwnd, GWL_EXSTYLE); LONG_PTR wstyleNew = (wstyleOld & ~WS_OVERLAPPEDWINDOW); LONG_PTR estyleNew = estyleOld | WS_EX_TOOLWINDOW; NSDebugMLLog(@"WCTrace", @"wstyles - old: %8.8X new: %8.8X\n", wstyleOld, wstyleNew); NSDebugMLLog(@"WCTrace", @"estyles - old: %8.8X new: %8.8X\n", estyleOld, estyleNew); // Modify window style parameters and update the window information... SetWindowLongPtr(hwnd, GWL_STYLE, wstyleNew); SetWindowLongPtr(hwnd, GWL_EXSTYLE, estyleNew); SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSENDCHANGING | SWP_NOREPOSITION | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); } #endif SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA); [self _setWindowOwnedByServer: (int)hwnd]; } return (int)hwnd; } - (void) termwindow: (int) winNum { NSDebugLLog(@"WCTrace", @"termwindow: %d", winNum); if (!DestroyWindow((HWND)winNum)) { NSLog(@"DestroyWindow Failed %d", GetLastError()); } } - (void) stylewindow: (unsigned int)style : (int) winNum { DWORD wstyle = [self windowStyleForGSStyle: style]; DWORD estyle = [self exwindowStyleForGSStyle: style]; NSAssert([self handlesWindowDecorations], @"-stylewindow: : called when [self handlesWindowDecorations] == NO"); NSDebugLLog(@"WTrace", @"stylewindow: %d : %d", style, winNum); SetWindowLongPtr((HWND)winNum, GWL_STYLE, wstyle); SetWindowLongPtr((HWND)winNum, GWL_EXSTYLE, estyle); } - (void) setbackgroundcolor: (NSColor *)color : (int)win { } /** Changes window's the backing store to type */ - (void) windowbacking: (NSBackingStoreType)type : (int) winNum { WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA); NSDebugLLog(@"WTrace", @"windowbacking: %d : %d", type, winNum); #if (BUILD_GRAPHICS==GRAPHICS_winlib) if (win->useHDC) { HGDIOBJ old; old = SelectObject(win->hdc, win->old); DeleteObject(old); DeleteDC(win->hdc); win->hdc = NULL; win->old = NULL; win->useHDC = NO; } if (type != NSBackingStoreNonretained) { HDC hdc, hdc2; HBITMAP hbitmap; RECT r; GetClientRect((HWND)winNum, &r); hdc = GetDC((HWND)winNum); hdc2 = CreateCompatibleDC(hdc); hbitmap = CreateCompatibleBitmap(hdc, r.right - r.left, r.bottom - r.top); win->old = SelectObject(hdc2, hbitmap); win->hdc = hdc2; win->useHDC = YES; win->backingStoreEmpty = YES; ReleaseDC((HWND)winNum, hdc); } else #endif { win->useHDC = NO; win->hdc = NULL; } // Save updated window backing store type... win->type = type; } - (void) titlewindow: (NSString*)window_title : (int) winNum { NSDebugLLog(@"WTrace", @"titlewindow: %@ : %d", window_title, winNum); SetWindowTextW((HWND)winNum, (const unichar*) [window_title cStringUsingEncoding: NSUnicodeStringEncoding]); } - (void) miniwindow: (int) winNum { NSDebugLLog(@"WTrace", @"miniwindow: %d", winNum); ShowWindow((HWND)winNum, SW_MINIMIZE); } /** Returns NO as we don't provide mini windows on MS Windows */ - (BOOL) appOwnsMiniwindow { return NO; } - (void) setWindowdevice: (int)winNum forContext: (NSGraphicsContext *)ctxt { RECT rect; float h, l, r, t, b; NSWindow *window; NSDebugLLog(@"WTrace", @"windowdevice: %d", winNum); window = GSWindowWithNumber(winNum); /* FIXME: * The windows with autodisplay set to NO aren't displayed correctly on * Windows, no matter the backing store type used. And trying to redisplay * these windows here in the server not takes effect. So if the window * have set autodisplay to NO, we change it to YES before create the window. * This problem affects the tooltips, but this solution is different to * the one used in the TestPlant branch. Because that solution involves * changes in the side of GUI. */ if (![window isAutodisplay]) { [window setAutodisplay: YES]; } GetClientRect((HWND)winNum, &rect); h = rect.bottom - rect.top; [self styleoffsets: &l : &r : &t : &b : [window styleMask]]; GSSetDevice(ctxt, (void*)winNum, l, h + b); DPSinitmatrix(ctxt); DPSinitclip(ctxt); } - (void) orderwindow: (int) op : (int) otherWin : (int) winNum { int flag = 0; int foreground = 0; int otherLevel; int level; NSWindow *window = GSWindowWithNumber(winNum); NSDebugLLog(@"WTrace", @"orderwindow: %d : %d : %d", op, otherWin, winNum); if ([self usesNativeTaskbar]) { /* When using this policy, we make these changes: - don't show the application icon window - Never order out the main menu, just minimize it, so that when the user clicks on it in the taskbar it will activate the application. */ int special; special = [[NSApp iconWindow] windowNumber]; if (winNum == special) { return; } special = [[[NSApp mainMenu] window] windowNumber]; if (winNum == special && op == NSWindowOut) { ShowWindow((HWND)winNum, SW_MINIMIZE); return; } } if (op == NSWindowOut) { SetWindowLongPtr((HWND)winNum, OFF_ORDERED, 0); ShowWindow((HWND)winNum, SW_HIDE); return; } if (![window canBecomeMainWindow] && ![window canBecomeKeyWindow]) { // Bring front, but do not activate, eg - tooltips flag = SW_SHOWNA; } else { flag = SW_SHOW; if (IsIconic((HWND)winNum)) flag = SW_RESTORE; } ShowWindow((HWND)winNum, flag); SetWindowLongPtr((HWND)winNum, OFF_ORDERED, 1); // Process window leveling... level = GetWindowLongPtr((HWND)winNum, OFF_LEVEL); if (otherWin <= 0) { if (otherWin == 0 && op == NSWindowAbove) { /* This combination means we should move to the top of the current * window level but stay below the key window, so if we have a key * window (other than the current window), we store it's id for * testing later. */ foreground = (int)GetForegroundWindow(); if (foreground < 0 || foreground == winNum) { foreground = 0; } } otherWin = 0; } if (otherWin > 0) { /* Put this on the same window level as the window we are ordering * it against. */ otherLevel = GetWindowLongPtr((HWND)otherWin, OFF_LEVEL); if (level != otherLevel) { NSDebugLLog(@"WTrace", @"orderwindow: implicitly set level of %d (%d) to that of %d (%d)", winNum, level, otherWin, otherLevel); level = otherLevel; SetWindowLongPtr((HWND)winNum, OFF_LEVEL, level); } } if (level <= NSDesktopWindowLevel) { HWND desktop = GetDesktopWindow(); // For desktop level, put this at the bottom of the z-order SetParent((HWND)winNum, desktop); otherWin = (int)HWND_BOTTOM; NSDebugLLog(@"WTrace", @"orderwindow: set %i (%i) to bottom", winNum, level); } else if (otherWin == 0 || op == NSWindowAbove) { if (otherWin == 0) { /* Start searching from bottom of window list... * The last child of the desktop. */ otherWin = (int)GetDesktopWindow(); otherWin = (int)GetWindow((HWND)otherWin, GW_CHILD); if (otherWin > 0) { otherWin = (int)GetWindow((HWND)otherWin, GW_HWNDLAST); } } NSDebugLLog(@"WTrace", @"orderwindow: traverse for %d (%d) starting at %d", winNum, level, otherWin); while (otherWin > 0) { TCHAR buf[32]; otherWin = (int)GetNextWindow((HWND)otherWin, GW_HWNDPREV); /* We only look at gnustep windows (other than the one being * ordered) to decide where to place our window. * The assumption is, that if we are ordering a window in, * we want it to be above any non-gnustep window. * FIXME ... perhaps we should move all non-gnustep windows * to be lower than the lowest (excluding gnustep desktop * level windows I suppose) gnustep window. */ if (otherWin > 0 && otherWin != winNum && GetClassName((HWND)otherWin, buf, 32) == 18 && strncmp(buf, "GNUstepWindowClass", 18) == 0) { if (GetWindowLongPtr((HWND)otherWin, OFF_ORDERED) == 1) { otherLevel = GetWindowLongPtr((HWND)otherWin, OFF_LEVEL); NSDebugLLog(@"WTrace", @"orderwindow: found gnustep window %d (%d)", otherWin, otherLevel); if (otherLevel >= level) { if (otherLevel > level) { /* On windows, there is no notion of levels, so * native apps will automatically move to the * very top of the stack (above our alert panels etc) * * So to cope with this, when we move to the top * of a level, we assume there may be native apps * above us and we set otherWin=0 to move to the * very top of the stack past them. * * We rely on the fact that we have code in the * window positioning notification to rearrange * (sort) all the windows into level order if * moving this window to the top messes up the * level ordering. */ otherWin = 0; break; } if (op == NSWindowBelow || foreground == otherWin) { break; } } } } } } if (otherWin == 0) { otherWin = (int)HWND_TOP; NSDebugLLog(@"WTrace", @"orderwindow: set %i (%i) to top", winNum, level); } else if (otherWin == (int)HWND_BOTTOM) { NSDebugLLog(@"WTrace", @"orderwindow: set %i (%i) to bottom", winNum, level); } else { NSDebugLLog(@"WTrace", @"orderwindow: set %i (%i) below %d", winNum, level, otherWin); } SetWindowPos((HWND)winNum, (HWND)otherWin, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); if (otherWin == (int)HWND_TOP) { _enableCallbacks = NO; if (SetForegroundWindow((HWND)winNum) == 0) NSDebugMLLog(@"WError", @"SetForegroundWindow error for HWND: %p\n", winNum); _enableCallbacks = YES; } /* For debug log window stack. */ if (GSDebugSet(@"WTrace") == YES) { NSString *s = @"Window list:\n"; otherWin = (int)GetDesktopWindow(); otherWin = (int)GetWindow((HWND)otherWin, GW_CHILD); if (otherWin > 0) { otherWin = (int)GetWindow((HWND)otherWin, GW_HWNDLAST); } while (otherWin > 0) { TCHAR buf[32]; otherWin = (int)GetNextWindow((HWND)otherWin, GW_HWNDPREV); if (otherWin > 0 && GetClassName((HWND)otherWin, buf, 32) == 18 && strncmp(buf, "GNUstepWindowClass", 18) == 0) { if (GetWindowLongPtr((HWND)otherWin, OFF_ORDERED) == 1) { otherLevel = GetWindowLongPtr((HWND)otherWin, OFF_LEVEL); s = [s stringByAppendingFormat: @"%d (%d)\n", otherWin, otherLevel]; } } } NSDebugLLog(@"WTrace", @"orderwindow: %@", s); } } - (void) movewindow: (NSPoint)loc : (int)winNum { POINT p; NSDebugLLog(@"WTrace", @"movewindow: %@ : %d", NSStringFromPoint(loc), winNum); p = GSWindowOriginToMS((HWND)winNum, loc); SetWindowPos((HWND)winNum, NULL, p.x, p.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); } - (void) placewindow: (NSRect)frame : (int) winNum { RECT r; RECT r2; NSDebugLLog(@"WTrace", @"placewindow: %@ : %d", NSStringFromRect(frame), winNum); r = GSScreenRectToMS(frame); GetWindowRect((HWND)winNum, &r2); SetWindowPos((HWND)winNum, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSENDCHANGING); #if (BUILD_GRAPHICS==GRAPHICS_winlib) WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA); if ((win->useHDC) && (r.right - r.left != r2.right - r2.left) && (r.bottom - r.top != r2.bottom - r2.top)) { HDC hdc, hdc2; HBITMAP hbitmap; HGDIOBJ old; old = SelectObject(win->hdc, win->old); DeleteObject(old); DeleteDC(win->hdc); win->hdc = NULL; win->old = NULL; GetClientRect((HWND)winNum, &r); hdc = GetDC((HWND)winNum); hdc2 = CreateCompatibleDC(hdc); hbitmap = CreateCompatibleBitmap(hdc, r.right - r.left, r.bottom - r.top); win->old = SelectObject(hdc2, hbitmap); win->hdc = hdc2; ReleaseDC((HWND)winNum, hdc); } #endif } - (BOOL) findwindow: (NSPoint)loc : (int) op : (int) otherWin : (NSPoint *)floc : (int*) winFound { return NO; } - (NSRect) windowbounds: (int) winNum { RECT r; GetWindowRect((HWND)winNum, &r); return MSScreenRectToGS(r); } - (void) setwindowlevel: (int) level : (int) winNum { NSDebugLLog(@"WTrace", @"setwindowlevel: %d : %d", level, winNum); if (GetWindowLongPtr((HWND)winNum, OFF_LEVEL) != level) { SetWindowLongPtr((HWND)winNum, OFF_LEVEL, level); if (GetWindowLongPtr((HWND)winNum, OFF_ORDERED) == YES) { [self orderwindow: NSWindowAbove : 0 : winNum]; } } } - (int) windowlevel: (int) winNum { return GetWindowLongPtr((HWND)winNum, OFF_LEVEL); } - (NSArray *) windowlist { NSMutableArray *list = [NSMutableArray arrayWithCapacity: 100]; HWND w; HWND next; w = GetForegroundWindow(); // Try to start with frontmost window if (w == NULL) { w = GetDesktopWindow(); // This should always succeed. w = GetWindow(w, GW_CHILD); } /* Step up to the frontmost window. */ while ((next = GetNextWindow(w, GW_HWNDPREV)) != NULL) { w = next; } /* Now walk down the window list populating the array. */ while (w != NULL) { /* Only add windows we own. * FIXME We should improve the API to support all windows on server. */ if (GSWindowWithNumber((int)w) != nil) { [list addObject: [NSNumber numberWithInt: (int)w]]; } w = GetNextWindow(w, GW_HWNDNEXT); } return list; } - (int) windowdepth: (int) winNum { return 0; } /** Set the maximum size of the window */ - (void) setmaxsize: (NSSize)size : (int) winNum { WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA); POINT p; p.x = size.width; p.y = size.height; win->minmax.ptMaxTrackSize = p; // Disable the maximize box if a maximum size is set if (size.width < 10000 || size.height < 10000) { SetWindowLongPtr((HWND)winNum, GWL_STYLE, GetWindowLongPtr((HWND)winNum, GWL_STYLE) ^ WS_MAXIMIZEBOX); } else { SetWindowLongPtr((HWND)winNum, GWL_STYLE, GetWindowLongPtr((HWND)winNum, GWL_STYLE) | WS_MAXIMIZEBOX); } } /** Set the minimum size of the window */ - (void) setminsize: (NSSize)size : (int) winNum { WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)winNum, GWLP_USERDATA); POINT p; p.x = size.width; p.y = size.height; win->minmax.ptMinTrackSize = p; } /** Set the resize incremenet of the window */ - (void) setresizeincrements: (NSSize)size : (int) winNum { } /** Causes buffered graphics to be flushed to the screen */ - (void) flushwindowrect: (NSRect)rect : (int)winNum { HWND hwnd = (HWND)winNum; WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr(hwnd, GWLP_USERDATA); if (win) { #if (BUILD_GRAPHICS==GRAPHICS_winlib) if (win->useHDC) { HDC hdc = GetDC(hwnd); RECT r = GSWindowRectToMS(self, hwnd, rect); WINBOOL result; result = BitBlt(hdc, r.left, r.top, (r.right - r.left), (r.bottom - r.top), win->hdc, r.left, r.top, SRCCOPY); if (!result) { NSLog(@"Flush window %d %@", hwnd, NSStringFromRect(MSWindowRectToGS(self, hwnd, r))); NSLog(@"Flush window failed with %d", GetLastError()); } ReleaseDC(hwnd, hdc); } #elif (BUILD_GRAPHICS==GRAPHICS_cairo) if (win->surface == NULL) { NSWarnMLog(@"NULL surface for window %p", hwnd); } else { [[GSCurrentContext() class] handleExposeRect: rect forDriver: (void*)win->surface]; } #else #error INVALID build graphics type #endif } } - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b : (unsigned int) style { if ([self handlesWindowDecorations]) { DWORD wstyle = [self windowStyleForGSStyle: style]; DWORD estyle = [self exwindowStyleForGSStyle: style]; RECT rect = {100, 100, 200, 200}; AdjustWindowRectEx(&rect, wstyle, NO, estyle); *l = 100 - rect.left; *r = rect.right - 200; *t = 100 - rect.top; *b = rect.bottom - 200; //NSLog(@"Style 0x%X offset %f %f %f %f", wstyle, *l, *r, *t, *b); } else { /* If we don't handle decorations, all our windows are going to be border- and decorationless. In that case, -gui won't call this method, but we still use it internally. */ *l = *r = *t = *b = 0.0; } } - (void) docedited: (int) edited : (int) winNum { } - (void) setinputstate: (int)state : (int)winNum { if ([self handlesWindowDecorations] == NO) { return; } if (state == GSTitleBarMain) { _enableCallbacks = NO; SetActiveWindow((HWND)winNum); _enableCallbacks = YES; } } /** Forces focus to the window so that all key events are sent to this window */ - (void) setinputfocus: (int) winNum { NSDebugLLog(@"WTrace", @"setinputfocus: %d", winNum); NSDebugLLog(@"Focus", @"Setting input focus to %d", winNum); if (winNum == 0) { NSDebugLLog(@"Focus", @" invalid focus window"); return; } if (currentFocus == (HWND)winNum) { NSDebugLLog(@"Focus", @" window already has focus"); return; } desiredFocus = (HWND)winNum; SetFocus((HWND)winNum); } - (void) setalpha: (float)alpha: (int) win { if (alpha > 0.99) { SetWindowLongPtr((HWND)win, GWL_EXSTYLE, GetWindowLongPtr((HWND)win, GWL_EXSTYLE) & ~WS_EX_LAYERED); RedrawWindow((HWND)win, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); } else { SetWindowLongPtr((HWND)win, GWL_EXSTYLE, GetWindowLongPtr((HWND)win, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes((HWND)win, 0, 255 * alpha, LWA_ALPHA); } } - (NSPoint) mouselocation { POINT p; if (!GetCursorPos(&p)) { // Try using cursorInfo which should work in more situations CURSORINFO cursorInfo; cursorInfo.cbSize = sizeof(CURSORINFO); if (!GetCursorInfo(&cursorInfo)) { NSLog(@"GetCursorInfo failed with %d", GetLastError()); return NSZeroPoint; } p = cursorInfo.ptScreenPos; } return MSScreenPointToGS(p.x, p.y); } - (NSPoint) mouseLocationOnScreen: (int)screen window: (int *)win { return [self mouselocation]; } - (BOOL) capturemouse: (int) winNum { NSDebugLLog(@"WTrace", @"capturemouse: %d", winNum); SetCapture((HWND)winNum); return YES; } - (void) releasemouse { NSDebugLLog(@"WTrace", @"releasemouse"); ReleaseCapture(); } - (void) hidecursor { NSDebugLLog(@"WTrace", @"hidecursor"); ShowCursor(NO); } - (void) showcursor { ShowCursor(YES); } - (void) standardcursor: (int)style : (void **)cid { HCURSOR hCursor = 0; NSDebugLLog(@"WTrace", @"standardcursor: %d", style); switch (style) { case GSArrowCursor: hCursor = LoadCursor(NULL, IDC_ARROW); break; case GSIBeamCursor: hCursor = LoadCursor(NULL, IDC_IBEAM); break; case GSCrosshairCursor: hCursor = LoadCursor(NULL, IDC_CROSS); break; case GSPointingHandCursor: hCursor = LoadCursor(NULL, IDC_HAND); break; case GSResizeLeftRightCursor: hCursor = LoadCursor(NULL, IDC_SIZEWE); break; case GSResizeUpDownCursor: hCursor = LoadCursor(NULL, IDC_SIZENS); break; default: return; } *cid = (void*)hCursor; } - (void) imagecursor: (NSPoint)hotp : (NSImage *)image : (void **)cid { /* HCURSOR cur; BYTE *and; BYTE *xor; int w, h; xor = image; cur = CreateCursor(hinstance, (int)hotp.x, (int)hotp.y, (int)w, (int)h, and, xor); *cid = (void*)hCursor; */ } - (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid { /* FIXME The colour is currently ignored if (fg != nil) { ICONINFO iconinfo; if (GetIconInfo((HCURSOR)cid, &iconinfo)) { iconinfo.hbmColor = ; } } */ } - (void) setcursor: (void*) cid { SetCursor((HCURSOR)cid); } - (void) freecursor: (void*) cid { // This is only allowed on non-shared cursors and we have no way of knowing that. //DestroyCursor((HCURSOR)cid); } - (void) setParentWindow: (int)parentWin forChildWindow: (int)childWin { //SetParent((HWND)childWin, (HWND)parentWin); } - (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win { int extendedStyle = GetWindowLongPtr((HWND)win, GWL_EXSTYLE); if (ignoreMouse) { SetWindowLongPtr((HWND)win, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT); } else { SetWindowLongPtr((HWND)win, GWL_EXSTYLE, extendedStyle & ~WS_EX_TRANSPARENT); } } @end static unichar process_char(WPARAM wParam, unsigned *eventModifierFlags) { switch (wParam) { case VK_RETURN: return NSCarriageReturnCharacter; case VK_TAB: return NSTabCharacter; case VK_ESCAPE: return 0x1b; case VK_BACK: return NSDeleteCharacter; /* The following keys need to be reported as function keys */ #define WIN_FUNCTIONKEY \ *eventModifierFlags = *eventModifierFlags | NSFunctionKeyMask; case VK_F1: WIN_FUNCTIONKEY return NSF1FunctionKey; case VK_F2: WIN_FUNCTIONKEY return NSF2FunctionKey; case VK_F3: WIN_FUNCTIONKEY return NSF3FunctionKey; case VK_F4: WIN_FUNCTIONKEY return NSF4FunctionKey; case VK_F5: WIN_FUNCTIONKEY return NSF5FunctionKey; case VK_F6: WIN_FUNCTIONKEY return NSF6FunctionKey; case VK_F7: WIN_FUNCTIONKEY return NSF7FunctionKey; case VK_F8: WIN_FUNCTIONKEY return NSF8FunctionKey; case VK_F9: WIN_FUNCTIONKEY return NSF9FunctionKey; case VK_F10: WIN_FUNCTIONKEY return NSF10FunctionKey; case VK_F11: WIN_FUNCTIONKEY return NSF11FunctionKey; case VK_F12: WIN_FUNCTIONKEY return NSF12FunctionKey; case VK_F13: WIN_FUNCTIONKEY return NSF13FunctionKey; case VK_F14: WIN_FUNCTIONKEY return NSF14FunctionKey; case VK_F15: WIN_FUNCTIONKEY return NSF15FunctionKey; case VK_F16: WIN_FUNCTIONKEY return NSF16FunctionKey; case VK_F17: WIN_FUNCTIONKEY return NSF17FunctionKey; case VK_F18: WIN_FUNCTIONKEY return NSF18FunctionKey; case VK_F19: WIN_FUNCTIONKEY return NSF19FunctionKey; case VK_F20: WIN_FUNCTIONKEY return NSF20FunctionKey; case VK_F21: WIN_FUNCTIONKEY return NSF21FunctionKey; case VK_F22: WIN_FUNCTIONKEY return NSF22FunctionKey; case VK_F23: WIN_FUNCTIONKEY return NSF23FunctionKey; case VK_F24: WIN_FUNCTIONKEY return NSF24FunctionKey; case VK_DELETE: WIN_FUNCTIONKEY return NSDeleteFunctionKey; case VK_HOME: WIN_FUNCTIONKEY return NSHomeFunctionKey; case VK_LEFT: WIN_FUNCTIONKEY return NSLeftArrowFunctionKey; case VK_RIGHT: WIN_FUNCTIONKEY return NSRightArrowFunctionKey; case VK_UP: WIN_FUNCTIONKEY return NSUpArrowFunctionKey; case VK_DOWN: WIN_FUNCTIONKEY return NSDownArrowFunctionKey; case VK_PRIOR: WIN_FUNCTIONKEY return NSPageUpFunctionKey; case VK_NEXT: WIN_FUNCTIONKEY return NSPageDownFunctionKey; case VK_END: WIN_FUNCTIONKEY return NSEndFunctionKey; case VK_SELECT: WIN_FUNCTIONKEY return NSSelectFunctionKey; case VK_PRINT: WIN_FUNCTIONKEY return NSPrintFunctionKey; case VK_SNAPSHOT: WIN_FUNCTIONKEY return NSPrintScreenFunctionKey; case VK_EXECUTE: WIN_FUNCTIONKEY return NSExecuteFunctionKey; case VK_INSERT: WIN_FUNCTIONKEY return NSInsertFunctionKey; case VK_HELP: WIN_FUNCTIONKEY return NSHelpFunctionKey; case VK_CANCEL: WIN_FUNCTIONKEY return NSBreakFunctionKey; case VK_MODECHANGE: WIN_FUNCTIONKEY return NSModeSwitchFunctionKey; case VK_SCROLL: WIN_FUNCTIONKEY return NSScrollLockFunctionKey; case VK_PAUSE: WIN_FUNCTIONKEY return NSPauseFunctionKey; case VK_OEM_CLEAR: WIN_FUNCTIONKEY return NSClearDisplayFunctionKey; case VK_CLEAR: WIN_FUNCTIONKEY return NSClearLineFunctionKey; #undef WIN_FUNCTIONKEY default: return 0; } } static unsigned int mask_for_keystate(BYTE *keyState) { unsigned int eventFlags = 0; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSString *firstCommand = [defs stringForKey: @"GSFirstCommandKey"]; NSString *firstControl = [defs stringForKey: @"GSFirstControlKey"]; NSString *firstAlt = [defs stringForKey: @"GSFirstAlternateKey"]; NSString *secondCommand = [defs stringForKey: @"GSSecondCommandKey"]; NSString *secondControl = [defs stringForKey: @"GSSecondControlKey"]; NSString *secondAlt = [defs stringForKey: @"GSSecondAlternateKey"]; /* AltGr is mapped to right alt + left control */ if (keyState[VK_RCONTROL] & 128) // && !((keyState[VK_LCONTROL] & 128) && (keyState[VK_RMENU] & 128))) { if([@"Control_R" isEqualToString: firstAlt] || [@"Control_R" isEqualToString: secondAlt]) eventFlags |= NSAlternateKeyMask; else if([@"Control_R" isEqualToString: firstCommand] || [@"Control_R" isEqualToString: secondCommand]) eventFlags |= NSCommandKeyMask; else eventFlags |= NSControlKeyMask; } if (keyState[VK_SHIFT] & 128) eventFlags |= NSShiftKeyMask; if (keyState[VK_CAPITAL] & 128) eventFlags |= NSShiftKeyMask; if (keyState[VK_MENU] & 128) { if([@"Alt_R" isEqualToString: firstControl] || [@"Alt_R" isEqualToString: secondControl]) eventFlags |= NSControlKeyMask; else if([@"Alt_R" isEqualToString: firstCommand] || [@"Alt_R" isEqualToString: secondCommand]) eventFlags |= NSCommandKeyMask; else eventFlags |= NSAlternateKeyMask; } if (keyState[VK_HELP] & 128) eventFlags |= NSHelpKeyMask; if ((keyState[VK_LCONTROL] & 128) || (keyState[VK_RWIN] & 128)) { if([@"Control_L" isEqualToString: firstAlt] || [@"Control_L" isEqualToString: secondAlt]) eventFlags |= NSAlternateKeyMask; else if([@"Control_L" isEqualToString: firstControl] || [@"Control_L" isEqualToString: secondControl]) eventFlags |= NSControlKeyMask; else eventFlags |= NSCommandKeyMask; } return eventFlags; } static NSEvent* process_key_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, NSEventType eventType) { NSEvent *event; BOOL repeat; DWORD pos; NSPoint eventLocation; unsigned int eventFlags; NSTimeInterval time; LONG ltime; unichar unicode[5]; unsigned int scan; int result; BYTE keyState[256]; NSString *keys, *ukeys; NSGraphicsContext *gcontext; unichar uChar = 0; /* FIXME: How do you guarentee a context is associated with an event? */ gcontext = GSCurrentContext(); repeat = (lParam & 0xFFFF) != 0; pos = GetMessagePos(); eventLocation = MSWindowPointToGS(svr, hwnd, GET_X_LPARAM(pos), GET_Y_LPARAM(pos)); ltime = GetMessageTime(); time = ltime / 1000.0f; GetKeyboardState(keyState); eventFlags = mask_for_keystate(keyState); switch(wParam) { case VK_SHIFT: case VK_CAPITAL: case VK_CONTROL: case VK_MENU: case VK_HELP: case VK_NUMLOCK: eventType = NSFlagsChanged; break; case VK_NUMPAD0: case VK_NUMPAD1: case VK_NUMPAD2: case VK_NUMPAD3: case VK_NUMPAD4: case VK_NUMPAD5: case VK_NUMPAD6: case VK_NUMPAD7: case VK_NUMPAD8: case VK_NUMPAD9: eventFlags |= NSNumericPadKeyMask; break; default: break; } if (wParam == VK_PROCESSKEY) { // Ignore VK_PROCESSKEY for IME processing... return 0; } else { // Ignore if currently in IME composition processing... IME_INFO_T *imeInfo = (IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO); if (imeInfo && (imeInfo->isComposing)) return 0; uChar = process_char(wParam, &eventFlags); } if (uChar) { keys = [NSString stringWithCharacters: &uChar length: 1]; ukeys = [NSString stringWithCharacters: &uChar length: 1]; } else { BYTE blankKeyState[256]; int i = 0; // initialize blank key state array.... for(i = 0; i < 256; i++) blankKeyState[i] = 0; scan = ((lParam >> 16) & 0xFF); result = ToUnicodeEx(wParam, scan, keyState, unicode, 5, 0, GetKeyboardLayout(0)); if (result == -1) { // A non spacing accent key was found, we still try to use the result result = 1; } keys = [NSString stringWithCharacters: unicode length: result]; // Now get the characters with a blank keyboard state so that // no modifiers are applied. result = ToUnicodeEx(wParam, scan, blankKeyState, unicode, 5, 0, GetKeyboardLayout(0)); //NSLog(@"To Unicode resulted in %d with %d", result, unicode[0]); if (result == -1) { // A non spacing accent key was found, we still try to use the result result = 1; NSWarnMLog(@"To Unicode resulted in -1 with: 0x%4.4X\n", unicode[0]); } ukeys = [NSString stringWithCharacters: unicode length: result]; } if (eventFlags & NSShiftKeyMask) ukeys = [ukeys uppercaseString]; // key events should go to the key window if we have one (Windows' focus window isn't always appropriate) int windowNumber = [[NSApp keyWindow] windowNumber]; if (windowNumber == 0) windowNumber = (int)hwnd; event = [NSEvent keyEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: time windowNumber: windowNumber context: gcontext characters: keys charactersIgnoringModifiers: ukeys isARepeat: repeat keyCode: wParam]; return event; } static NSEvent* process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, NSEventType eventType, UINT uMsg) { NSEvent *event; NSPoint eventLocation; static NSPoint lastLocation = {0.0, 0.0}; unsigned int eventFlags; NSTimeInterval time; LONG ltime; DWORD tick; NSGraphicsContext *gcontext; float deltaX = 0.0, deltaY = 0.0; static int clickCount = 1; static LONG lastTime = 0; int clientX, clientY; /* * Occasionally the mouse down events are lost ... don't know why. * So we track the mouse status and simulate mouse down or up events * if the button states appear to have changed when we get a move. */ static BOOL lDown = NO; static BOOL oDown = NO; static BOOL rDown = NO; gcontext = GSCurrentContext(); /* * Some events give screen coordinates - we must convert those to client * coordinates. */ if (eventType == NSScrollWheel) { POINT point; point.x = GET_X_LPARAM(lParam); point.y = GET_Y_LPARAM(lParam); ScreenToClient(hwnd, &point); clientX = point.x; clientY = point.y; } else { clientX = GET_X_LPARAM(lParam); clientY = GET_Y_LPARAM(lParam); } eventLocation = MSWindowPointToGS(svr, hwnd, clientX, clientY); ltime = GetMessageTime(); time = ltime / 1000.0f; tick = GetTickCount(); eventFlags = 0; if (wParam & MK_CONTROL) { eventFlags |= NSControlKeyMask; } if (wParam & MK_SHIFT) { eventFlags |= NSShiftKeyMask; } if (GetKeyState(VK_MENU) < 0) { eventFlags |= NSAlternateKeyMask; } if (GetKeyState(VK_HELP) < 0) { eventFlags |= NSHelpKeyMask; } // What about other modifiers? /* Currently GNUstep only proccess events inside the windows (contentview). * So we should check if this is the first movement inside the window. * And should consider also the case when this is the last movement inside * the window. */ if (!should_handle_cursor) { /* If this is the first movement inside the window, tell GNUstep * that should handle the cursor and that should check if the * cursor needs be updated. */ should_handle_cursor = YES; update_cursor = YES; /* We also starts tracking the mouse, so we receive the * message WM_MOUSELEAVE when the mouse leaves the client area. */ TRACKMOUSEEVENT tme; tme.cbSize = sizeof(tme); tme.dwFlags = TME_LEAVE; tme.hwndTrack = hwnd; TrackMouseEvent(&tme); /* If there are a previous cursor available (maybe a cursor that * represent a tool) set it as the cursor. If not, set an arrow * cursor (this is necessary because if the cursor is updated to, * for example, an I Beam cursor, there will not be a default cursor * to display when the user moves the mouse over, for example, an * scrollbar). */ if (current_cursor != nil) { [current_cursor set]; current_cursor = nil; } else { [[NSCursor arrowCursor] set]; } } else { /* If the cursor is not associated to a tracking rectangle, not in * the push/pop stack, save this. We do this for the case when, for * example, the user choose a tool in a Tools window which sets a * cursor for the tool and this cursor should be preserved between * different windows. */ if ([NSCursor count] == 0 && ![current_cursor isEqual: [NSCursor currentCursor]]) { ASSIGN(current_cursor, [NSCursor currentCursor]); } } // Check if we need update the cursor. if (update_cursor) { NSView *subview = nil; NSWindow *gswin = GSWindowWithNumber((int)hwnd); subview = [[gswin contentView] hitTest: eventLocation]; if (subview != nil && subview->_rFlags.valid_rects) { NSArray *tr = subview->_cursor_rects; NSUInteger count = [tr count]; // Loop through cursor rectangles if (count > 0) { GSTrackingRect *rects[count]; NSUInteger i; [tr getObjects: rects]; for (i = 0; i < count; ++i) { GSTrackingRect *r = rects[i]; BOOL now; if ([r isValid] == NO) continue; /* * Check for presence of point in rectangle. */ now = NSMouseInRect(eventLocation, r->rectangle, NO); // Mouse inside if (now) { NSEvent *e; e = [NSEvent enterExitEventWithType: NSCursorUpdate location: eventLocation modifierFlags: eventFlags timestamp: 0 windowNumber: (int)hwnd context: gcontext eventNumber: 0 trackingNumber: (int)YES userData: (void*)r]; [GSCurrentServer() postEvent: e atStart: YES]; //NSLog(@"Add enter event %@ for view %@ rect %@", e, theView, NSStringFromRect(r->rectangle)); } } } } update_cursor = NO; } if (eventType == NSScrollWheel) { float delta = GET_WHEEL_DELTA_WPARAM(wParam) / 120.0; if (uMsg == WM_MOUSEWHEEL) deltaY = delta; else deltaX = delta; //NSLog(@"Scroll event with deltaX %f deltaY %f", deltaX, deltaY); } else if (eventType == NSMouseMoved) { NSEvent *e; deltaX = eventLocation.x - lastLocation.x; deltaY = -(eventLocation.y - lastLocation.y); if (wParam & MK_LBUTTON) { if (lDown == NO) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSLeftMouseDown, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } eventType = NSLeftMouseDragged; } else if (wParam & MK_RBUTTON) { if (lDown == YES) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSLeftMouseUp, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } if (rDown == NO) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSRightMouseDown, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } eventType = NSRightMouseDragged; } else if (wParam & MK_MBUTTON) { if (lDown == YES) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSLeftMouseUp, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } if (rDown == YES) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSRightMouseUp, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } if (oDown == NO) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSOtherMouseDown, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } eventType = NSOtherMouseDragged; } else { if (lDown == YES) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSLeftMouseUp, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } if (rDown == YES) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSRightMouseUp, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } if (oDown == YES) { e = process_mouse_event(svr, hwnd, wParam, lParam, NSOtherMouseUp, uMsg); if (e != nil) [GSCurrentServer() postEvent: e atStart: NO]; } } } else if ((eventType == NSLeftMouseDown) || (eventType == NSRightMouseDown) || (eventType == NSOtherMouseDown)) { // It seems Windows generates duplicate mouse down events on first click in a window if (ltime == lastTime) // duplicate event has identical time return nil; // ignore it static NSPoint lastClick = {0.0, 0.0}; if (lastTime + GetDoubleClickTime() > ltime && fabs(eventLocation.x - lastClick.x) < GetSystemMetrics(SM_CXDOUBLECLK) && fabs(eventLocation.y - lastClick.y) < GetSystemMetrics(SM_CYDOUBLECLK)) { clickCount += 1; } else { clickCount = 1; } lastTime = ltime; lastClick = eventLocation; SetCapture(hwnd); // capture the mouse to get mouse moved events outside of window } else if ( ((eventType == NSLeftMouseUp) || (eventType == NSRightMouseUp) || (eventType == NSOtherMouseUp)) && !((wParam & MK_LBUTTON) || (wParam & MK_MBUTTON) || (wParam & MK_RBUTTON)) ) { ReleaseCapture(); // release capture when all mouse buttons are up } if (eventType == NSLeftMouseDown) lDown = YES; if (eventType == NSRightMouseDown) rDown = YES; if (eventType == NSOtherMouseDown) oDown = YES; if (eventType == NSLeftMouseUp) lDown = NO; if (eventType == NSRightMouseUp) rDown = NO; if (eventType == NSOtherMouseUp) oDown = NO; if (eventType == NSMouseMoved) { static HWND lastHwnd = 0; if (hwnd == lastHwnd && NSEqualPoints(eventLocation, lastLocation)) return nil; // mouse hasn't actually moved -- don't generate another event // record window and location of this event, to check next mouseMoved event against lastHwnd = hwnd; } lastLocation = eventLocation; event = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: time windowNumber: (int)hwnd context: gcontext eventNumber: tick clickCount: clickCount pressure: 1.0 buttonNumber: 0 /* FIXME */ deltaX: deltaX deltaY: deltaY deltaZ: 0.]; return event; } LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { WIN32Server *ctxt = (WIN32Server *)GSCurrentServer(); if(_enableCallbacks == NO) { return (LRESULT)NULL; } return [ctxt windowEventProc: hwnd : uMsg : wParam : lParam]; } gnustep-back-0.29.0/Source/win32/w32_GLcontext.m000066400000000000000000000365371404163720200211640ustar00rootroot00000000000000/* -*- mode:ObjC -*- Win32GLContext - backend implementation of NSOpenGLContext Copyright (C) 1998, 2002, 2007 Free Software Foundation, Inc. Written by: Xavier Glattard Date: Jan 2007 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #ifdef HAVE_WGL #include #include #include #include #include #include #include "win32/WIN32Server.h" #include "win32/WIN32OpenGL.h" #define NSOPENGLSUBWINDOWCLASS "NSOpenGLSubwindow" #define NSOPENGLSUBWINDOWNAME "NSOpenGLSubwindow" extern LRESULT CALLBACK MainWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ); @interface Win32Subwindow : NSObject { @public HWND winid; HDC hDC; NSOpenGLView *attached; } - (void) update; + subwindowOnView: (NSOpenGLView *) view; @end int setupPixelFormat(HDC hDC, LPPIXELFORMATDESCRIPTOR ppfd ); LRESULT CALLBACK win32SubwindowProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ); @implementation Win32Subwindow + (void) initialize { WNDCLASS wclss; HINSTANCE hInstance; ATOM atom; hInstance = GetModuleHandle(NULL); wclss.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; wclss.lpfnWndProc = (WNDPROC) win32SubwindowProc; wclss.cbClsExtra = 0; wclss.cbWndExtra = 0; wclss.hInstance = hInstance; wclss.hIcon = LoadIcon(NULL, IDI_APPLICATION); wclss.hCursor = LoadCursor(NULL, IDC_ARROW); wclss.hbrBackground = NULL; wclss.lpszMenuName = NULL; wclss.lpszClassName = NSOPENGLSUBWINDOWCLASS; // Attempt To Register The Window Class atom = RegisterClass(&wclss); NSAssert(atom, @"Failed To Register The Win32Subwindow MS window class."); NSDebugMLLog(@"WGL", @"MS window class initialized (%u)", atom); } - (id) initWithView: (NSOpenGLView *)view { NSRect rect; WIN32Server *server; NSWindow *win; int x, y, width, height; HINSTANCE hInstance; WNDCLASS wclss; ATOM atom; RECT parent_rect; self = [super init]; if (!self) return nil; attached = (NSOpenGLView*)view; win = [view window]; NSAssert(win, @"request of a window attachment on a view that is not on a NSWindow"); if ([view isRotatedOrScaledFromBase]) [NSException raise: NSInvalidArgumentException format: @"Cannot attach an window to a view that is rotated or scaled"]; server = (WIN32Server *)GSServerForWindow(win); NSAssert(server != nil, NSInternalInconsistencyException); NSAssert([server isKindOfClass: [WIN32Server class]], NSInternalInconsistencyException); hInstance = GetModuleHandle(NULL); /* Grab the window class we have registered on [+initialize] */ atom = GetClassInfo( hInstance, NSOPENGLSUBWINDOWCLASS, &wclss ); NSAssert(atom, @"MS window class not found !"); GetClientRect((HWND)[win windowNumber], &parent_rect); if ([server handlesWindowDecorations] == YES) { /* The window manager handles window decorations, so the * the parent X window is equal to the content view and * we must therefore use content view coordinates. */ rect = [view convertRect: [view bounds] toView: [[attached window] contentView]]; if ([[[attached window] contentView] isFlipped]) { rect.origin.y = NSHeight([[[attached window] contentView] frame]) - (rect.size.height + rect.origin.y); } } else { /* The GUI library handles window decorations, so the * the parent X window is equal to the NSWindow frame * and we can use window base coordinates. */ rect = [view convertRect: [view bounds] toView: nil]; } x = NSMinX(rect); y = (parent_rect.bottom - parent_rect.top) - NSMaxY(rect); width = NSWidth(rect); height = NSHeight(rect); NSDebugMLLog(@"WGL", @"MS window creation (%d, %d, %u, %u)", x, y, width, height); /* WS_DISABLED causes mouse/keyboard events to be forwarded to the parent window so they can be processed normally; otherwise the OpenGL window would eat them */ winid = CreateWindow( NSOPENGLSUBWINDOWCLASS, NSOPENGLSUBWINDOWNAME, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | WS_DISABLED, x, y, width, height, (HWND)[win windowNumber], (HMENU)NULL, hInstance, (LPVOID)self); NSAssert(winid, @"Failed to create a MS window"); ShowCursor( TRUE ); return self; } - (void) map { ShowWindow(winid, SW_SHOW); } - (void) detach { DestroyWindow(winid); attached = nil; } - (void) update { NSRect rect; GSDisplayServer *server; NSWindow *win; int x, y, width, height; NSAssert(attached, NSInternalInconsistencyException); win = [attached window]; NSAssert1(win, @"%@'s window is nil now!", attached); NSAssert1(![attached isRotatedOrScaledFromBase], @"%@ is rotated or scaled, now!", attached); server = GSServerForWindow(win); NSAssert(server != nil, NSInternalInconsistencyException); NSAssert([server isKindOfClass: [WIN32Server class]], NSInternalInconsistencyException); //FIXME //we should check that the window hasn't changed, maybe. if ([server handlesWindowDecorations] == YES) { /* The window manager handles window decorations, so the * the parent X window is equal to the content view and * we must therefore use content view coordinates. */ rect = [attached convertRect: [attached bounds] toView: [[attached window] contentView]]; if ([[[attached window] contentView] isFlipped]) { rect.origin.y = NSHeight([[[attached window] contentView] frame]) - (rect.size.height + rect.origin.y); } } else { /* The GUI library handles window decorations, so the * the parent X window is equal to the NSWindow frame * and we can use window base coordinates. */ rect = [attached convertRect: [attached bounds] toView: nil]; } RECT parent_rect; GetClientRect((HWND)[win windowNumber], &parent_rect); x = NSMinX(rect); y = (parent_rect.bottom - parent_rect.top) - NSMaxY(rect); width = NSWidth(rect); height = NSHeight(rect); MoveWindow(winid, x, y, width, height, /*FIXME*/TRUE); } - (void) dealloc { NSDebugMLLog(@"WGL", @"deallocating"); [self detach]; [super dealloc]; } + (id) subwindowOnView: (NSOpenGLView *) view { Win32Subwindow *win = [[self alloc] initWithView: view]; return AUTORELEASE(win); } @end //FIXME: //should be on per thread basis. static Win32GLContext *currentGLContext; @implementation Win32GLContext + (void)clearCurrentContext { wglMakeCurrent(NULL, NULL); currentGLContext = nil; } + (NSOpenGLContext *)currentContext { return currentGLContext; } - (void) _detach { if (wsubwin) { if (currentGLContext == self) { [Win32GLContext clearCurrentContext]; } wsubwin->hDC = (HDC)NULL; DESTROY(wsubwin); } } - (void *)CGLContextObj { // FIXME: Until we have a wrapper library // return the underlying context directly return (void*)wgl_context; } - (void)clearDrawable { [self _detach]; } - (void)copyAttributesFromContext:(NSOpenGLContext *)context withMask:(unsigned long)mask { HGLRC other; if (context == nil || ![context isKindOfClass: [Win32GLContext class]]) [NSException raise: NSInvalidArgumentException format: @"%@ is an invalid context", context]; other = ((Win32GLContext *)context)->wgl_context; wglCopyContext(other, wgl_context, mask); } - (void)createTexture:(unsigned long)target fromView:(NSView*)view internalFormat:(unsigned long)format { [self notImplemented: _cmd]; } - (int)currentVirtualScreen { [self notImplemented: _cmd]; return 0; } - (void)flushBuffer { SwapBuffers(wsubwin->hDC); } - (void)getValues:(long *)vals forParameter:(NSOpenGLContextParameter)param { // TODO [self notImplemented: _cmd]; } - (id)initWithCGLContextObj: (void *)context { self = [super init]; if (!self) { return nil; } // FIXME: Need to set the pixelFormat ivar wgl_context = context; return self; } - (id)initWithFormat:(NSOpenGLPixelFormat *)aFormat shareContext:(NSOpenGLContext *)share { NSDebugMLLog(@"WGL", @"will init with format %@", aFormat); self = [super init]; if(self) { wgl_context = NULL; if (aFormat && [aFormat isKindOfClass: [Win32GLPixelFormat class]]) { ASSIGN(format, (Win32GLPixelFormat *)aFormat); //FIXME: allow index mode and sharing wgl_context = NULL; } else { NSDebugMLLog(@"WGL", @"invalid format %@", aFormat); DESTROY(self); } } return self; } - (void) dealloc { NSDebugMLLog(@"WGL", @"deallocating"); [self _detach]; RELEASE(format); if (wgl_context) { wglDeleteContext(wgl_context); } [super dealloc]; } - (void) makeCurrentContext { if (wsubwin == nil) [NSException raise: NSGenericException format: @"GL Context is not bind, cannot be made current"]; NSAssert(wgl_context && wsubwin->hDC, NSInternalInconsistencyException); NSDebugMLLog(@"WGL", @"before wglMakeCurrent"); wglMakeCurrent(wsubwin->hDC, wgl_context); NSDebugMLLog(@"WGL", @"after wglMakeCurrent"); // NSAssert(glx_context != None, NSInternalInconsistencyException); // glXMakeCurrent(dpy, xsubwin->winid, glx_context); currentGLContext = self; } - (void)setCurrentVirtualScreen:(int)screen { [self notImplemented: _cmd]; } - (void)setFullScreen { [self notImplemented: _cmd]; } - (void)setOffScreen:(void *)baseaddr width:(long)width height:(long)height rowbytes:(long)rowbytes { [self notImplemented: _cmd]; } - (void)setValues:(const long *)vals forParameter:(NSOpenGLContextParameter)param { [self notImplemented: _cmd]; } - (void)setView:(NSView *)view { Win32Subwindow *win; NSView *current_view; if (!view) [NSException raise: NSInvalidArgumentException format: @"setView called with a nil value"]; NSAssert(format, NSInternalInconsistencyException); win = [Win32Subwindow subwindowOnView: (NSOpenGLView*) view]; current_view = [self view]; if ( current_view != nil ) { [current_view _setIgnoresBacking: saved_ignores_backing]; } ASSIGN(wsubwin, win); saved_ignores_backing = [view _ignoresBacking]; [view _setIgnoresBacking: YES]; // { // GLXFBConfig *conf_tab; // int n_elem; // int attrs[] = { // GLX_DOUBLEBUFFER, 1, // GLX_DEPTH_SIZE, 16, // GLX_RED_SIZE, 1, // GLX_BLUE_SIZE, 1, // GLX_GREEN_SIZE, 1, // None // }; // conf_tab = glXChooseFBConfig(dpy, DefaultScreen(dpy), attrs, &n_elem); // if (n_elem > 0) // { // printf("found %d context\n", n_elem); // // win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, // // 800, 600, 1, 0, 1); // glx_drawable = glXCreateWindow(dpy, *conf_tab, xsubwin->winid, NULL); // } // else // puts("no context found"); // } //FIXME //The following line should be the good one. But it crashes my X server... // glx_drawable = glXCreateWindow(dpy, *format->conf_tab, xsubwin->winid, // NULL); NSDebugMLLog(@"WGL", @"wgl_window : %u", win); } - (void)update { [wsubwin update]; } - (NSView *)view { if (wsubwin) return (NSView*)wsubwin->attached; else return nil; } @end LRESULT CALLBACK win32SubwindowProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { Win32Subwindow *wsubwin; Win32GLContext* ctx = nil; NSDebugFLLog(@"WGLEvents", @"Entering."); wsubwin = (Win32Subwindow*) GetWindowLongPtr(hWnd, GWLP_USERDATA); if(wsubwin) ctx = (Win32GLContext*)[wsubwin->attached openGLContext]; switch (message) { case WM_CREATE: NSDebugFLLog(@"WGLEvents", @"WM_CREATE event received."); wsubwin = (Win32Subwindow*)(((LPCREATESTRUCT) lParam)->lpCreateParams); ctx = (Win32GLContext*)[wsubwin->attached openGLContext]; NSDebugFLLog(@"WGLEvents", @"subwindow : %@", wsubwin); // initialize OpenGL rendering NSCAssert(wsubwin->hDC = GetDC(hWnd), @"No DC"); [ctx->format _setDrawable: wsubwin->hDC]; //TODO setupPalette(wsubwin->hDC); NSCAssert( ctx->wgl_context = wglCreateContext(wsubwin->hDC), @"wglCreateContext failed"); // wglMakeCurrent(wsubwin->hDC, hGLRC) SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)wsubwin); NSDebugFLLog(@"WGLEvents", @"WM_CREATE done."); return 0; case WM_DESTROY: NSDebugFLLog(@"WGLEvents", @"WM_DESTROY event received."); // finish OpenGL rendering if(ctx->wgl_context) { wglMakeCurrent(NULL, NULL); wglDeleteContext(ctx->wgl_context); } /* if (hPalette) { DeleteObject(hPalette); }*/ ReleaseDC(hWnd, wsubwin->hDC); NSDebugFLLog(@"WGLEvents", @"WM_DESTROY done."); return 0; /* case WM_SIZE: // track window size changes if (wsubwin->context->wgl_context) { winWidth = (int) LOWORD(lParam); winHeight = (int) HIWORD(lParam); resize(); return 0; }*/ /* case WM_PALETTECHANGED: // realize palette if this is *not* the current window if (wsubwin->context->wgl_context && hPalette && (HWND) wParam != hWnd) { UnrealizeObject(hPalette); SelectPalette(wsubwin->hDC, hPalette, FALSE); RealizePalette(wsubwin->hDC); redraw(); break; } break;*/ /* case WM_QUERYNEWPALETTE: // realize palette if this is the current window if ((wsubwin->context->wgl_context && hPalette) { UnrealizeObject(hPalette); SelectPalette(wsubwin->hDC, hPalette, FALSE); RealizePalette(wsubwin->hDC); redraw(); return TRUE; } break;*/ case WM_PAINT: { RECT wr; RECT ir; if ( GetWindowRect(hWnd,&wr) && GetUpdateRect(hWnd, &ir, FALSE) ) { ir.top += wr.top; ir.left += wr.left; InvalidateRect( GetParent(hWnd), &ir,FALSE ); } return DefWindowProc(hWnd, message, wParam, lParam); } break; /* case WM_CHAR: // handle keyboard input switch ((int)wParam) { case VK_ESCAPE: DestroyWindow(hWnd); return 0; default: break; } break;*/ default: NSDebugFLLog(@"WGLEvents", @"other event received (%u).", message); // return MainWndProc((HWND)GetWindowLongPtr(hWnd, GWLP_HWNDPARENT), message, wParam, lParam); return DefWindowProc(hWnd, message, wParam, lParam); break; } NSDebugFLLog(@"WGLEvents", @"Failed."); return FALSE; } #endif gnustep-back-0.29.0/Source/win32/w32_GLformat.m000066400000000000000000000157661404163720200207710ustar00rootroot00000000000000/* -*- mode:ObjC -*- Win32GLContext - backend implementation of NSOpenGLContext Copyright (C) 1998, 2002, 2007 Free Software Foundation, Inc. Written by: Xavier Glattard Date: Jan 2007 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #ifdef HAVE_WGL #include #include #include #include #include "win32/WIN32Server.h" #include "win32/WIN32OpenGL.h" static void attributesNS2WGL( NSOpenGLPixelFormatAttribute *attribs, LPPIXELFORMATDESCRIPTOR ppfd ) { // TODO : switch to wglChoosePixelFormatEXT NSOpenGLPixelFormatAttribute *ptr = attribs; ppfd->nSize = sizeof(PIXELFORMATDESCRIPTOR); ppfd->nVersion = 1; ppfd->dwFlags = 0; ppfd->dwFlags |= PFD_SUPPORT_OPENGL; ppfd->iPixelType = PFD_TYPE_RGBA; while (*ptr) { switch(*ptr) { // it means all the same on WGL - there is no difference here case NSOpenGLPFAWindow: ppfd->dwFlags |= PFD_DRAW_TO_WINDOW; break; case NSOpenGLPFAOffScreen: ppfd->dwFlags |= PFD_DRAW_TO_BITMAP; break; case NSOpenGLPFAPixelBuffer: // TODO //ppfd->dwFlags |= PFD_DRAW_TO_WINDOW; break; case NSOpenGLPFASingleRenderer: case NSOpenGLPFAAllRenderers: case NSOpenGLPFAAccelerated: ppfd->dwFlags |= PFD_GENERIC_ACCELERATED; break; case NSOpenGLPFADoubleBuffer: ppfd->dwFlags |= PFD_DOUBLEBUFFER; break; case NSOpenGLPFAStereo: ppfd->dwFlags |= PFD_STEREO; break; case NSOpenGLPFABackingStore: ppfd->dwFlags |= PFD_SWAP_COPY; break; case NSOpenGLPFAAuxBuffers: ptr++; ppfd->cAuxBuffers = *ptr; break; case NSOpenGLPFAColorSize: ptr++; ppfd->cColorBits = *ptr; break; case NSOpenGLPFAAlphaSize: ptr++; ppfd->cAlphaBits = *ptr; break; case NSOpenGLPFADepthSize: ptr++; ppfd->cDepthBits = *ptr; break; case NSOpenGLPFAStencilSize: ptr++; ppfd->cStencilBits = *ptr; break; case NSOpenGLPFAAccumSize: ptr++; ppfd->cAccumBits = *ptr; break; switch ((int)*ptr) { case 8: ppfd->cAccumRedBits = 3; ppfd->cAccumGreenBits = 3; ppfd->cAccumBlueBits = 2; ppfd->cAccumAlphaBits = 0; break; case 15: case 16: ppfd->cAccumRedBits = 5; ppfd->cAccumGreenBits = 5; ppfd->cAccumBlueBits = 5; ppfd->cAccumAlphaBits = 0; break; case 24: ppfd->cAccumRedBits = 8; ppfd->cAccumGreenBits = 8; ppfd->cAccumBlueBits = 8; ppfd->cAccumAlphaBits = 0; break; case 32: ppfd->cAccumRedBits = 8; ppfd->cAccumGreenBits = 8; ppfd->cAccumBlueBits = 8; ppfd->cAccumAlphaBits = 8; break; } break; //can not be handle by WGL case NSOpenGLPFAMinimumPolicy: break; // can not be handle by WGL case NSOpenGLPFAMaximumPolicy: break; //FIXME all of this stuff... case NSOpenGLPFAFullScreen: case NSOpenGLPFASampleBuffers: case NSOpenGLPFASamples: case NSOpenGLPFAAuxDepthStencil: case NSOpenGLPFARendererID: case NSOpenGLPFANoRecovery: case NSOpenGLPFAClosestPolicy: case NSOpenGLPFARobust: case NSOpenGLPFAMPSafe: case NSOpenGLPFAMultiScreen: case NSOpenGLPFACompliant: case NSOpenGLPFAScreenMask: case NSOpenGLPFAVirtualScreenCount: case NSOpenGLPFAAllowOfflineRenderers: case NSOpenGLPFAColorFloat: case NSOpenGLPFAMultisample: case NSOpenGLPFASupersample: case NSOpenGLPFASampleAlpha: break; } ptr ++; } } static void attributesWGL2NS( LPPIXELFORMATDESCRIPTOR ppfd, NSOpenGLPixelFormatAttribute *attribs ) { // TODO } @implementation Win32GLPixelFormat - (void)getValues:(long *)vals forAttribute:(NSOpenGLPixelFormatAttribute)attrib forVirtualScreen:(int)screen { PIXELFORMATDESCRIPTOR pfd; //glXGetConfig(dpy, conf.visual, attrib, (int *)vals); DescribePixelFormat( wgl_drawable, wgl_pixelformat, sizeof(pfd), &pfd); } - (id)initWithAttributes: (NSOpenGLPixelFormatAttribute *) attribs { NSDebugMLLog(@"WGL", @"will init"); self = [super init]; if(self) { wgl_drawable = 0; wgl_pixelformat = 0; attributesNS2WGL(attribs, &pfd); } return self; } #if 0 //FIXME, what screen number ? if (GSglxMinorVersion (dpy) >= 3) conf.tab = glXChooseFBConfig(dpy, DefaultScreen(dpy), [data mutableBytes], &n_elem); else conf.visual = glXChooseVisual(dpy, DefaultScreen(dpy), [data mutableBytes]); if (((GSglxMinorVersion (dpy) >= 3) ? (void *)conf.tab : (void *)conf.visual) == NULL) { NSDebugMLLog(@"GLX", @"no pixel format found matching what is required"); RELEASE(self); return nil; } else { NSDebugMLLog(@"GLX", @"We found %d pixel formats", n_elem); #if 0 if (GSglxMinorVersion (dpy) >= 3) { int i; for (i = 0; i < n_elem; ++i) { int val; NSDebugMLLog(@"GLX", @"inspecting %dth", i+1); glXGetFBConfigAttrib(dpy, conf.tab[i], GLX_BUFFER_SIZE, &val); NSDebugMLLog(@"GLX", @"buffer size %d", val); glXGetFBConfigAttrib(dpy, conf.tab[i], GLX_DOUBLEBUFFER, &val); NSDebugMLLog(@"GLX", @"double buffer %d", val); glXGetFBConfigAttrib(dpy, conf.tab[i], GLX_DEPTH_SIZE, &val); NSDebugMLLog(@"GLX", @"depth size %d", val); } } else { glXGetConfig(dpy, conf.visual, GLX_BUFFER_SIZE, &val); NSDebugMLLog(@"GLX", @"buffer size %d", val); glXGetConfig(dpy, conf.visual, GLX_DOUBLEBUFFER, &val); NSDebugMLLog(@"GLX", @"double buffer %d", val); glXGetConfig(dpy, conf.visual, GLX_DEPTH_SIZE, &val); NSDebugMLLog(@"GLX", @"depth size %d", val); } #endif return self; } } #endif - (void) _setDrawable: (HDC) aDrawable { // TODO : switch to wglChoosePixelFormatEXT NSCAssert( wgl_pixelformat = ChoosePixelFormat(aDrawable, &pfd), @"ChoosePixelFormat failed."); NSCAssert( SetPixelFormat(aDrawable, wgl_pixelformat, &pfd), @"SetPixelFormat failed."); wgl_drawable = aDrawable; NSDebugFLLog(@"WGL", @"found : %u", wgl_pixelformat); } - (void) dealloc { NSDebugMLLog(@"WGL", @"deallocation"); [super dealloc]; } - (int)numberOfVirtualScreens { // [self notImplemented: _cmd]; //FIXME //This looks like a reasonable value to return... return 1; } @end #endif gnustep-back-0.29.0/Source/win32/w32_activate.m000066400000000000000000000061621404163720200210440ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2005 Free Software Foundation, Inc. Written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "win32/WIN32Server.h" #include "win32/WIN32Geometry.h" @implementation WIN32Server (w32_activate) - (LRESULT) decodeWM_ACTIVEParams:(WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // decode our params int last_WM_ACTIVATE = LOWORD(wParam); //int minimized = HIWORD(wParam); switch (last_WM_ACTIVATE) { case WA_ACTIVE: { /* we become the inactivation event on WM_INACTIVE */ /* Sending another leave event might confuse the front event */ currentActive = hwnd; } break; case WA_CLICKACTIVE: { /* we become the inactivation event on WM_INACTIVE */ /* Sending another leave event might confuse the front event */ currentActive = hwnd; } break; case WA_INACTIVE: { NSEvent *ev; ev = [NSEvent otherEventWithType: NSAppKitDefined location: NSMakePoint(0, 0) modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowLeave data1: 0 data2: 0]; [EVENT_WINDOW(hwnd) sendEvent: ev]; } break; default: break; } return 0; } - (LRESULT) decodeWM_ACTIVEAPPParams: (HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { switch ((int)wParam) { case TRUE: { [NSApp activateIgnoringOtherApps: YES]; flags._eventHandled = YES; } break; case FALSE: { // FIXME: We should deactivate the application, however the following // causes problems. See "Re: Problem with recent change to w32_activate.m // -- PLEASE REVERT" for details. // [NSApp deactivate]; // flags._eventHandled = YES; } break; default: break; } return 0; } - (void) decodeWM_NCACTIVATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { } @end gnustep-back-0.29.0/Source/win32/w32_create.m000066400000000000000000000067511404163720200205130ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2005 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 Part of this code have been re-written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include "win32/WIN32Server.h" #include "win32/WIN32Geometry.h" @implementation WIN32Server (w32_create) - (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { return TRUE; } - (LRESULT) decodeWM_CREATEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { WIN_INTERN *win; IME_INFO_T *ime; NSBackingStoreType type = (NSBackingStoreType)((LPCREATESTRUCT)lParam)->lpCreateParams; NSBundle *bundle = [NSBundle mainBundle]; NSString *iconName = nil; NSString *iconPath = nil; // Initialize the window. NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "CREATE", hwnd); /* For windows with backingstore we create a compatible DC, that is stored in the extra fields for this window. Drawing operations work on this buffer. */ win = malloc(sizeof(WIN_INTERN)); ime = malloc(sizeof(IME_INFO_T)); // Initialize win internals structure... memset(win, 0, sizeof(WIN_INTERN)); memset(ime, 0, sizeof(IME_INFO_T)); win->type = type; win->useHDC = NO; // Save win internals structure pointer for window handle... SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)win); SetWindowLongPtr(hwnd, IME_INFO, (LONG_PTR)ime); [self windowbacking: type : (int)hwnd]; // Find the icon file, assume it has the same name as the "icon" which // was specified in the bundle's dictionary... iconName = [[bundle infoDictionary] objectForKey: @"NSIcon"]; if (iconName == nil) { iconName = [[bundle infoDictionary] objectForKey: @"CFBundleIconFile"]; } // If the icon name is set, get the path... if (iconName != nil) { iconName = [iconName stringByDeletingPathExtension]; iconPath = [[NSBundle mainBundle] pathForResource: iconName ofType: @"ico"]; iconPath = [iconPath stringByStandardizingPath]; } // If the path is set, load the icon file and set it as the // icon on the window. if (iconPath != nil) { HICON icon = NULL; const char *cpath = [iconPath cString]; icon = LoadImage(NULL, cpath, IMAGE_ICON,0,0, LR_DEFAULTSIZE|LR_LOADFROMFILE); SetClassLongPtr(hwnd,GCLP_HICON,(LONG_PTR)icon); } return 0; } @end gnustep-back-0.29.0/Source/win32/w32_general.m000066400000000000000000000073121404163720200206570ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2005 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 Part of this code have been written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "win32/WIN32Server.h" #include "win32/WIN32Geometry.h" #include @implementation WIN32Server (w32_General) - (void) decodeWM_CLOSEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { NSEvent *ev; NSPoint eventLocation = NSMakePoint(0, 0); ev = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowClose data1: 0 data2: 0]; // Sending the event directly to the window bypasses the event queue, // which can cause a modal loop to lock up. [GSCurrentServer() postEvent: ev atStart: NO]; flags._eventHandled = YES; } - (void) decodeWM_NCDESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { } - (void) decodeWM_DESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr(hwnd, GWLP_USERDATA); // Clean up window-specific data objects. if (win->useHDC) { HGDIOBJ old; old = SelectObject(win->hdc, win->old); DeleteObject(old); DeleteDC(win->hdc); } free(win); free((IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO)); flags._eventHandled=YES; } - (void) decodeWM_QUERYOPENParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { } - (void) decodeWM_SYSCOMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // stubbed for future development switch (wParam) { case SC_CLOSE: break; case SC_CONTEXTHELP: break; case SC_HOTKEY: break; case SC_HSCROLL: break; case SC_KEYMENU: break; case SC_MAXIMIZE: break; case SC_MINIMIZE: flags.HOLD_MINI_FOR_SIZE=TRUE; break; case SC_MONITORPOWER: break; case SC_MOUSEMENU: break; case SC_MOVE: break; case SC_NEXTWINDOW: break; case SC_PREVWINDOW: break; case SC_RESTORE: break; case SC_SCREENSAVE: break; case SC_SIZE: break; case SC_TASKLIST: break; case SC_VSCROLL: break; default: break; } } - (void) decodeWM_COMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { [[GSTheme theme] processCommand: (void *)wParam]; } - (void) decodeWM_THEMECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // Reactivate the theme when the host system changes it's theme... [[GSTheme theme] activate]; } @end gnustep-back-0.29.0/Source/win32/w32_movesize.m000066400000000000000000000232351404163720200211050ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2005 Free Software Foundation, Inc. Written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "win32/WIN32Server.h" #include "win32/WIN32Geometry.h" @implementation WIN32Server (w32_movesize) - (LRESULT) decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { if (flags.HOLD_MINI_FOR_SIZE == FALSE) { NSPoint eventLocation; NSRect rect; RECT r; NSEvent *ev = nil; GetWindowRect(hwnd, &r); rect = MSScreenRectToGS(r); eventLocation = rect.origin; ev = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowMoved data1: rect.origin.x data2: rect.origin.y]; //need native code here? [EVENT_WINDOW(hwnd) sendEvent: ev]; } return 0; } - (LRESULT) decodeWM_SIZEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { switch ((int)wParam) { case SIZE_MAXHIDE: { // stubbed for future development } break; case SIZE_MAXSHOW: { // stubbed for future development } break; case SIZE_MINIMIZED: { if (flags.HOLD_MINI_FOR_SIZE == TRUE) // this is fix for [5, 25 bug] break; [EVENT_WINDOW(hwnd) miniaturize: self]; break; } break; case SIZE_MAXIMIZED: case SIZE_RESTORED: { NSPoint eventLocation; NSRect rect; RECT r; NSEvent *ev =nil; GetWindowRect(hwnd, &r); rect = MSScreenRectToGS(r); eventLocation = rect.origin; // make event ev = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowResized data1: rect.size.width data2: rect.size.height]; [EVENT_WINDOW(hwnd) sendEvent: ev]; [self resizeBackingStoreFor: hwnd]; // fixes part one of bug [5, 25] see notes if ([self usesNativeTaskbar]) [EVENT_WINDOW(hwnd) deminiaturize:self]; } break; default: break; } flags.HOLD_MINI_FOR_SIZE = FALSE; return 0; } - (void) decodeWM_NCCALCSIZEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { #if 0 DefWindowProc(hwnd, WM_NCCALCSIZE, wParam, lParam); flags._eventHandled = YES; #endif return; } - (void) decodeWM_WINDOWPOSCHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { WINDOWPOS *inf = (WINDOWPOS*)lParam; if ((inf->flags & SWP_NOZORDER) == 0) { HWND hi; HWND lo; int hl; int ll; /* For debugging, log current window stack. */ if (GSDebugSet(@"WTrace") == YES) { NSString *s = @"Window list:\n"; hi = GetDesktopWindow(); hi = GetWindow(hi, GW_CHILD); if (hi > 0) { hi = GetWindow(hi, GW_HWNDLAST); } while (hi > 0) { TCHAR buf[32]; hi = GetNextWindow(hi, GW_HWNDPREV); if (hi > 0 && GetClassName(hi, buf, 32) == 18 && strncmp(buf, "GNUstepWindowClass", 18) == 0) { if (GetWindowLongPtr(hi, OFF_ORDERED) == 1) { hl = GetWindowLongPtr(hi, OFF_LEVEL); s = [s stringByAppendingFormat: @"%d (%d)\n", hi, hl]; } } } NSLog(@"window pos changed: %@", s); } /* This window has changed its z-order, so we take the opportunity * to check that all the GNUstep windows are in the correct order * of their levels. * We do this as a simple bubble sort ...swapping over a pait of * windows if we find any pair in the list which are in the wrong * order. This sort has the virtue of being simple and of * maintaining window order within a level. ... but may be too slow. */ hi = GetDesktopWindow(); hi = GetWindow(hi, GW_CHILD); while (hi > 0) { TCHAR buf[32]; /* Find a GNUstep window which is ordered in and above desktop */ while (hi > 0) { if (GetClassName(hi, buf, 32) == 18 && strncmp(buf, "GNUstepWindowClass", 18) == 0 && GetWindowLongPtr(hi, OFF_ORDERED) == 1 && (hl = GetWindowLongPtr(hi, OFF_LEVEL)) > NSDesktopWindowLevel) { break; } hi = GetNextWindow(hi, GW_HWNDNEXT); } if (hi > 0) { NSDebugLLog(@"WTrace", @"sort hi %d (%d)", hi, hl); /* Find the next (lower in z-order) GNUstep window which * is ordered in and above desktop */ lo = GetNextWindow(hi, GW_HWNDNEXT); while (lo > 0) { if (GetClassName(lo, buf, 32) == 18 && strncmp(buf, "GNUstepWindowClass", 18) == 0 && GetWindowLongPtr(lo, OFF_ORDERED) == 1 && (ll = GetWindowLongPtr(lo, OFF_LEVEL)) > NSDesktopWindowLevel) { break; } lo = GetNextWindow(lo, GW_HWNDNEXT); } if (lo > 0) { NSDebugLLog(@"WTrace", @"sort lo %d (%d)", lo, ll); /* Check to see if the higher of the two windows should * actually be lower. */ if (hl < ll) { HWND higher; /* Insert the low window before the high one. * ie after the window preceding the high one. */ higher = GetNextWindow(hi, GW_HWNDPREV); if (higher == 0) { higher = HWND_TOP; } NSDebugLLog(@"WTrace", @"swap %d (%d) with %d (%d)", hi, hl, lo, ll); SetWindowPos(lo, higher, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); /* Done this iteration of the sort ... the next * iteration takes place when we get notified * that the swap we have just donew is complete. */ break; } } hi = lo; } } } } - (void) decodeWM_WINDOWPOSCHANGINGParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { WINDOWPOS *inf = (WINDOWPOS*)lParam; if ((inf->flags & SWP_NOZORDER) == 0) { /* desktop level windows should stay at the bottom of the * window list, so we can simply override any re-ordering * to ensure that they are at the bottom unless another * desktop level window is inserted below them. */ if (GetWindowLongPtr(hwnd, OFF_LEVEL) <= NSDesktopWindowLevel) { inf->hwndInsertAfter = HWND_BOTTOM; } } } - (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr(hwnd, GWLP_USERDATA); MINMAXINFO *mm; if (win != NULL) { mm = (MINMAXINFO*)lParam; mm->ptMinTrackSize = win->minmax.ptMinTrackSize; mm->ptMaxTrackSize = win->minmax.ptMaxTrackSize; return 0; } return 0; } - (LRESULT) decodeWM_ENTERSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { return DefWindowProc(hwnd, WM_ENTERSIZEMOVE, wParam, lParam); } - (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { return DefWindowProc(hwnd, WM_EXITSIZEMOVE, wParam, lParam); } - (LRESULT) decodeWM_SIZINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { [EVENT_WINDOW(hwnd) displayIfNeeded]; return TRUE; } - (LRESULT) decodeWM_MOVINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam { [EVENT_WINDOW(hwnd) display]; return TRUE; } @end gnustep-back-0.29.0/Source/win32/w32_text_focus.m000066400000000000000000000067411404163720200214320ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2005 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 Part of this code have been re-written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "win32/WIN32Server.h" #include "win32/WIN32Geometry.h" @implementation WIN32Server (w32_text_focus) - (LRESULT) decodeWM_SETFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { /* This message comes when the window already got focus, so we send a focus in event to the front end, but also mark the window as having current focus so that the front end doesn't try to focus the window again. */ currentFocus = hwnd; if (currentFocus == desiredFocus) { /* This was from a request from the front end. Mark as done. */ desiredFocus = 0; } else { /* We need to do this directly and not send an event to the frontend - that's too slow and allows the window state to get out of sync, causing bad recursion problems */ NSEvent *ev; ev = [NSEvent otherEventWithType: NSAppKitDefined location: NSMakePoint(0, 0) modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowFocusIn data1: 0 data2: 0]; NSDebugLLog(@"Focus", @"Making %d key", (int)hwnd); [EVENT_WINDOW(hwnd) sendEvent: ev]; } return 0; } - (void) decodeWM_KILLFOCUSParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { NSEvent *ev; // Remember the now focused window currentFocus = (HWND) wParam; ev = [NSEvent otherEventWithType: NSAppKitDefined location: NSMakePoint(0, 0) modifierFlags: 0 timestamp: 0 windowNumber: (int)hwnd context: GSCurrentContext() subtype: GSAppKitWindowFocusOut data1: 0 data2: 0]; [EVENT_WINDOW(hwnd) sendEvent: ev]; flags._eventHandled = YES; } - (void) decodeWM_GETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // stub for future dev } /* - (LRESULT) decodeWM_SETTEXTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { printf("WM_SETTEXT\n"); printf("Window text is: %s\n", (LPSTR)lParam); if (SetWindowText(hwnd, (LPSTR)lParam) == 0) printf("error on setWindow text %ld\n", GetLastError()); return 0; } */ @end gnustep-back-0.29.0/Source/win32/w32_windowdisplay.m000066400000000000000000000106601404163720200221370ustar00rootroot00000000000000/* WIN32Server - Implements window handling for MSWindows Copyright (C) 2005 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 Part of this code have been re-written by: Tom MacSween Date August 2005 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "win32/WIN32Server.h" #include "win32/WIN32Geometry.h" static void invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect) { WIN_INTERN *win = (WIN_INTERN *)GetWindowLongPtr((HWND)hwnd, GWLP_USERDATA); if (!win->useHDC || win->backingStoreEmpty) { NSWindow *window = GSWindowWithNumber((int)hwnd); NSRect r = MSWindowRectToGS(svr, hwnd, rect); /* NSLog(@"Invalidated window %d %@ (%d, %d, %d, %d)", hwnd, NSStringFromRect(r), rect.left, rect.top, rect.right, rect.bottom); */ /* Repaint the windows's client area */ [[[window contentView] superview] setNeedsDisplayInRect: r]; // FIXME: We should never do a direct draw call here! [[[window contentView] superview] displayIfNeeded]; win->backingStoreEmpty = NO; } #if (BUILD_GRAPHICS==GRAPHICS_winlib) if (win->useHDC) { HDC hdc = GetDC((HWND)hwnd); WINBOOL result; result = BitBlt(hdc, rect.left, rect.top, (rect.right - rect.left), (rect.bottom - rect.top), win->hdc, rect.left, rect.top, SRCCOPY); if (!result) { NSWarnMLog(@"validateWindow failed %d", GetLastError()); } ReleaseDC((HWND)hwnd, hdc); } #endif } @implementation WIN32Server (w32_windowdisplay) - (void) decodeWM_SHOWWINDOWParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { //SW_OTHERUNZOOM //window is being uncovered //SW_OTHERZOOM //window is being covered by window that has maximized. //SW_PARENTCLOSING // window's owner window is being minimized. //SW_PARENTOPENING //The window's owner window is being restored. //zero - 0 //call to the ShowWindow function switch ((int)wParam) { case TRUE: { switch ((int)lParam) { case 0: { ShowWindow(hwnd, SW_SHOW); flags._eventHandled=YES; } break; case SW_PARENTCLOSING: { ShowWindow(hwnd, SW_SHOW); flags._eventHandled=YES; } break; default: break; } } break; case FALSE: { } break; default: break; } } - (void) decodeWM_NCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { } - (LRESULT) decodeWM_ERASEBKGNDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // GS handles this for now... return (LRESULT)1; } - (void) decodeWM_PAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { RECT rect; if (GetUpdateRect(hwnd, &rect, TRUE)) { NSRect r = MSWindowRectToGS(self, hwnd, rect); NSWindow *window = GSWindowWithNumber((int)hwnd); [[[window contentView] superview] setNeedsDisplayInRect: r]; } //flags._eventHandled = YES; -->DefWindowProc validates the event } - (void) decodeWM_SYNCPAINTParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // stub for future dev } - (void) decodeWM_CAPTURECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // stub for future dev } - (HICON) decodeWM_GETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { // stub for future dev return currentAppIcon; } - (HICON) decodeWM_SETICONParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { return currentAppIcon; } @end gnustep-back-0.29.0/Source/winlib/000077500000000000000000000000001404163720200167105ustar00rootroot00000000000000gnustep-back-0.29.0/Source/winlib/.cvsignore000066400000000000000000000000171404163720200207060ustar00rootroot00000000000000Resources *obj gnustep-back-0.29.0/Source/winlib/GNUmakefile000066400000000000000000000027211404163720200207640ustar00rootroot00000000000000# # Main makefile for GNUstep WIN32 GUI Backend # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Fred Kiefer # # This file is part of the GNUstep WIN32 GUI Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make SUBPROJECT_NAME=winlib # The C source files to be compiled winlib_C_FILES = # The Objective-C source files to be compiled winlib_OBJC_FILES = \ WIN32Context.m \ WIN32GState.m \ WIN32FontEnumerator.m \ WIN32FontInfo.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/winlib/GNUmakefile.preamble000066400000000000000000000036251404163720200225560ustar00rootroot00000000000000# # Makefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Fred Kiefer # # This file is part of the GNUstep WIN32 GUI Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # GNUmakefile.preamble # # Project specific makefile variables # # Do not put any GNUMakefile rules in this file, instead they should # be put into GNUmakefile.postamble. # # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS = -DWINVER=0x0500 # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS = -DWINVER=0x0500 # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS = -I../../Headers \ -I$(GNUSTEP_TARGET_DIR) -I.. $(GRAPHIC_CFLAGS) # Additional LDFLAGS to pass to the linker # ADDITIONAL_LDFLAGS = # Additional library directories the linker should search # ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # # Additional directories to be created during installation # ADDITIONAL_INSTALL_DIRS = gnustep-back-0.29.0/Source/winlib/WIN32Context.m000066400000000000000000000064311404163720200212410ustar00rootroot00000000000000/* WIN32Context - Implements graphic context for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "winlib/WIN32GState.h" #include "winlib/WIN32FontEnumerator.h" #include "winlib/WIN32FontInfo.h" #include "winlib/WIN32Context.h" /* Common graphics functions */ @implementation WIN32Context /* Initialize AppKit backend */ + (void)initializeBackend { NSDebugLog(@"Initializing GNUstep GUI Win32 backend.\n"); [NSGraphicsContext setDefaultContextClass: [WIN32Context class]]; [GSFontEnumerator setDefaultClass: [WIN32FontEnumerator class]]; [GSFontInfo setDefaultClass: [WIN32FontInfo class]]; } + (Class) GStateClass { return [WIN32GState class]; } - (void)flushGraphics { } // Try to match restrictions in GSCreateBitmap() - (BOOL) isCompatibleBitmap: (NSBitmapImageRep*)bitmap { NSString *colorSpaceName; NSInteger numColors; if ([bitmap bitmapFormat] != 0) { return NO; } if ([bitmap isPlanar]) { return NO; } if ([bitmap bitsPerSample] != 8) { return NO; } numColors = [bitmap samplesPerPixel] - ([bitmap hasAlpha] ? 1 : 0); colorSpaceName = [bitmap colorSpaceName]; if ([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] || [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) { return (numColors == 3); } else if ([colorSpaceName isEqualToString: NSDeviceWhiteColorSpace] || [colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) { return (numColors == 1); } else if ([colorSpaceName isEqualToString: NSDeviceBlackColorSpace] || [colorSpaceName isEqualToString: NSCalibratedBlackColorSpace]) { return (numColors == 1); } else { return NO; } } @end @implementation WIN32Context (Ops) - (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { void *windevice = [(WIN32GState *)gstate window]; if (device) *device = windevice; if (x && y) { NSPoint offset = [gstate offset]; *x = offset.x; *y = offset.y; } } - (void) GSSetDevice: (void *)device : (int)x : (int)y { [(WIN32GState*)gstate setWindow: (HWND)device]; [gstate setOffset: NSMakePoint(x, y)]; } - (BOOL) supportsDrawGState { return YES; } @end gnustep-back-0.29.0/Source/winlib/WIN32FontEnumerator.m000066400000000000000000000156471404163720200225760ustar00rootroot00000000000000/* Win32FontEnumerator - Implements font enumerator for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include "winlib/WIN32FontEnumerator.h" #include "windows.h" @implementation WIN32FontEnumerator int win32_font_weight(LONG tmWeight) { int weight; // The MS names are a bit different from the NS ones! switch (tmWeight) { case FW_THIN: weight = 1; break; case FW_EXTRALIGHT: weight = 2; break; case FW_LIGHT: weight = 3; break; case FW_REGULAR: weight = 5; break; case FW_MEDIUM: weight = 6; break; case FW_DEMIBOLD: weight = 7; break; case FW_BOLD: weight = 9; break; case FW_EXTRABOLD: weight = 10; break; case FW_BLACK: weight = 12; break; default: // Try to map the range 0 to 1000 into 1 to 14. weight = (int)(tmWeight * 14 / 1000); break; } return weight; } // FIXME NSString *fontStyles[] = {@" Italic", @" Oblique", @" Bold", @" BoldItalic", @" Demibold", @" Normal", @" Kursiv", @" Fett"}; NSString *win32_font_family(NSString *fontName) { NSString *fontFamily; int i; int max = sizeof(fontStyles) / sizeof(NSString*); fontFamily = fontName; for (i = 0; i < max; i++) { if ([fontFamily hasSuffix: fontStyles[i]]) { fontFamily = [fontFamily substringToIndex: ([fontFamily length] - [fontStyles[i] length])]; } } //NSLog(@"Font Family %@ for %@", fontFamily, fontName); return fontFamily; } static void add_font(NSMutableArray *fontDefs, NSString *fontName, ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEXW *lpntme) { NSArray *fontDef; NSString *fontStyle; NSFontTraitMask traits = 0; int weight; weight = win32_font_weight(lpntme->ntmTm.tmWeight); if (weight >= 9) traits |= NSBoldFontMask; else traits |= NSUnboldFontMask; if (lpntme->ntmTm.tmItalic) traits |= NSItalicFontMask; else traits |= NSUnitalicFontMask; fontStyle = [NSString stringWithCharacters: lpelfe->elfStyle length: wcslen(lpelfe->elfStyle)]; fontDef = [NSArray arrayWithObjects: fontName, fontStyle, [NSNumber numberWithInt: weight], [NSNumber numberWithUnsignedInt: traits], nil]; [fontDefs addObject: fontDef]; } int CALLBACK fontenum(ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEXW *lpntme, DWORD FontType, LPARAM lParam) { NSString *fontName; fontName = [NSString stringWithCharacters: lpelfe->elfFullName length: wcslen(lpelfe->elfFullName)]; NSDebugLLog(@"NSFont", @"Found font %@", fontName); add_font((NSMutableArray *)lParam, fontName, lpelfe, lpntme); return 1; } static void enumerate_font(NSMutableArray *fontDefs, NSString *fontFamily) { HDC hdc; LOGFONTW logfont; int res; CREATE_AUTORELEASE_POOL(pool); NSDebugLLog(@"NSFont", @"Enumerate font family %@", fontFamily); hdc = GetDC(NULL); logfont.lfCharSet = DEFAULT_CHARSET; wcsncpy(logfont.lfFaceName, (const unichar*)[fontFamily cStringUsingEncoding: NSUnicodeStringEncoding], LF_FACESIZE); logfont.lfPitchAndFamily = 0; res = EnumFontFamiliesExW(hdc, &logfont, (FONTENUMPROCW)fontenum, (LPARAM)fontDefs, 0); ReleaseDC(NULL, hdc); RELEASE(pool); } int CALLBACK fontfamilyenum(ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEXW *lpntme, DWORD FontType, LPARAM lParam) { NSString *fontName; NSString *familyName; NSMutableArray *fontDefs; WIN32FontEnumerator *enumer = (WIN32FontEnumerator*)lParam; fontName = [NSString stringWithCharacters: lpelfe->elfFullName length: wcslen(lpelfe->elfFullName)]; familyName = win32_font_family(fontName); fontDefs = [enumer->allFontFamilies objectForKey: familyName]; if (fontDefs == nil) { NSArray *fontDef; fontDefs = [NSMutableArray arrayWithCapacity: 10]; [enumer->allFontFamilies setObject: fontDefs forKey: familyName]; // FIXME: Need to loop over all fonts for this family //add_font(fontDefs, fontName, lpelfe, lpntme); //enumerate_font(fontDefs, familyName); fontDef = [NSArray arrayWithObjects: familyName, @"Normal", [NSNumber numberWithInt: 6], [NSNumber numberWithUnsignedInt: 0], nil]; [fontDefs addObject: fontDef]; fontDef = [NSArray arrayWithObjects: [familyName stringByAppendingString: @" Bold"], @"Bold", [NSNumber numberWithInt: 9], [NSNumber numberWithUnsignedInt: NSBoldFontMask], nil]; [fontDefs addObject: fontDef]; fontDef = [NSArray arrayWithObjects: [familyName stringByAppendingString: @" Italic"], @"Italic", [NSNumber numberWithInt: 6], [NSNumber numberWithUnsignedInt: NSItalicFontMask], nil]; [fontDefs addObject: fontDef]; fontDef = [NSArray arrayWithObjects: [familyName stringByAppendingString: @" Bold Italic"], @"Bold Italic", [NSNumber numberWithInt: 9], [NSNumber numberWithUnsignedInt: NSBoldFontMask | NSItalicFontMask], nil]; [fontDefs addObject: fontDef]; [(NSMutableArray*)(enumer->allFontNames) addObject: fontName]; } return 1; } - (void) enumerateFontsAndFamilies { static BOOL done = NO; if (!done) { HDC hdc; LOGFONTW logfont; int res; CREATE_AUTORELEASE_POOL(pool); allFontFamilies = [[NSMutableDictionary alloc] init]; allFontNames = [[NSMutableArray alloc] init]; hdc = GetDC(NULL); logfont.lfCharSet = DEFAULT_CHARSET; logfont.lfFaceName[0] = '\0'; logfont.lfPitchAndFamily = 0; // This get ignored logfont.lfItalic = 0; logfont.lfWeight = FW_NORMAL; res = EnumFontFamiliesExW(hdc, &logfont, (FONTENUMPROCW)fontfamilyenum, (LPARAM)self, 0); ReleaseDC(NULL, hdc); RELEASE(pool); done = YES; } } - (NSString*) defaultSystemFontName { return @"Tahoma"; } - (NSString*) defaultBoldSystemFontName { return @"Tahoma Bold"; } - (NSString*) defaultFixedPitchFontName { return @"Courier New"; } @end gnustep-back-0.29.0/Source/winlib/WIN32FontInfo.m000066400000000000000000000300101404163720200213250ustar00rootroot00000000000000/* Win32FontInfo - Implements font enumerator for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include "winlib/WIN32FontInfo.h" int win32_font_weight(LONG tmWeight); NSString *win32_font_family(NSString *fontName); @interface WIN32FontInfo (Private) - (BOOL) setupAttributes; @end @implementation WIN32FontInfo - initWithFontName: (NSString*)name matrix: (const CGFloat *)fmatrix screenFont: (BOOL)screenFont { if (screenFont) { RELEASE(self); return nil; } [super init]; ASSIGN(fontName, name); memcpy(matrix, fmatrix, sizeof(matrix)); if (![self setupAttributes]) { RELEASE(self); return nil; } return self; } - (void) dealloc { if (hFont) { DeleteObject(hFont); hFont = NULL; } [super dealloc]; } - (CGFloat) widthOfString: (NSString*)string { SIZE size; HDC hdc; HFONT old; hdc = CreateCompatibleDC(NULL); old = SelectObject(hdc, hFont); GetTextExtentPoint32W(hdc, (const unichar*)[string cStringUsingEncoding: NSUnicodeStringEncoding], [string length], &size); SelectObject(hdc, old); DeleteDC(hdc); return size.cx; } - (NSMultibyteGlyphPacking)glyphPacking { return NSOneByteGlyphPacking; } - (NSSize) advancementForGlyph: (NSGlyph)glyph { unichar u = (unichar)glyph; HDC hdc; float w; ABCFLOAT abc; HFONT old; hdc = CreateCompatibleDC(NULL); old = SelectObject(hdc, hFont); // FIXME ... currently a gnustep glyph is a unichar ... what if that changes. GetCharABCWidthsFloatW(hdc, u, u, &abc); SelectObject(hdc, old); DeleteDC(hdc); //NSLog(@"Width for %d is %f or %f", glyph, w, (abc.abcfA + abc.abcfB + abc.abcfC)); w = abc.abcfA + abc.abcfB + abc.abcfC; return NSMakeSize(w, 0); } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { WORD c = (WORD)glyph; WORD windowsGlyph; HDC hdc; HFONT old; GLYPHMETRICS gm; NSRect rect; hdc = CreateCompatibleDC(NULL); old = SelectObject(hdc, hFont); // Convert from GNUstep glyph (unichar) to windows glyph. if (GetGlyphIndicesW(hdc, &c, 1, &windowsGlyph, 0) == GDI_ERROR) { SelectObject(hdc, old); DeleteDC(hdc); NSLog(@"No glyph for U%d", c); return NSMakeRect(0, 0, 0, 0); // No such glyph } if (GDI_ERROR != GetGlyphOutlineW(hdc, windowsGlyph, GGO_METRICS, // || GGO_GLYPH_INDEX &gm, 0, NULL, NULL)) { rect = NSMakeRect(gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.y - gm.gmBlackBoxY, gm.gmCellIncX, gm.gmCellIncY); } else { rect = NSMakeRect(0, 0, 0, 0); } SelectObject(hdc, old); DeleteDC(hdc); return rect; } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { WORD c = (WORD)glyph; WORD windowsGlyph; HDC hdc; HFONT old; BOOL result = YES; hdc = CreateCompatibleDC(NULL); old = SelectObject(hdc, hFont); // Convert from GNUstep glyph (unichar) to windows glyph. if ((GetGlyphIndicesW(hdc, &c, 1, &windowsGlyph, GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR) || (windowsGlyph == 0xFFFF)) { result = NO; } SelectObject(hdc, old); DeleteDC(hdc); return result; } - (NSGlyph) glyphWithName: (NSString*)glyphName { return 0; } - (NSPoint) positionOfGlyph: (NSGlyph)curGlyph precededByGlyph: (NSGlyph)prevGlyph isNominal: (BOOL*)nominal { return NSMakePoint(0, 0); } - (NSCharacterSet*) coveredCharacterSet { if (coveredCharacterSet == nil) { NSMutableCharacterSet *ms; unsigned count; GLYPHSET *gs = 0; HDC hdc; HFONT old; ms = [NSMutableCharacterSet new]; if (!ms) return nil; hdc = CreateCompatibleDC(NULL); old = SelectObject(hdc, hFont); count = (unsigned)GetFontUnicodeRanges(hdc, 0); if (count > 0) { gs = (GLYPHSET*)malloc(count); if (!gs) { SelectObject(hdc, old); DeleteDC(hdc); RELEASE(ms); return nil; } gs->cbThis = count; if ((unsigned)GetFontUnicodeRanges(hdc, gs) == count) { numberOfGlyphs = gs->cGlyphsSupported; if (gs->flAccel == 1 /* GS_8BIT_INDICES */) { for (count = 0; count < gs->cRanges; count++) { NSRange range; range.location = gs->ranges[count].wcLow & 0xff; range.length = gs->ranges[count].cGlyphs; [ms addCharactersInRange: range]; } } else { for (count = 0; count < gs->cRanges; count++) { NSRange range; range.location = gs->ranges[count].wcLow; range.length = gs->ranges[count].cGlyphs; [ms addCharactersInRange: range]; } } } free(gs); } SelectObject(hdc, old); DeleteDC(hdc); coveredCharacterSet = [ms copy]; RELEASE(ms); } return coveredCharacterSet; } - (void) drawString: (NSString*)string onDC: (HDC)hdc at: (POINT)p { HFONT old; old = SelectObject(hdc, hFont); TextOutW(hdc, p.x, p.y - ascender, (const unichar*)[string cStringUsingEncoding: NSUnicodeStringEncoding], [string length]); SelectObject(hdc, old); } - (void) draw:(const char*)s length: (int)len onDC: (HDC)hdc at: (POINT)p { HFONT old; old = SelectObject(hdc, hFont); TextOut(hdc, p.x, p.y - ascender, s, len); SelectObject(hdc, old); } - (void) drawGlyphs: (const NSGlyph*)s length: (int)len onDC: (HDC)hdc at: (POINT)p { WORD buf[len]; HFONT old; int i; old = SelectObject(hdc, hFont); /* * For now, assume that a glyph is a unicode character and can be * stored in a windows WORD */ for (i = 0; i < len; i++) { buf[i] = (WORD)s[i]; } TextOutW(hdc, p.x, p.y - ascender, buf, len); SelectObject(hdc, old); } - (unsigned) numberOfglyphs { if (coveredCharacterSet == nil) { [self coveredCharacterSet]; } return numberOfGlyphs; } - (void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs count: (int)length toBezierPath: (NSBezierPath *)path { WORD buf[length]; int i; SIZE sBoundBox; int h; int iPoints; POINT *ptPoints; BYTE *bTypes; NSPoint startPoint; HDC hDC = CreateCompatibleDC(NULL); if (!hDC) { NSDebugLLog(@"WIN32FontInfo", @"Problem creating HDC for appendBezierPathWithGlyphs:"); return; } SetGraphicsMode(hDC, GM_ADVANCED); SetMapMode(hDC, MM_ANISOTROPIC); SetWindowExtEx(hDC, 1, 1, NULL); SetViewportExtEx(hDC, 1, -1, NULL); SetViewportOrgEx(hDC, 0, 0, NULL); /* * For now, assume that a glyph is a unicode character and can be * stored in a windows WORD */ for (i = 0; i < length; i++) { buf[i] = glyphs[i]; } SelectObject(hDC, hFont); GetTextExtentPoint32W(hDC, buf, length, &sBoundBox); h = sBoundBox.cy; if ([path elementCount] > 0) { startPoint = [path currentPoint]; } else { startPoint = NSZeroPoint; } SetBkMode(hDC, TRANSPARENT); BeginPath(hDC); SetTextAlign(hDC, TA_LEFT | TA_TOP); TextOutW(hDC, startPoint.x, -startPoint.y, buf, length); EndPath(hDC); iPoints = GetPath(hDC, NULL, NULL, 0); if (iPoints == 0) { DeleteDC(hDC); return; } ptPoints = malloc(sizeof(POINT) * iPoints); if (!ptPoints) { DeleteDC(hDC); return; } bTypes = malloc(sizeof(BYTE) * iPoints); if (!bTypes) { free(ptPoints); DeleteDC(hDC); return; } GetPath(hDC, ptPoints, bTypes, iPoints); // Now append the glyphs to the path i = 0; while (i < iPoints) { if (bTypes[i] == PT_MOVETO) { [path moveToPoint: NSMakePoint(ptPoints[i].x, h - ptPoints[i].y)]; i++; } else if (bTypes[i] & PT_LINETO) { [path lineToPoint: NSMakePoint(ptPoints[i].x, h - ptPoints[i].y)]; if (bTypes[i] & PT_CLOSEFIGURE) [path closePath]; i++; } else if (bTypes[i] & PT_BEZIERTO) { // FIXME: We assume windows isn't lying here about the bezier points [path curveToPoint: NSMakePoint(ptPoints[i+2].x, h - ptPoints[i+2].y) controlPoint1: NSMakePoint(ptPoints[i].x, h - ptPoints[i].y) controlPoint2: NSMakePoint(ptPoints[i+1].x, h - ptPoints[i+1].y)]; if ((bTypes[i] & PT_CLOSEFIGURE) || (bTypes[i+1] & PT_CLOSEFIGURE) || (bTypes[i+2] & PT_CLOSEFIGURE)) [path closePath]; i += 3; } } free(bTypes); free(ptPoints); DeleteDC(hDC); } @end @implementation WIN32FontInfo (Private) - (BOOL) setupAttributes { HDC hdc; TEXTMETRICW metric; HFONT old; LOGFONTW logfont; NSRange range; //NSLog(@"Creating Font %@ of size %f", fontName, matrix[0]); ASSIGN(familyName, win32_font_family(fontName)); memset(&logfont, 0, sizeof(LOGFONT)); hdc = CreateCompatibleDC(NULL); // FIXME This hack gets the font size about right, but what is the real solution? logfont.lfHeight = (int)(matrix[0] * 4 / 3); //logfont.lfHeight = -MulDiv(matrix[0], GetDeviceCaps(hdc, LOGPIXELSY), 72); range = [fontName rangeOfString: @"Bold"]; if (range.length) logfont.lfWeight = FW_BOLD; range = [fontName rangeOfString: @"Italic"]; if (range.length) logfont.lfItalic = 1; logfont.lfQuality = DEFAULT_QUALITY; wcsncpy(logfont.lfFaceName, (const unichar*)[familyName cStringUsingEncoding: NSUnicodeStringEncoding], LF_FACESIZE); hFont = CreateFontIndirectW(&logfont); if (!hFont) { NSLog(@"Could not create font %@", fontName); DeleteDC(hdc); return NO; } old = SelectObject(hdc, hFont); GetTextMetricsW(hdc, &metric); SelectObject(hdc, old); DeleteDC(hdc); // Fill the ivars isFixedPitch = TMPF_FIXED_PITCH & metric.tmPitchAndFamily; isBaseFont = NO; ascender = metric.tmAscent; //NSLog(@"Resulted in height %d and ascent %d", metric.tmHeight, metric.tmAscent); descender = -metric.tmDescent; /* TODO */ xHeight = ascender * 0.5; maximumAdvancement = NSMakeSize((float)metric.tmMaxCharWidth, 0.0); fontBBox = NSMakeRect((float)(0), (float)(0 - metric.tmAscent), (float)metric.tmMaxCharWidth, (float)metric.tmHeight); weight = win32_font_weight(metric.tmWeight); traits = 0; if (weight >= 9) traits |= NSBoldFontMask; else traits |= NSUnboldFontMask; if (metric.tmItalic) traits |= NSItalicFontMask; else traits |= NSUnitalicFontMask; // FIXME Should come from metric.tmCharSet mostCompatibleStringEncoding = NSISOLatin1StringEncoding; return YES; } @end gnustep-back-0.29.0/Source/winlib/WIN32GState.m000066400000000000000000001173401404163720200210060ustar00rootroot00000000000000/* WIN32GState - Implements graphic state drawing for MSWindows Copyright (C) 2002 Free Software Foundation, Inc. Written by: Fred Kiefer Additions by: Christopher Armstrong Date: March 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Currently the use of alpha blending is switched off by default. #define USE_ALPHABLEND // Define this so we pick up AlphaBlend, when loading windows.h #ifdef USE_ALPHABLEND #if !defined(WINVER) #define WINVER 0x0500 #elif (WINVER < 0x0500) #undef WINVER #define WINVER 0x0500 #endif #endif #import #import #import #import #import #import #import #import #import "winlib/WIN32GState.h" #import "winlib/WIN32Context.h" #import "winlib/WIN32FontInfo.h" #import "win32/WIN32Server.h" #include #include #ifndef AC_SRC_ALPHA // Missing definitions from wingdi.h #define AC_SRC_ALPHA 0x01 #endif static inline int WindowHeight(HWND window) { RECT rect; if (!window) { NSLog(@"No window for coordinate transformation."); return 0; } if (!GetClientRect(window, &rect)) { NSLog(@"No window rectangle for coordinate transformation."); return 0; } return rect.bottom - rect.top; } static inline POINT GSWindowPointToMS(WIN32GState *s, NSPoint p) { POINT p1; p1.x = p.x - s->offset.x; p1.y = s->offset.y - p.y; return p1; } static inline RECT GSWindowRectToMS(WIN32GState *s, NSRect r) { RECT r1; r1.left = r.origin.x - s->offset.x; r1.bottom = s->offset.y - r.origin.y; r1.right = r1.left + r.size.width; r1.top = r1.bottom - r.size.height; return r1; } static inline POINT GSViewPointToWin(WIN32GState *s, NSPoint p) { p = [s->ctm transformPoint: p]; return GSWindowPointToMS(s, p); } static inline RECT GSViewRectToWin(WIN32GState *s, NSRect r) { r = [s->ctm rectInMatrixSpace: r]; return GSWindowRectToMS(s, r); } void* get_bits(HDC dc, int w, int h, HBITMAP *bitmap) { void *bits = NULL; BITMAPINFO info; HDC cDC; info.bmiHeader.biSize = sizeof(BITMAPINFO); info.bmiHeader.biWidth = w; info.bmiHeader.biHeight = h; info.bmiHeader.biPlanes = 1; info.bmiHeader.biBitCount = 32; info.bmiHeader.biCompression = BI_RGB; info.bmiHeader.biSizeImage = 0; info.bmiHeader.biXPelsPerMeter = 0; info.bmiHeader.biYPelsPerMeter = 0; info.bmiHeader.biClrUsed = 0; info.bmiHeader.biClrImportant = 0; if(!(cDC = CreateCompatibleDC(dc))) { NSLog(@"Could not create compatible DC"); return NULL; } if(!(*bitmap = CreateDIBSection(dc, (LPBITMAPINFO)&info, DIB_RGB_COLORS, &bits, NULL, 0))) { NSLog(@"Could not create bit map from DC"); return NULL; } SelectObject(cDC, *bitmap); return bits; } BOOL alpha_blend_source_over(HDC destDC, HDC srcDC, RECT rectFrom, int x, int y, int w, int h, CGFloat delta) { BOOL success = YES; #ifdef USE_ALPHABLEND // Use (0..1) fraction to set a (0..255) alpha constant value BYTE SourceConstantAlpha = (BYTE)(delta * 255); BLENDFUNCTION blendFunc = {AC_SRC_OVER, 0, SourceConstantAlpha, AC_SRC_ALPHA}; /* There is actually a very real chance this could fail, even on computers that supposedly support it. It's not known why it fails though... */ success = AlphaBlend(destDC, x, y, w, h, srcDC, rectFrom.left, rectFrom.top, w, h, blendFunc); // #else // HBITMAP sbitmap; // HBITMAP dbitmap; // unsigned char *sbits = (unsigned char *)get_bits(srcDC,w,h,&sbitmap); // unsigned char *dbits = (unsigned char *)get_bits(destDC,w,h,&dbitmap); #endif return success; } @interface WIN32GState (WinOps) - (void) setStyle: (HDC)hDC; - (void) restoreStyle: (HDC)hDC; - (HDC) getHDC; - (void) releaseHDC: (HDC)hDC; @end @implementation WIN32GState - (id) deepen { [super deepen]; if (clipRegion) { HRGN newClipRegion; newClipRegion = CreateRectRgn(0, 0, 1, 1); CombineRgn(newClipRegion, clipRegion, NULL, RGN_COPY); clipRegion = newClipRegion; } oldBrush = NULL; oldPen = NULL; oldClipRegion = NULL; return self; } - (void) dealloc { DeleteObject(clipRegion); [super dealloc]; } - (void) setWindow: (HWND)number { window = number; } - (HWND) window { return window; } - (void) setColor: (device_color_t *)acolor state: (color_state_t)cState { device_color_t color; [super setColor: acolor state: cState]; color = *acolor; gsColorToRGB(&color); if (cState & COLOR_FILL) wfcolor = RGB(color.field[0]*255, color.field[1]*255, color.field[2]*255); if (cState & COLOR_STROKE) wscolor = RGB(color.field[0]*255, color.field[1]*255, color.field[2]*255); } // NOTE: Ideally this code should be moved to -DPSinitgraphics and not called // directly, but this would imply to rewrite WIN32GState more extensively since // the current code expects the GDI base coordinates in many methods. - (void) setUpAppKitBaseCoordinatesForHDC: (HDC)hDC { int surfaceHeight = WindowHeight(window); int bottomOffset = offset.y - surfaceHeight; XFORM xForm; // NOTE: The world transform is the GDI CTM. GetWorldTransform(hDC, &oldWorldTransform); // Enables the use of transforms SetGraphicsMode(hDC, GM_ADVANCED); // Maps units to pixels SetMapMode(hDC, MM_TEXT); /* Flip the GDI base coordinate to match the AppKit because GDI draws the other way around with MM_TEXT. Also offset the drawing area to take in account the window border. */ xForm.eM11 = (FLOAT)1; xForm.eM12 = (FLOAT)0; xForm.eM21 = (FLOAT)0; xForm.eM22 = (FLOAT)-1; xForm.eDx = (FLOAT)-offset.x; xForm.eDy = (FLOAT)surfaceHeight + bottomOffset; SetWorldTransform(hDC, &xForm); } - (void) restoreGDIBaseCoordinatesForHDC: (HDC)hDC { SetWorldTransform(hDC, &oldWorldTransform); SetGraphicsMode(hDC, GM_COMPATIBLE); } /* For debugging */ - (void) drawOrientationMarkersIn: (HDC)hDC { RECT rect1 = { 0, 0, 20, 10 }; RECT rect2 = { 0, 30, 20, 30 + 10 }; FillRect(hDC, &rect1, CreateSolidBrush(RGB(255, 0, 255))); FillRect(hDC, &rect2, CreateSolidBrush(RGB(0, 255, 0))); } // FIXME: Drawing rotated images is broken (the origin is wrong). // If rewritten, viewIsFlipped check must be removed. - (void) compositeGState: (WIN32GState *)source fromRect: (NSRect)sourceRect toPoint: (NSPoint)destPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { HDC sourceDC; HDC hDC; RECT rectFrom; RECT rectTo; int h, w; int x; int y; NSRect destRect; BOOL success = NO; NSDebugLLog(@"WIN32GState", @"compositeGState: fromRect: %@ toPoint: %@ op: %d", NSStringFromRect(sourceRect), NSStringFromPoint(destPoint), op); if (viewIsFlipped && (self != source)) { destPoint.y -= sourceRect.size.height; } destRect.origin = destPoint; destRect.size = sourceRect.size; [ctm boundingRectFor: destRect result: &destRect]; rectTo = GSWindowRectToMS(self, destRect); x = rectTo.left; y = rectTo.bottom - sourceRect.size.height; { NSRect newRect; [source->ctm boundingRectFor: sourceRect result: &newRect]; rectFrom = GSWindowRectToMS(source, newRect); y += (sourceRect.size.height - newRect.size.height); // adjust location for scaled source } h = rectFrom.bottom - rectFrom.top; w = rectFrom.right - rectFrom.left; sourceDC = [source getHDC]; if (!sourceDC) { return; } if (self == source) { hDC = sourceDC; } else { hDC = [self getHDC]; if (!hDC) { [source releaseHDC: sourceDC]; return; } } switch (op) { case NSCompositeSourceOver: case NSCompositeHighlight: { success = alpha_blend_source_over(hDC, sourceDC, rectFrom, x, y, w, h, delta); if (success) break; } case NSCompositeCopy: { success = BitBlt(hDC, x, y, w, h, sourceDC, rectFrom.left, rectFrom.top, SRCCOPY); break; } case NSCompositeClear: { break; } default: success = BitBlt(hDC, x, y, w, h, sourceDC, rectFrom.left, rectFrom.top, SRCCOPY); break; } if (!success) { NSLog(@"Blit operation failed %d", GetLastError()); NSLog(@"Orig Copy Bits to %@ from %@", NSStringFromPoint(destPoint), NSStringFromRect(destRect)); NSLog(@"Copy bits to {%d, %d} from {%d, %d} size {%d, %d}", x, y, rectFrom.left, rectFrom.top, w, h); } if (self != source) { [self releaseHDC: hDC]; } [source releaseHDC: sourceDC]; } - (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op { CGFloat gray; // FIXME: This is taken from the xlib backend [self DPScurrentgray: &gray]; if (fabs(gray - 0.667) < 0.005) [self DPSsetgray: 0.333]; else [self DPSsetrgbcolor: 0.121 : 0.121 : 0]; switch (op) { case NSCompositeClear: break; case GSCompositeHighlight: { HDC hDC; RECT rect = GSViewRectToWin(self, aRect); hDC = [self getHDC]; if (!hDC) { return; } InvertRect(hDC, &rect); [self releaseHDC: hDC]; break; } case NSCompositeCopy: // FIXME case NSCompositeSourceOver: case NSCompositeHighlight: case NSCompositeSourceIn: case NSCompositeSourceOut: case NSCompositeSourceAtop: case NSCompositeDestinationOver: case NSCompositeDestinationIn: case NSCompositeDestinationOut: case NSCompositeDestinationAtop: case NSCompositeXOR: case NSCompositePlusDarker: case NSCompositePlusLighter: default: [self DPSrectfill: NSMinX(aRect) : NSMinY(aRect) : NSWidth(aRect) : NSHeight(aRect)]; break; } } // FIXME: Drawing images with alpha blending is broken - (void) drawGState: (WIN32GState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { HDC sourceDC; HDC hDC; XFORM xForm, xForm2; NSAffineTransformStruct tstruct = [ctm transformStruct]; RECT rectFrom = GSWindowRectToMS(source, aRect); int x = aPoint.x; int y = aPoint.y; int w = aRect.size.width; int h = aRect.size.height; BOOL success = YES; sourceDC = [source getHDC]; if (!sourceDC) { return; } if (self == source) { hDC = sourceDC; } else { hDC = [self getHDC]; if (!hDC) { [source releaseHDC: sourceDC]; return; } } /* Set up the AppKit base coordinates as the World transform */ [self setUpAppKitBaseCoordinatesForHDC: hDC]; /* Apply the AppKit CTM */ xForm.eM11 = (FLOAT)tstruct.m11; xForm.eM12 = (FLOAT)tstruct.m12; xForm.eM21 = (FLOAT)tstruct.m21; xForm.eM22 = (FLOAT)tstruct.m22; xForm.eDx = (FLOAT)tstruct.tX; xForm.eDy = (FLOAT)tstruct.tY; // Concat the transform by prepending it to the CTM ModifyWorldTransform(hDC, &xForm, MWT_LEFTMULTIPLY); /* Flip the CTM to compensate the fact that images are drawn upside down by -DPSimage which uses the GDI top left origin coordinates. */ xForm2.eM11 = (FLOAT)1; xForm2.eM12 = (FLOAT)0; xForm2.eM21 = (FLOAT)0; xForm2.eM22 = (FLOAT)-1; xForm2.eDx = (FLOAT)0; xForm2.eDy = (FLOAT)y * 2 + aRect.size.height; // Concat the flip transform by prepending it to the CTM ModifyWorldTransform(hDC, &xForm2, MWT_LEFTMULTIPLY); switch (op) { case NSCompositeSourceOver: case NSCompositeHighlight: { success = alpha_blend_source_over(hDC, sourceDC, rectFrom, x, y, w, h, delta); if (success) break; } case NSCompositeCopy: { success = BitBlt(hDC, x, y, w, h, sourceDC, rectFrom.left, rectFrom.top, SRCCOPY); break; } case NSCompositeClear: { break; } default: success = BitBlt(hDC, x, y, w, h, sourceDC, rectFrom.left, rectFrom.top, SRCCOPY); break; } //[self drawOrientationMarkersIn: hDC]; if (!success) { NSLog(@"Blit operation failed %d", GetLastError()); } [self restoreGDIBaseCoordinatesForHDC: hDC]; if (self != source) { [self releaseHDC: hDC]; } [source releaseHDC: sourceDC]; } static HBITMAP GSCreateBitmap(HDC hDC, NSInteger pixelsWide, NSInteger pixelsHigh, NSInteger bitsPerSample, NSInteger samplesPerPixel, NSInteger bitsPerPixel, NSInteger bytesPerRow, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]) { const unsigned char *bits = data[0]; HBITMAP hbitmap; BITMAPINFO *bitmap; BITMAPINFOHEADER *bmih; int xres, yres; UINT fuColorUse; if (isPlanar || (![colorSpaceName isEqualToString: NSDeviceRGBColorSpace] && ![colorSpaceName isEqualToString: NSCalibratedRGBColorSpace] && ![colorSpaceName isEqualToString: NSDeviceWhiteColorSpace] && ![colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace] && ![colorSpaceName isEqualToString: NSDeviceBlackColorSpace] && ![colorSpaceName isEqualToString: NSCalibratedBlackColorSpace])) { NSLog(@"Bitmap type currently not supported %d %@", isPlanar, colorSpaceName); return NULL; } // default is 8 bit grayscale if (!bitsPerSample) bitsPerSample = 8; if (!samplesPerPixel) samplesPerPixel = 1; // FIXME - does this work if we are passed a planar image but no hints ? if (!bitsPerPixel) bitsPerPixel = bitsPerSample * samplesPerPixel; if (!bytesPerRow) bytesPerRow = (bitsPerPixel * pixelsWide) / 8; // make sure its sane - also handles row padding if hint missing while ((bytesPerRow * 8) < (bitsPerPixel * pixelsWide)) bytesPerRow++; if (!(GetDeviceCaps(hDC, RASTERCAPS) & RC_DI_BITMAP)) { NSLog(@"Device %d does not support bitmap operations", hDC); return NULL; } hbitmap = CreateCompatibleBitmap(hDC, pixelsWide, pixelsHigh); if (!hbitmap) { NSLog(@"Failed to CreateCompatibleBitmap (%d, %d). Error %d", pixelsWide, pixelsHigh, GetLastError()); return NULL; } if (bitsPerPixel > 8) { bitmap = malloc(sizeof(BITMAPV4HEADER)); } else { // Leave some extra space for colour map. (Currently not used) bitmap = malloc(sizeof(BITMAPINFOHEADER) + (1 << bitsPerPixel) * sizeof(RGBQUAD)); } if (!bitmap) { NSLog(@"Failed to allocate memory for bitmap. Error %d", GetLastError()); DeleteObject(hbitmap); return NULL; } bmih = (BITMAPINFOHEADER*)bitmap; bmih->biSize = sizeof(BITMAPINFOHEADER); bmih->biWidth = pixelsWide; // Top down orientation bmih->biHeight = -pixelsHigh; bmih->biPlanes = 1; bmih->biBitCount = bitsPerPixel; bmih->biCompression = BI_RGB; bmih->biSizeImage = 0; xres = GetDeviceCaps(hDC, HORZRES) / GetDeviceCaps(hDC, HORZSIZE); yres = GetDeviceCaps(hDC, VERTRES) / GetDeviceCaps(hDC, VERTSIZE); bmih->biXPelsPerMeter = xres; bmih->biYPelsPerMeter = yres; bmih->biClrUsed = 0; bmih->biClrImportant = 0; fuColorUse = 0; if (bitsPerPixel == 8 && samplesPerPixel == 1) { unsigned char* tmp; unsigned int pixels = pixelsHigh * pixelsWide; unsigned int i = 0; unsigned int j = 0; bmih->biBitCount = 32; NSDebugLLog(@"WIN32GState", @"8bit greyscale picture with pixelsWide:%d " @"pixelsHigh:%d", pixelsWide, pixelsHigh); tmp = malloc(pixels * 4); if (!tmp) { NSLog(@"Failed to allocate temporary memory for bitmap. Error %d", GetLastError()); free(bitmap); DeleteObject(hbitmap); return NULL; } if ([colorSpaceName isEqualToString: NSDeviceWhiteColorSpace] || [colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) { while (i < (pixels*4)) { unsigned char pix; pix = bits[j]; tmp[i+0] = pix; tmp[i+1] = pix; tmp[i+2] = pix; tmp[i+3] = 0xFF; i+=4; j++; } } else if ([colorSpaceName isEqualToString: NSDeviceBlackColorSpace] || [colorSpaceName isEqualToString: NSCalibratedBlackColorSpace]) { while (i < (pixels*4)) { unsigned char pix; pix = UCHAR_MAX - bits[j]; tmp[i+0] = pix; tmp[i+1] = pix; tmp[i+2] = pix; tmp[i+3] = 0xFF; i+=4; j++; } } else { NSLog(@"Unexpected condition, greyscale which is neither white nor black"); free(tmp); free(bitmap); DeleteObject(hbitmap); return NULL; } bits = tmp; } else if (bitsPerPixel == 16 && samplesPerPixel == 2) // 8 bit greyscale 8 bit alpha { BITMAPV4HEADER *bmih; unsigned char *tmp; unsigned int pixels = pixelsHigh * pixelsWide; unsigned int i = 0; unsigned int j = 0; ((BITMAPINFOHEADER*)bitmap)->biBitCount = 32; bmih = (BITMAPV4HEADER*)bitmap; bmih->bV4Size = sizeof(BITMAPV4HEADER); bmih->bV4V4Compression = BI_BITFIELDS; bmih->bV4BlueMask = 0x000000FF; bmih->bV4GreenMask = 0x0000FF00; bmih->bV4RedMask = 0x00FF0000; bmih->bV4AlphaMask = 0xFF000000; tmp = malloc(pixels * 4); if (!tmp) { NSLog(@"Failed to allocate temporary memory for bitmap. Error %d", GetLastError()); free(bitmap); DeleteObject(hbitmap); return NULL; } if ([colorSpaceName isEqualToString: NSDeviceWhiteColorSpace] || [colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) { while (i < (pixels*4)) { unsigned char pix; pix = bits[j]; tmp[i+0] = pix; tmp[i+1] = pix; tmp[i+2] = pix; tmp[i+3] = bits[j + 1]; i += 4; j += 2; } } else if ([colorSpaceName isEqualToString: NSDeviceBlackColorSpace] || [colorSpaceName isEqualToString: NSCalibratedBlackColorSpace]) { while (i < (pixels*4)) { unsigned char pix; pix = UCHAR_MAX - bits[j]; tmp[i+0] = pix; tmp[i+1] = pix; tmp[i+2] = pix; tmp[i+3] = bits[j + 1]; i += 4; j += 2; } } else { NSLog(@"Unexpected condition, greyscale which is neither white nor black"); free(tmp); free(bitmap); DeleteObject(hbitmap); return NULL; } bits = tmp; } else if (bitsPerPixel == 32) { BITMAPV4HEADER *bmih; unsigned char *tmp; unsigned int pixels = pixelsHigh * pixelsWide; unsigned int i = 0; bmih = (BITMAPV4HEADER*)bitmap; bmih->bV4Size = sizeof(BITMAPV4HEADER); bmih->bV4V4Compression = BI_BITFIELDS; bmih->bV4BlueMask = 0x000000FF; bmih->bV4GreenMask = 0x0000FF00; bmih->bV4RedMask = 0x00FF0000; bmih->bV4AlphaMask = 0xFF000000; tmp = malloc(pixels * 4); if (!tmp) { NSLog(@"Failed to allocate temporary memory for bitmap. Error %d", GetLastError()); free(bitmap); DeleteObject(hbitmap); return NULL; } while (i < pixels*4) { tmp[i+0] = bits[i+2]; tmp[i+1] = bits[i+1]; tmp[i+2] = bits[i+0]; tmp[i+3] = bits[i+3]; i += 4; } bits = tmp; } else if (bitsPerPixel == 24) { unsigned char* tmp; unsigned int pixels = pixelsHigh * pixelsWide; unsigned int i = 0, j = 0; bmih->biBitCount = 32; NSDebugLLog(@"WIN32GState", @"24bit picure with pixelsWide:%d " @"pixelsHigh:%d", pixelsWide, pixelsHigh); tmp = malloc(pixels * 4); if (!tmp) { NSLog(@"Failed to allocate temporary memory for bitmap. Error %d", GetLastError()); free(bitmap); DeleteObject(hbitmap); return NULL; } while (i < (pixels*4)) { // We expand the bytes in a 24bit image into 32bits as Windows // seems to handle it better (and I can't figure out the correct // rearrangement for 24bit images anyway). tmp[i+0] = bits[j+2]; tmp[i+1] = bits[j+1]; tmp[i+2] = bits[j+0]; tmp[i+3] = 0xFF; i+=4; j+=3; } bits = tmp; } else { if (bitsPerPixel <= 8 && samplesPerPixel > 1) { // FIXME How to get a colour palette? NSLog(@"Need to define colour map for images with %d bits", bitsPerPixel); //bitmap->bmiColors; //fuColorUse = DIB_RGB_COLORS; } else { NSLog(@"Unsure how to handle images with %d bpp %d spp", bitsPerPixel, samplesPerPixel); } free(bitmap); DeleteObject(hbitmap); return NULL; } if (!SetDIBits(hDC, hbitmap, 0, pixelsHigh, bits, bitmap, fuColorUse)) { NSLog(@"SetDIBits failed. Error %d", GetLastError()); DeleteObject(hbitmap); hbitmap = NULL; } if (bits != data[0]) { /* cast bits to Void Pointer to fix warning in compile */ free((void *)(bits)); } free(bitmap); return hbitmap; } // NOTE: Draws the image with the GDI top left coordinate origin rather than // the AppKit bottom left coordinate origin. Hence drawing from an image cache // window into an AppKit base coordinate space results in an upside down image. // Ideally we should draw image in their cache windows with the AppKit base // coordinates to prevent extra flip transforms to be required later on (see // drawGState:fromRect:toPoint:op:fraction). // For some unknown reason, invoking -setUpAppKitBaseCoordinatesForHDC: in // -DPSimage: can cause images to be drawn with a 1px horizontal line cut at // the top. That's why -DPSimage we still use the GDI top left coordinates. - (void)DPSimage: (NSAffineTransform*) matrix : (NSInteger) pixelsWide : (NSInteger) pixelsHigh : (NSInteger) bitsPerSample : (NSInteger) samplesPerPixel : (NSInteger) bitsPerPixel : (NSInteger) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data { NSAffineTransform *old_ctm = nil; HDC hDC; HBITMAP hbitmap; HGDIOBJ old; HDC hDC2; POINT pa[3]; /* NSDebugLLog(@"WIN32GState", @"DPSImage : pixelsWide = %d : pixelsHigh = %d" ": bitsPerSample = %d : samplesPerPixel = %d" ": bitsPerPixel = %d : bytesPerRow = %d " ": isPlanar = %d" ": hasAlpha = %d : colorSpaceName = %@", pixelsWide, pixelsHigh, bitsPerSample, samplesPerPixel, bitsPerPixel, bytesPerRow, isPlanar, hasAlpha, colorSpaceName); */ if (window == NULL) { NSLog(@"No window in DPSImage"); return; } hDC = GetDC((HWND)window); if (!hDC) { NSLog(@"No DC for window %d in DPSImage. Error %d", (int)window, GetLastError()); return; } hbitmap = GSCreateBitmap(hDC, pixelsWide, pixelsHigh, bitsPerSample, samplesPerPixel, bitsPerPixel, bytesPerRow, isPlanar, hasAlpha, colorSpaceName, data); if (!hbitmap) { NSLog(@"Created bitmap failed %d", GetLastError()); ReleaseDC((HWND)window, hDC); return; } hDC2 = CreateCompatibleDC(hDC); if (!hDC2) { NSLog(@"No Compatible DC for window %d in DPSImage. Error %d", (int)window, GetLastError()); DeleteObject(hbitmap); ReleaseDC((HWND)window, hDC); return; } old = SelectObject(hDC2, hbitmap); if (!old) { NSLog(@"SelectObject failed for window %d in DPSImage. Error %d", (int)window, GetLastError()); DeleteDC(hDC2); DeleteObject(hbitmap); ReleaseDC((HWND)window, hDC); return; } //SetMapMode(hDC2, GetMapMode(hDC)); ReleaseDC((HWND)window, hDC); hDC = [self getHDC]; // Apply the additional transformation if (matrix) { old_ctm = [ctm copy]; [ctm prependTransform: matrix]; } pa[0] = GSViewPointToWin(self, NSMakePoint(0, pixelsHigh)); pa[1] = GSViewPointToWin(self, NSMakePoint(pixelsWide, pixelsHigh)); pa[2] = GSViewPointToWin(self, NSMakePoint(0, 0)); /*if (viewIsFlipped) { pa[0].y += pixelsHigh; pa[1].y += pixelsHigh; pa[2].y += pixelsHigh; }*/ if (old_ctm != nil) { RELEASE(ctm); // old_ctm is already retained ctm = old_ctm; } if ((GetDeviceCaps(hDC, RASTERCAPS) & RC_BITBLT)) { SetStretchBltMode(hDC, COLORONCOLOR); if (!PlgBlt(hDC, pa, hDC2, 0, 0, pixelsWide, pixelsHigh, 0, 0, 0)) { NSLog(@"Copy bitmap failed %d", GetLastError()); NSLog(@"DPSimage with %d %d %d %d to %d, %d", pixelsWide, pixelsHigh, bytesPerRow, bitsPerPixel, pa[0].x, pa[0].y); } } [self releaseHDC: hDC]; SelectObject(hDC2, old); DeleteDC(hDC2); DeleteObject(hbitmap); } @end @implementation WIN32GState (PathOps) - (void) _paintPath: (ctxt_object_t) drawType { unsigned count; HDC hDC; hDC = [self getHDC]; if (!hDC) { return; } count = [path elementCount]; if (count) { NSBezierPathElement type; NSPoint points[3]; unsigned j, i = 0; POINT p; BeginPath(hDC); for (j = 0; j < count; j++) { type = [path elementAtIndex: j associatedPoints: points]; switch(type) { case NSMoveToBezierPathElement: p = GSWindowPointToMS(self, points[0]); MoveToEx(hDC, p.x, p.y, NULL); break; case NSLineToBezierPathElement: p = GSWindowPointToMS(self, points[0]); // FIXME This gives one pixel too few LineTo(hDC, p.x, p.y); break; case NSCurveToBezierPathElement: { POINT bp[3]; for (i = 0; i < 3; i++) { bp[i] = GSWindowPointToMS(self, points[i]); } PolyBezierTo(hDC, bp, 3); } break; case NSClosePathBezierPathElement: CloseFigure(hDC); break; default: break; } } EndPath(hDC); // Now operate on the path switch (drawType) { case path_stroke: if (strokeColor.field[AINDEX] != 0.0) { StrokePath(hDC); } break; case path_eofill: if (fillColor.field[AINDEX] != 0.0) { SetPolyFillMode(hDC, ALTERNATE); FillPath(hDC); } break; case path_fill: if (fillColor.field[AINDEX] != 0.0) { SetPolyFillMode(hDC, WINDING); FillPath(hDC); } break; case path_eoclip: { HRGN region; SetPolyFillMode(hDC, ALTERNATE); region = PathToRegion(hDC); if (clipRegion) { CombineRgn(clipRegion, clipRegion, region, RGN_AND); DeleteObject(region); } else { clipRegion = region; } break; } case path_clip: { HRGN region; SetPolyFillMode(hDC, WINDING); region = PathToRegion(hDC); if (clipRegion) { CombineRgn(clipRegion, clipRegion, region, RGN_AND); DeleteObject(region); } else { clipRegion = region; } break; } default: break; } } [self releaseHDC: hDC]; /* * clip does not delete the current path, so we only clear the path if the * operation was not a clipping operation. */ if ((drawType != path_clip) && (drawType != path_eoclip)) { [path removeAllPoints]; } } - (void)DPSclip { [self _paintPath: path_clip]; } - (void)DPSeoclip { [self _paintPath: path_eoclip]; } - (void)DPSeofill { if (pattern != nil) { [self eofillPath: path withPattern: pattern]; return; } [self _paintPath: path_eofill]; } - (void)DPSfill { if (pattern != nil) { [self fillPath: path withPattern: pattern]; return; } [self _paintPath: path_fill]; } - (void)DPSstroke { [self _paintPath: path_stroke]; } - (void) DPSinitclip { if (clipRegion) { DeleteObject(clipRegion); clipRegion = NULL; } } - (void)DPSshow: (const char *)s { NSPoint current = [path currentPoint]; POINT p; HDC hDC; hDC = [self getHDC]; if (!hDC) { return; } p = GSWindowPointToMS(self, current); [(WIN32FontInfo*)font draw: s length: strlen(s) onDC: hDC at: p]; [self releaseHDC: hDC]; } - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { // FIXME: Currently advances is ignored NSPoint current = [path currentPoint]; POINT p; HDC hDC; hDC = [self getHDC]; if (!hDC) { return; } p = GSWindowPointToMS(self, current); [(WIN32FontInfo*)font drawGlyphs: glyphs length: length onDC: hDC at: p]; [self releaseHDC: hDC]; } @end @implementation WIN32GState (GStateOps) - (void)DPSinitgraphics { [super DPSinitgraphics]; } - (void) DPSsetdash: (const CGFloat*)thePattern : (NSInteger)count : (CGFloat)phase { if (!path) { path = [NSBezierPath new]; } // FIXME: Convert to ctm first [path setLineDash: thePattern count: count phase: phase]; } - (void)DPScurrentmiterlimit: (CGFloat *)limit { *limit = miterlimit; } - (void)DPSsetmiterlimit: (CGFloat)limit { // FIXME: Convert to ctm first miterlimit = limit; } - (void)DPScurrentlinecap: (int *)linecap { *linecap = lineCap; } - (void)DPSsetlinecap: (int)linecap { lineCap = linecap; } - (void)DPScurrentlinejoin: (int *)linejoin { *linejoin = joinStyle; } - (void)DPSsetlinejoin: (int)linejoin { joinStyle = linejoin; } - (void)DPScurrentlinewidth: (CGFloat *)width { *width = lineWidth; } - (void)DPSsetlinewidth: (CGFloat)width { // FIXME: Convert to ctm first lineWidth = width; } - (void)DPScurrentstrokeadjust: (int *)b { } - (void)DPSsetstrokeadjust: (int)b { } @end @implementation WIN32GState (WinOps) - (void) setStyle: (HDC)hDC { HPEN pen; HBRUSH brush; LOGBRUSH br; int join; int cap; DWORD penStyle; // Temporary variables for gathering pen information DWORD* iPattern = NULL; NSInteger patternCount = 0; SetBkMode(hDC, TRANSPARENT); br.lbStyle = BS_SOLID; br.lbColor = wfcolor; br.lbHatch = 0; /* brush = CreateBrushIndirect(&br); */ brush = CreateSolidBrush(wfcolor); oldBrush = SelectObject(hDC, brush); switch (joinStyle) { case NSBevelLineJoinStyle: join = PS_JOIN_BEVEL; break; case NSMiterLineJoinStyle: join = PS_JOIN_MITER; break; case NSRoundLineJoinStyle: join = PS_JOIN_ROUND; break; default: join = PS_JOIN_MITER; break; } switch (lineCap) { case NSButtLineCapStyle: cap = PS_ENDCAP_FLAT; break; case NSSquareLineCapStyle: cap = PS_ENDCAP_SQUARE; break; case NSRoundLineCapStyle: cap = PS_ENDCAP_ROUND; break; default: cap = PS_ENDCAP_SQUARE; break; } // Get the size of the pen line dash [path getLineDash: NULL count: &patternCount phase: NULL]; if (patternCount > 0) { NSInteger i = 0; CGFloat* thePattern[patternCount]; CGFloat phase = 0.0; penStyle = PS_GEOMETRIC | PS_USERSTYLE; // The user has defined a dash pattern for stroking on // the path. Note that we lose the floating point information // here, as windows only supports DWORD elements, not float. [path getLineDash: thePattern count: &patternCount phase: &phase]; iPattern = malloc(sizeof(DWORD) * patternCount); for (i = 0 ; i < patternCount; i ++) { iPattern[i] = (DWORD)thePattern[i]; } } else { penStyle = PS_GEOMETRIC | PS_SOLID; } pen = ExtCreatePen(penStyle | join | cap, lineWidth, &br, patternCount, iPattern); if (iPattern) { free(iPattern); iPattern = NULL; } oldPen = SelectObject(hDC, pen); SetMiterLimit(hDC, miterlimit, NULL); SetTextColor(hDC, wfcolor); oldClipRegion = CreateRectRgn(0, 0, 1, 1); if (1 != GetClipRgn(hDC, oldClipRegion)) { DeleteObject(oldClipRegion); oldClipRegion = NULL; } SelectClipRgn(hDC, clipRegion); } - (void) restoreStyle: (HDC)hDC { HGDIOBJ old; SelectClipRgn(hDC, oldClipRegion); DeleteObject(oldClipRegion); oldClipRegion = NULL; old = SelectObject(hDC, oldBrush); DeleteObject(old); old = SelectObject(hDC, oldPen); DeleteObject(old); } - (HDC) getHDC { WIN_INTERN *win; HDC hDC; if (NULL == window) { //NSLog(@"No window in getHDC"); return NULL; } win = (WIN_INTERN *)GetWindowLongPtr((HWND)window, GWLP_USERDATA); if (win && win->useHDC) { hDC = win->hdc; //NSLog(@"getHDC found DC %d", hDC); } else { hDC = GetDC((HWND)window); //NSLog(@"getHDC using window DC %d", hDC); } if (!hDC) { //NSLog(@"No DC in getHDC"); return NULL; } [self setStyle: hDC]; return hDC; } - (void) releaseHDC: (HDC)hDC { WIN_INTERN *win; if (NULL == window || NULL == hDC) { return; } [self restoreStyle: hDC]; win = (WIN_INTERN *)GetWindowLongPtr((HWND)window, GWLP_USERDATA); if (win && !win->useHDC) ReleaseDC((HWND)window, hDC); } @end @implementation WIN32GState (PatternColor) - (void *) saveClip { if (clipRegion) { HRGN newClipRegion; newClipRegion = CreateRectRgn(0, 0, 1, 1); CombineRgn(newClipRegion, clipRegion, NULL, RGN_COPY); return newClipRegion; } return clipRegion; } - (void) restoreClip: (void *)savedClip { if (clipRegion) { DeleteObject(clipRegion); } clipRegion = savedClip; } @end @implementation WIN32GState (ReadRect) - (NSDictionary *) GSReadRect: (NSRect)r { NSMutableDictionary *dict; NSAffineTransform *matrix; double x, y; NSMutableData *data; unsigned char *cdata; unsigned char *bits; int i = 0; HDC hDC; HDC hdcMemDC = NULL; HBITMAP hbitmap = NULL; BITMAP bmpCopied; HGDIOBJ old; RECT rcClient; DWORD dwBmpSize; HANDLE hDIB; LPBITMAPV4HEADER lpbi; if (window == NULL) { NSLog(@"No window in GSReadRect"); return nil; } r = [ctm rectInMatrixSpace: r]; x = NSWidth(r); y = NSHeight(r); dict = [NSMutableDictionary dictionary]; [dict setObject: NSDeviceRGBColorSpace forKey: @"ColorSpace"]; [dict setObject: [NSNumber numberWithUnsignedInt: 8] forKey: @"BitsPerSample"]; [dict setObject: [NSNumber numberWithUnsignedInt: 32] forKey: @"Depth"]; [dict setObject: [NSNumber numberWithUnsignedInt: 4] forKey: @"SamplesPerPixel"]; [dict setObject: [NSNumber numberWithUnsignedInt: 1] forKey: @"HasAlpha"]; matrix = [self GSCurrentCTM]; [matrix translateXBy: -r.origin.x - offset.x yBy: r.origin.y + NSHeight(r) - offset.y]; [dict setObject: matrix forKey: @"Matrix"]; hDC = GetDC((HWND)window); if (!hDC) { NSLog(@"No DC for window %d in GSReadRect. Error %d", (int)window, GetLastError()); return nil; } // Create a compatible DC which is used in a BitBlt from the window DC hdcMemDC = CreateCompatibleDC(hDC); if (!hdcMemDC) { NSLog(@"No Compatible DC for window %d in GSReadRect. Error %d", (int)window, GetLastError()); ReleaseDC((HWND)window, hDC); return nil; } ReleaseDC((HWND)window, hDC); hDC = [self getHDC]; // Get the client area for size calculation rcClient = GSWindowRectToMS(self, r); // Create a compatible bitmap from the Window DC hbitmap = CreateCompatibleBitmap(hDC, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top); if (!hbitmap) { NSLog(@"No Compatible bitmap for window %d in GSReadRect. Error %d", (int)window, GetLastError()); ReleaseDC((HWND)window, hdcMemDC); [self releaseHDC: hDC]; return nil; } // Select the compatible bitmap into the compatible memory DC. old = SelectObject(hdcMemDC, hbitmap); if (!old) { NSLog(@"SelectObject failed for window %d in GSReadRect. Error %d", (int)window, GetLastError()); DeleteObject(hbitmap); ReleaseDC((HWND)window, hdcMemDC); [self releaseHDC: hDC]; return nil; } // Bit block transfer into our compatible memory DC. if (!BitBlt(hdcMemDC, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hDC, 0, 0, SRCCOPY)) { NSLog(@"BitBlt failed for window %d in GSReadRect. Error %d", (int)window, GetLastError()); DeleteObject(hbitmap); ReleaseDC((HWND)window, hdcMemDC); [self releaseHDC: hDC]; return nil; } // Get the BITMAP from the HBITMAP GetObject(hbitmap, sizeof(BITMAP), &bmpCopied); dwBmpSize = bmpCopied.bmWidth * 4 * bmpCopied.bmHeight; hDIB = GlobalAlloc(GHND, dwBmpSize + sizeof(BITMAPV4HEADER)); lpbi = (LPBITMAPV4HEADER)GlobalLock(hDIB); lpbi->bV4Size = sizeof(BITMAPV4HEADER); lpbi->bV4V4Compression = BI_BITFIELDS; lpbi->bV4BlueMask = 0x000000FF; lpbi->bV4GreenMask = 0x0000FF00; lpbi->bV4RedMask = 0x00FF0000; lpbi->bV4AlphaMask = 0xFF000000; lpbi->bV4Width = bmpCopied.bmWidth; lpbi->bV4Height = bmpCopied.bmHeight; lpbi->bV4Planes = 1; lpbi->bV4BitCount = 32; lpbi->bV4SizeImage = 0; lpbi->bV4XPelsPerMeter = 0; lpbi->bV4YPelsPerMeter = 0; lpbi->bV4ClrUsed = 0; lpbi->bV4ClrImportant = 0; bits = (unsigned char *)lpbi + sizeof(BITMAPV4HEADER); // Gets the "bits" from the bitmap and copies them into a buffer // which is pointed to by lpbi if (GetDIBits(hdcMemDC, hbitmap, 0, (UINT)bmpCopied.bmHeight, bits, (LPBITMAPINFO)lpbi, DIB_RGB_COLORS) == 0) { NSLog(@"GetDIBits failed for window %d in GSReadRect. Error %d", (int)window, GetLastError()); GlobalUnlock(hDIB); GlobalFree(hDIB); DeleteObject(hbitmap); ReleaseDC((HWND)window, hdcMemDC); [self releaseHDC: hDC]; return nil; } data = [NSMutableData dataWithLength: dwBmpSize]; if (data == nil) { GlobalUnlock(hDIB); GlobalFree(hDIB); DeleteObject(hbitmap); ReleaseDC((HWND)window, hdcMemDC); [self releaseHDC: hDC]; return nil; } // Copy to data cdata = [data mutableBytes]; while (i < dwBmpSize) { cdata[i+0] = bits[i+2]; cdata[i+1] = bits[i+1]; cdata[i+2] = bits[i+0]; cdata[i+3] = bits[i+3]; i += 4; } //Unlock and Free the DIB from the heap GlobalUnlock(hDIB); GlobalFree(hDIB); //Clean up DeleteObject(hbitmap); ReleaseDC((HWND)window, hdcMemDC); [self releaseHDC: hDC]; [dict setObject: [NSValue valueWithSize: NSMakeSize(bmpCopied.bmWidth, bmpCopied.bmHeight)] forKey: @"Size"]; [dict setObject: data forKey: @"Data"]; return dict; } @end gnustep-back-0.29.0/Source/x11/000077500000000000000000000000001404163720200160355ustar00rootroot00000000000000gnustep-back-0.29.0/Source/x11/.cvsignore000066400000000000000000000000171404163720200200330ustar00rootroot00000000000000Resources *obj gnustep-back-0.29.0/Source/x11/GNUmakefile000066400000000000000000000032041404163720200201060ustar00rootroot00000000000000# # Main makefile for GNUstep Backend x11 # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make # The library to be compiled, as a library or as a bundle SUBPROJECT_NAME=x11 # The C source files to be compiled ifeq ($(WITH_WRASTER),yes) x11_C_FILES = \ xdnd.c else x11_C_FILES = \ context.c \ convert.c \ raster.c \ scale.c \ xdnd.c \ xutil.c endif # The Objective-C source files to be compiled x11_OBJC_FILES = \ XGServer.m \ XGServerEvent.m \ XGServerWindow.m \ XGDragView.m \ XIMInputServer.m \ XWindowBuffer.m\ XGGLFormat.m\ XGGLContext.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/x11/GNUmakefile.preamble000066400000000000000000000031251404163720200216760ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS = # Additional library directories the linker should search ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/x11/XGDragView.m000066400000000000000000000310361404163720200201650ustar00rootroot00000000000000/* XGDragView - Drag and Drop code for X11 backends. Copyright (C) 1998-2010 Free Software Foundation, Inc. Created by: Wim Oudshoorn Date: Nov 2001 Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include "x11/XGServer.h" #include "x11/XGServerWindow.h" #include "x11/XGDragView.h" /* Size of the dragged window */ #define DWZ 48 #define XDPY [XGServer xDisplay] #define SLIDE_TIME_STEP .02 /* in seconds */ #define SLIDE_NR_OF_STEPS 20 #define DRAGWINDEV [XGServer _windowWithTag: [_window windowNumber]] #define XX(P) (P.x) #define XY(P) ([(XGServer *)GSCurrentServer() xScreenSize].height - P.y) @interface XGRawWindow : NSWindow @end @interface NSCursor (BackendPrivate) - (void *)_cid; - (void) _setCid: (void *)val; @end // --- DRAG AND DROP SUPPORT (XDND) ----------------------------------- /* * This will get initialized when we declare a window that will * accept dragging or if we start a dragging ourself. Up to than * even the dragging messages are not defined. */ static DndClass dnd; static BOOL xDndInitialized = NO; void GSEnsureDndIsInitialized (void) { if (xDndInitialized == NO) { xDndInitialized = YES; xdnd_init (&dnd, XDPY); } } DndClass xdnd (void) { return dnd; // FIX ME rename with private desig } Atom GSActionForDragOperation(unsigned int op) { Atom xaction; if (op == NSDragOperationEvery) xaction = dnd.XdndActionAsk; else if (op == NSDragOperationAll) xaction = dnd.XdndActionAsk; else if (op & NSDragOperationCopy) xaction = dnd.XdndActionCopy; else if (op & NSDragOperationLink) xaction = dnd.XdndActionLink; else if (op & NSDragOperationGeneric) xaction = dnd.XdndActionCopy; else if (op & NSDragOperationPrivate) xaction = dnd.XdndActionPrivate; else if (op & NSDragOperationMove) xaction = dnd.XdndActionMove; else xaction = None; return xaction; } NSDragOperation GSDragOperationForAction(Atom xaction) { NSDragOperation action; if (xaction == dnd.XdndActionCopy) action = NSDragOperationCopy; else if (xaction == dnd.XdndActionMove) action = NSDragOperationMove; else if (xaction == dnd.XdndActionLink) action = NSDragOperationLink; else if (xaction == dnd.XdndActionAsk) action = NSDragOperationEvery; else if (xaction == dnd.XdndActionPrivate) action = NSDragOperationPrivate; else action = NSDragOperationNone; return action; } // The result of this function must be freed by the caller static inline Atom * mimeTypeForPasteboardType(Display *xDisplay, NSZone *zone, NSArray *types) { Atom *typelist; int count = [types count]; int i; typelist = NSZoneMalloc(zone, (count+1) * sizeof(Atom)); for (i = 0; i < count; i++) { NSString *mime; mime = [types objectAtIndex: i]; mime = [NSPasteboard mimeTypeForPasteboardType: mime]; typelist[i] = XInternAtom(xDisplay, [mime cString], False); } typelist[count] = 0; return typelist; } @implementation XGDragView static XGDragView *sharedDragView = nil; + (id) sharedDragView { if (sharedDragView == nil) { GSEnsureDndIsInitialized (); sharedDragView = [XGDragView new]; } return sharedDragView; } + (Class) windowClass { return [XGRawWindow class]; } /* * External drag operation */ - (void) setupDragInfoFromXEvent: (XEvent *)xEvent { // Start a dragging session from another application dragSource = nil; destExternal = YES; operationMask = NSDragOperationAll; ASSIGN(dragPasteboard, [NSPasteboard pasteboardWithName: NSDragPboard]); } - (void) updateDragInfoFromEvent: (NSEvent*)event { // Store the drag info, so that we can send status messages as response destWindow = [event window]; dragPoint = [event locationInWindow]; dragSequence = [event timestamp]; dragMask = [event data2]; } - (void) resetDragInfo { DESTROY(dragPasteboard); } /* * Local drag operation */ - (void) dragImage: (NSImage*)anImage at: (NSPoint)screenLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag { typelist = mimeTypeForPasteboardType (XDPY, [self zone], [pboard types]); [super dragImage: anImage at: screenLocation offset: initialOffset event: event pasteboard: pboard source: sourceObject slideBack: slideFlag]; NSZoneFree([self zone], typelist); typelist = NULL; } - (void) postDragEvent: (NSEvent *)theEvent { if (destExternal) { gswindow_device_t *window; window = [XGServer _windowWithTag: [theEvent windowNumber]]; if ([theEvent subtype] == GSAppKitDraggingStatus) { NSDragOperation action = [theEvent data2]; Atom xaction; xaction = GSActionForDragOperation(action); xdnd_send_status(&dnd, [theEvent data1], window->ident, (action != NSDragOperationNone), 0, 0, 0, 0, 0, xaction); } else if ([theEvent subtype] == GSAppKitDraggingFinished) { xdnd_send_finished(&dnd, [theEvent data1], window->ident, 0); } } else { [super postDragEvent: theEvent]; } } - (void) sendExternalEvent: (GSAppKitSubtype)subtype action: (NSDragOperation)action position: (NSPoint)eventLocation timestamp: (NSTimeInterval)time toWindow: (int)dWindowNumber { gswindow_device_t *dragWindev = DRAGWINDEV; switch (subtype) { case GSAppKitDraggingDrop: if (targetWindowRef == dragWindev->root) { // FIXME There is an xdnd extension for root drop } xdnd_send_drop(&dnd, dWindowNumber, dragWindev->ident, time * 1000); break; case GSAppKitDraggingUpdate: xdnd_send_position(&dnd, dWindowNumber, dragWindev->ident, GSActionForDragOperation(dragMask & operationMask), XX(newPosition), XY(newPosition), time * 1000); break; case GSAppKitDraggingEnter: // FIXME: The first two lines need only be called once for every drag operation. // They should be moved to a different method. xdnd_set_selection_owner(&dnd, dragWindev->ident, typelist[0]); xdnd_set_type_list(&dnd, dragWindev->ident, typelist); xdnd_send_enter(&dnd, dWindowNumber, dragWindev->ident, typelist); xdnd_send_position(&dnd, dWindowNumber, dragWindev->ident, GSActionForDragOperation (dragMask & operationMask), XX(dragPosition), XY(dragPosition), time * 1000); break; case GSAppKitDraggingExit: xdnd_send_leave(&dnd, dWindowNumber, dragWindev->ident); break; default: break; } } - (NSWindow*) windowAcceptingDnDunder: (NSPoint)p windowRef: (int*)mouseWindowRef { gswindow_device_t *dwindev; *mouseWindowRef = [self _xWindowAcceptingDnDunderX: XX(p) Y: XY(p)]; dwindev = [XGServer _windowForXWindow: *mouseWindowRef]; if (dwindev != 0) { return GSWindowWithNumber(dwindev->number); } else { return nil; } } /* Search all descendents of parent and return X window containing screen coordinates (x,y) that accepts drag and drop. -1 if we can only find the X window that we are dragging None if there is no X window that accepts drag and drop. */ - (Window) _xWindowAcceptingDnDDescendentOf: (Window) parent ignoring: (Window) ident underX: (int) x Y: (int) y { Window *children; unsigned int nchildren; Window result = None; Window ignore, child2, root; Display *display = XDPY; XWindowAttributes attr; int ret_x, ret_y; if (parent == ident) return -1; XQueryTree(display, parent, &root, &ignore, &children, &nchildren); while (nchildren-- > 0) { Window child = children [nchildren]; if (XGetWindowAttributes (display, child, &attr) && attr.map_state == IsViewable && XTranslateCoordinates (display, root, child, x, y, &ret_x, &ret_y, &child2) && ret_x >= 0 && ret_x < attr.width && ret_y >= 0 && ret_y < attr.height) { result = [self _xWindowAcceptingDnDDescendentOf: child ignoring: ident underX: x Y: y]; // With window decoration there may be multiple windows // at the same place. Try all of them. if ((result != (Window)-1) && (result != (Window) None)) { break; } } } if (children) { XFree (children); } if (result == (Window) None) { if (xdnd_is_dnd_aware (&dnd, parent, &dnd.dragging_version, typelist)) { result = parent; } } return result; } /* Return window under the mouse that accepts drag and drop */ - (Window) _xWindowAcceptingDnDunderX: (int) x Y: (int) y { Window result; gswindow_device_t *dragWindev = DRAGWINDEV; result = [self _xWindowAcceptingDnDDescendentOf: dragWindev->root ignoring: dragWindev->ident underX: x Y: y]; if (result == (Window)-1) return None; else return result; } @end @interface XGServer (DragAndDrop) - (void) _resetDragTypesForWindow: (NSWindow *)win; @end @implementation XGServer (DragAndDrop) - (void) _resetDragTypesForWindow: (NSWindow *)win { int winNum; Atom *typelist; gswindow_device_t *window; NSCountedSet *drag_set = [self dragTypesForWindow: win]; winNum = [win windowNumber]; window = [[self class] _windowWithTag: winNum]; GSEnsureDndIsInitialized (); typelist = mimeTypeForPasteboardType(XDPY, [self zone], [drag_set allObjects]); NSDebugLLog(@"NSDragging", @"Set types on %lu to %@", window->ident, drag_set); xdnd_set_dnd_aware(&dnd, window->ident, typelist); NSZoneFree([self zone], typelist); } - (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win { BOOL did_add; int winNum; did_add = [super addDragTypes: types toWindow: win]; /* Check if window device exists */ winNum = [win windowNumber]; if (winNum > 0 && did_add == YES) { [self _resetDragTypesForWindow: win]; } return did_add; } - (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win { BOOL did_change; int winNum; did_change = [super removeDragTypes: types fromWindow: win]; /* Check if window device exists. */ winNum = [win windowNumber]; if (winNum > 0 && did_change == YES) { [self _resetDragTypesForWindow: win]; } return did_change; } @end @implementation XGRawWindow - (BOOL) canBecomeMainWindow { return NO; } - (BOOL) canBecomeKeyWindow { return NO; } - (void) _initDefaults { [super _initDefaults]; [self setReleasedWhenClosed: NO]; [self setExcludedFromWindowsMenu: YES]; } - (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (NSInteger)otherWin { XSetWindowAttributes winattrs; unsigned long valuemask; gswindow_device_t *window; [super orderWindow: place relativeTo: otherWin]; window = [XGServer _windowWithTag: _windowNum]; valuemask = (CWSaveUnder|CWOverrideRedirect); winattrs.save_under = True; /* Temporarily make this False? we don't handle it correctly (fedor) */ winattrs.override_redirect = False; XChangeWindowAttributes (XDPY, window->ident, valuemask, &winattrs); [self setLevel: NSPopUpMenuWindowLevel]; } @end gnustep-back-0.29.0/Source/x11/XGGLContext.m000066400000000000000000000305641404163720200203310ustar00rootroot00000000000000/* -*- mode:ObjC -*- XGGLContext - backend implementation of NSOpenGLContext Copyright (C) 1998,2002 Free Software Foundation, Inc. Written by: Frederic De Jaeger Date: Nov 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #ifdef HAVE_GLX #include #include #include #include #include #include #include "x11/XGServerWindow.h" #include "x11/XGOpenGL.h" #include //FIXME //should I store the display ? #define MAKE_DISPLAY(dpy) Display *dpy;\ dpy = [(XGServer *)GSCurrentServer() xDisplay];\ NSAssert(dpy != NULL, NSInternalInconsistencyException) @interface XGXSubWindow : NSObject { @public Window xwindowid; NSView *attached; } + subwindowOnView:(NSView *)view visualinfo:(XVisualInfo *)xVisualInfo; - (void) update; @end @implementation XGXSubWindow //We assume that the current context is the same and is an XGServer - initWithView: (NSView *)view visualinfo: (XVisualInfo *)xVisualInfo { NSRect rect; gswindow_device_t *win_info; XGServer *server; NSWindow *window; int x, y, width, height; int mask; XSetWindowAttributes window_attributes; self = [super init]; if (!self) { return nil; } window = [view window]; NSAssert(window, @"Request of an X window attachment on a view that is not\ on a NSWindow"); if ([view isRotatedOrScaledFromBase]) { [NSException raise: NSInvalidArgumentException format: @"Cannot attach an Xwindow to a view that is\ rotated or scaled"]; } server = (XGServer *)GSServerForWindow(window); NSAssert(server != nil, NSInternalInconsistencyException); NSAssert([server isKindOfClass: [XGServer class]], NSInternalInconsistencyException); win_info = [XGServer _windowWithTag: [window windowNumber]]; NSAssert(win_info, NSInternalInconsistencyException); if ([server handlesWindowDecorations] == YES) { /* The window manager handles window decorations, so the * the parent X window is equal to the content view and * we must therefore use content view coordinates. */ rect = [view convertRect: [view bounds] toView: [window contentView]]; if ([[window contentView] isFlipped]) { rect.origin.y = NSHeight([[window contentView] frame]) - (rect.size.height + rect.origin.y); } } else { /* The GUI library handles window decorations, so the * the parent X window is equal to the NSWindow frame * and we can use window base coordinates. */ rect = [view convertRect: [view bounds] toView: nil]; } x = NSMinX(rect); y = NSHeight(win_info->xframe) - NSMaxY(rect); width = NSWidth(rect); height = NSHeight(rect); window_attributes.border_pixel = 0; window_attributes.background_pixel = 0; window_attributes.colormap = XCreateColormap(win_info->display, win_info->ident, xVisualInfo->visual, AllocNone); window_attributes.event_mask = StructureNotifyMask | VisibilityChangeMask | ExposureMask; mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; xwindowid = XCreateWindow(win_info->display, win_info->ident, x, y, width, height, 0, xVisualInfo->depth, InputOutput, xVisualInfo->visual, mask, &window_attributes); XMapWindow(win_info->display, xwindowid); attached = view; return self; } - (void) map { MAKE_DISPLAY(dpy); XMapWindow(dpy, xwindowid); } - (void) detach { //FIXME //I assume that the current server is correct. MAKE_DISPLAY(dpy); attached = nil; XDestroyWindow(dpy, xwindowid); } - (void) update { NSRect rect; gswindow_device_t *win_info; GSDisplayServer *server; NSWindow *win; int x, y, width, height; NSAssert(attached, NSInternalInconsistencyException); win = [attached window]; NSAssert1(win, @"%@'s window is nil now!", attached); NSAssert1(![attached isRotatedOrScaledFromBase], @"%@ is rotated or scaled, now!", attached); server = GSServerForWindow(win); NSAssert(server != nil, NSInternalInconsistencyException); NSAssert([server isKindOfClass: [XGServer class]], NSInternalInconsistencyException); //FIXME //we should check that the window hasn't changed, maybe. win_info = [XGServer _windowWithTag: [win windowNumber]]; NSAssert(win_info, NSInternalInconsistencyException); if ([server handlesWindowDecorations] == YES) { /* The window manager handles window decorations, so the * the parent X window is equal to the content view and * we must therefore use content view coordinates. */ rect = [attached convertRect: [attached bounds] toView: [[attached window] contentView]]; if ([[[attached window] contentView] isFlipped]) { rect.origin.y = NSHeight([[[attached window] contentView] frame]) - (rect.size.height + rect.origin.y); } } else { /* The GUI library handles window decorations, so the * the parent X window is equal to the NSWindow frame * and we can use window base coordinates. */ rect = [attached convertRect: [attached bounds] toView: nil]; } x = NSMinX(rect); y = NSHeight(win_info->xframe) - NSMaxY(rect); width = NSWidth(rect); height = NSHeight(rect); XMoveResizeWindow(win_info->display, xwindowid,x, y, width, height); } - (void) dealloc { NSDebugMLLog(@"GLX", @"Deallocating"); [self detach]; [super dealloc]; } + subwindowOnView:(NSView *)view visualinfo:(XVisualInfo *)xVisualInfo { XGXSubWindow *win = [[self alloc] initWithView: view visualinfo: xVisualInfo]; return AUTORELEASE(win); } @end //FIXME: //should be on per thread basis. static XGGLContext *currentGLContext; @implementation XGGLContext + (void)clearCurrentContext { MAKE_DISPLAY(dpy); if ([XGGLPixelFormat glxMinorVersion] >= 3) { if (!glXMakeContextCurrent(dpy, None, None, NULL)) { NSDebugMLLog(@"GLX", @"Cannot clear current GL context - Error %s", glGetString(glGetError())); } } else { if (!glXMakeCurrent(dpy, None, NULL)) { NSDebugMLLog(@"GLX", @"Can not clear current GL context - Error %s", glGetString(glGetError())); } } currentGLContext = nil; } + (NSOpenGLContext *)currentContext { return currentGLContext; } - (void) _detach { if (xSubWindow) { if (currentGLContext == self) { [XGGLContext clearCurrentContext]; } if ( glx_drawable != xSubWindow->xwindowid ) { MAKE_DISPLAY(dpy); glXDestroyWindow(dpy, glx_drawable); glx_drawable = None; } DESTROY(xSubWindow); } } - (GLXContext)glxcontext { return glx_context; } - (void *)CGLContextObj { // FIXME: Until we have a wrapper library // return the underlying context directly return (void*)glx_context; } - (void)clearDrawable { [self _detach]; } - (void)copyAttributesFromContext:(NSOpenGLContext *)context withMask:(unsigned long)mask { GLenum error; MAKE_DISPLAY(dpy); if (context == nil || ![context isKindOfClass: [XGGLContext class]]) { [NSException raise: NSInvalidArgumentException format: @"%@ is an invalid context", context]; } glXCopyContext(dpy, ((XGGLContext *)context)->glx_context, glx_context, mask); error = glGetError(); if (error != GL_NO_ERROR) { NSDebugMLLog(@"GLX", @"Cannot copy GL context %@ from context %@ - Error %s", self, context, glGetString(error)); } } - (void)createTexture:(unsigned long)target fromView:(NSView*)view internalFormat:(unsigned long)format { [self notImplemented: _cmd]; } - (int)currentVirtualScreen { [self notImplemented: _cmd]; return 0; } - (void)flushBuffer { MAKE_DISPLAY(dpy); glXSwapBuffers(dpy, glx_drawable); } - (void)getValues:(long *)vals forParameter:(NSOpenGLContextParameter)param { // TODO [self notImplemented: _cmd]; } - (id)initWithCGLContextObj: (void *)context { self = [super init]; if (!self) { return nil; } // FIXME: Need to set the pixelFormat ivar glx_context = context; return self; } - (id)initWithFormat: (NSOpenGLPixelFormat *)_format shareContext: (NSOpenGLContext *)share { self = [super init]; if (!self) { return nil; } glx_context = None; if (!_format || ![_format isKindOfClass: [XGGLPixelFormat class]]) { NSDebugMLLog(@"GLX", @"Invalid format %@", _format); RELEASE(self); return nil; } ASSIGN(pixelFormat, (XGGLPixelFormat *)_format); glx_context = [pixelFormat createGLXContext: (XGGLContext *)share]; return self; } - (void) dealloc { NSDebugMLLog(@"GLX", @"Deallocating"); [self _detach]; RELEASE(pixelFormat); if (glx_context != None) { MAKE_DISPLAY(dpy); glXDestroyContext(dpy, glx_context); } [super dealloc]; } - (void) makeCurrentContext { MAKE_DISPLAY(dpy); if (xSubWindow == nil) { [NSException raise: NSGenericException format: @"GL Context has no view attached, cannot be\ made current"]; } NSAssert(glx_context != None && glx_drawable != None, NSInternalInconsistencyException); if ([XGGLPixelFormat glxMinorVersion] >= 3) { if (!glXMakeContextCurrent(dpy, glx_drawable, glx_drawable, glx_context) ) { NSDebugMLLog(@"GLX", @"Cannot make GL context %@ current - Error %s", self, glGetString(glGetError())); } } else { if (!glXMakeCurrent(dpy, glx_drawable, glx_context) ) { NSDebugMLLog(@"GLX", @"Cannot make GL context %@ current - Error %s", self, glGetString(glGetError())); } } currentGLContext = self; } - (void)setCurrentVirtualScreen:(int)screen { [self notImplemented: _cmd]; } - (void)setFullScreen { [self notImplemented: _cmd]; } - (void)setOffScreen:(void *)baseaddr width:(long)width height:(long)height rowbytes:(long)rowbytes { [self notImplemented: _cmd]; } - (void)setValues:(const long *)vals forParameter:(NSOpenGLContextParameter)param { [self notImplemented: _cmd]; } - (void)setView:(NSView *)view { NSView *current_view; if (!view) { [NSException raise: NSInvalidArgumentException format: @"setView called with a nil value"]; } NSAssert(pixelFormat, NSInternalInconsistencyException); current_view = [self view]; if ( current_view != nil ) { [current_view _setIgnoresBacking: saved_ignores_backing]; } ASSIGN(xSubWindow, [XGXSubWindow subwindowOnView: view visualinfo: [pixelFormat visualinfo]]); glx_drawable = [pixelFormat drawableForWindow: xSubWindow->xwindowid]; saved_ignores_backing = [view _ignoresBacking]; [view _setIgnoresBacking: YES]; NSDebugMLLog(@"GLX", @"glx_window : %lu", (unsigned long) glx_drawable); } - (void)update { [xSubWindow update]; } - (NSView *)view { if (xSubWindow) { return xSubWindow->attached; } else { return nil; } } @end #endif gnustep-back-0.29.0/Source/x11/XGGLFormat.m000066400000000000000000000314601404163720200201310ustar00rootroot00000000000000/* -*- mode:ObjC -*- XGGLContext - backend implementation of NSOpenGLContext Copyright (C) 1998,2002 Free Software Foundation, Inc. Written by: Frederic De Jaeger Date: Nov 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #ifdef HAVE_GLX #include #include #include #include #include #include "x11/XGServer.h" #include "x11/XGOpenGL.h" #include #include #ifdef XRENDER #include #endif @implementation XGGLPixelFormat + (int) glxMinorVersion { static int cachedVersion = -1; if (cachedVersion == -1) { Display * display = [(XGServer *)GSCurrentServer() xDisplay]; NSDictionary * attributes = [GSCurrentServer() attributes]; NSString * sn = [attributes objectForKey: GSScreenNumber]; // This is due to some OpenGL drivers reporting a lower overall GLX version than they actually implement. NSString *glxServerVersion = [NSString stringWithFormat:@"%s", glXQueryServerString(display, [sn intValue], GLX_VERSION)]; NSString *glxClientVersion = [NSString stringWithFormat:@"%s", glXGetClientString(display, GLX_VERSION)]; float serverversion = [glxServerVersion floatValue]; float clientversion = [glxClientVersion floatValue]; float serverIntegerPart; float clientIntegerPart; float fracServer = modff(serverversion, &serverIntegerPart); float fracClient = modff(clientversion, &clientIntegerPart); if ( serverIntegerPart == 1.0f && clientIntegerPart == 1.0f ) { fracServer = rintf(fracServer * 10.0f); fracClient = rintf(fracClient * 10.0f); NSDebugMLLog(@"GLX", @"server %f client %f", fracServer, fracClient); cachedVersion = (int)MIN(fracServer, fracClient); } } return cachedVersion; } // Works for some attributes only - (void) getValues: (GLint *)vals forAttribute: (NSOpenGLPixelFormatAttribute)attrib forVirtualScreen: (GLint)screen { int error; NSAssert((fbconfig != NULL || visualinfo != NULL) && configurationCount > 0, NSInternalInconsistencyException); if (glxminorversion >= 3) { error = glXGetFBConfigAttrib(display, fbconfig[pickedFBConfig], attrib, vals); if ( error != 0 ) NSDebugMLLog( @"GLX", @"Can not get FB attribute for pixel format %@ - Error %u", self, error ); } else { error = glXGetConfig(display, visualinfo, attrib, vals); if ( error != 0 ) NSDebugMLLog( @"GLX", @"Can not get FB attribute for pixel format %@ - Error %u", self, error ); } } - (NSMutableData *) assembleGLXAttributes:(NSOpenGLPixelFormatAttribute *)pixelFormatAttributes { int AccumSize; NSOpenGLPixelFormatAttribute *ptr = pixelFormatAttributes; NSMutableData *data = [NSMutableData data]; shouldRequestARGBVisual = NO; #define append(a, b) \ do \ { \ int v1 = a; \ int v2 = b; \ [data appendBytes: &v1 length: sizeof(v1)]; \ [data appendBytes: &v2 length: sizeof(v2)]; \ } while (0) #define append1(a) \ do \ { \ int v1 = a; \ [data appendBytes: &v1 length: sizeof(v1)]; \ } while (0) GLint drawable_type = 0; if (glxminorversion < 3) { append1(GLX_RGBA); } else { append(GLX_RENDER_TYPE, GLX_RGBA_BIT); } while (*ptr) { switch(*ptr) { // it means all the same on GLX - there is no diffrent here case NSOpenGLPFASingleRenderer: case NSOpenGLPFAAllRenderers: case NSOpenGLPFAAccelerated: if (glxminorversion < 3) { append(GLX_USE_GL, YES); break; } case NSOpenGLPFADoubleBuffer: { append(GLX_DOUBLEBUFFER, YES); break; } case NSOpenGLPFAStereo: { append(GLX_STEREO, YES); break; } case NSOpenGLPFAAuxBuffers: { ptr++; append(GLX_AUX_BUFFERS, *ptr); break; } case NSOpenGLPFAColorSize: { ptr++; append(GLX_BUFFER_SIZE, *ptr); /* append(GLX_RED_SIZE, *ptr); append(GLX_GREEN_SIZE, *ptr); append(GLX_BLUE_SIZE, *ptr); */ break; } case NSOpenGLPFAAlphaSize: { ptr++; append(GLX_ALPHA_SIZE, *ptr); if (*ptr > 0) shouldRequestARGBVisual = YES; break; } case NSOpenGLPFADepthSize: { ptr++; append(GLX_DEPTH_SIZE, *ptr); break; } case NSOpenGLPFAStencilSize: { ptr++; append(GLX_STENCIL_SIZE, *ptr); break; } case NSOpenGLPFAAccumSize: { ptr++; AccumSize=*ptr; switch (AccumSize) { case 8: append(GLX_ACCUM_RED_SIZE, 3); append(GLX_ACCUM_GREEN_SIZE, 3); append(GLX_ACCUM_BLUE_SIZE, 2); append(GLX_ACCUM_ALPHA_SIZE, 0); break; case 15: case 16: append(GLX_ACCUM_RED_SIZE, 5); append(GLX_ACCUM_GREEN_SIZE, 5); append(GLX_ACCUM_BLUE_SIZE, 5); append(GLX_ACCUM_ALPHA_SIZE, 0); break; case 24: append(GLX_ACCUM_RED_SIZE, 8); append(GLX_ACCUM_GREEN_SIZE, 8); append(GLX_ACCUM_BLUE_SIZE, 8); append(GLX_ACCUM_ALPHA_SIZE, 0); break; case 32: append(GLX_ACCUM_RED_SIZE, 8); append(GLX_ACCUM_GREEN_SIZE, 8); append(GLX_ACCUM_BLUE_SIZE, 8); append(GLX_ACCUM_ALPHA_SIZE, 8); break; } break; } case NSOpenGLPFAWindow: { drawable_type |= GLX_WINDOW_BIT; break; } case NSOpenGLPFAPixelBuffer: { drawable_type |= GLX_PBUFFER_BIT; break; } case NSOpenGLPFAOffScreen: { drawable_type |= GLX_PIXMAP_BIT; break; } //can not be handled by X11 case NSOpenGLPFAMinimumPolicy: { break; } // can not be handled by X11 case NSOpenGLPFAMaximumPolicy: { break; } // Not supported, would be a lot of work to implement. case NSOpenGLPFAFullScreen: { break; } case NSOpenGLPFASampleBuffers: { #ifdef GLX_SAMPLE_BUFFERS if ( glxminorversion >= 4 ) { ptr++; append(GLX_SAMPLE_BUFFERS, *ptr); } #endif break; } case NSOpenGLPFASamples: { #ifdef GLX_SAMPLES if ( glxminorversion >= 4 ) { ptr++; append(GLX_SAMPLES, *ptr); } #endif break; } case NSOpenGLPFAAuxDepthStencil: case NSOpenGLPFARendererID: case NSOpenGLPFANoRecovery: case NSOpenGLPFAClosestPolicy: case NSOpenGLPFARobust: case NSOpenGLPFABackingStore: case NSOpenGLPFAMPSafe: case NSOpenGLPFAMultiScreen: case NSOpenGLPFACompliant: case NSOpenGLPFAScreenMask: case NSOpenGLPFAVirtualScreenCount: case NSOpenGLPFAAllowOfflineRenderers: case NSOpenGLPFAColorFloat: case NSOpenGLPFAMultisample: case NSOpenGLPFASupersample: case NSOpenGLPFASampleAlpha: break; } ptr++; } if ( drawable_type ) { append(GLX_DRAWABLE_TYPE, drawable_type); } append1(None); return data; #undef append #undef append1 } - (id)initWithAttributes:(NSOpenGLPixelFormatAttribute *)attribs { NSMutableData * glxAttributes; NSDictionary * dsattributes; self = [super init]; if (self == nil) { return nil; } fbconfig = NULL; visualinfo = NULL; display = [(XGServer *)GSCurrentServer() xDisplay]; NSAssert(display != NULL, NSInternalInconsistencyException); glxminorversion = [XGGLPixelFormat glxMinorVersion]; NSDebugMLLog(@"GLX", @"minor version %d", glxminorversion); glxAttributes = [self assembleGLXAttributes:attribs]; dsattributes = [GSCurrentServer() attributes]; if (glxminorversion >= 3) { fbconfig = glXChooseFBConfig(display, [[dsattributes objectForKey: GSScreenNumber] intValue], [glxAttributes mutableBytes], &configurationCount); #if defined(XRENDER) int i; for (i = 0; i < configurationCount; i++) { XVisualInfo * vinfo = glXGetVisualFromFBConfig(display, fbconfig[i]); XRenderPictFormat* pictFormat = XRenderFindVisualFormat (display, vinfo->visual); if ((NULL != pictFormat && (pictFormat->type == PictTypeDirect) && (pictFormat->direct.alphaMask)) || !shouldRequestARGBVisual) { pickedFBConfig = i; visualinfo = vinfo; break; } } #endif if (!visualinfo && configurationCount > 0) { visualinfo = glXGetVisualFromFBConfig(display,fbconfig[0]); pickedFBConfig = 0; } } else { visualinfo = glXChooseVisual(display, [[dsattributes objectForKey: GSScreenNumber] intValue], [glxAttributes mutableBytes]); } if (fbconfig == NULL && visualinfo == NULL) { NSDebugMLLog(@"GLX", @"no pixel format found matching what is required"); RELEASE(self); return nil; } else { NSDebugMLLog(@"GLX", @"We found %d pixel formats", configurationCount); return self; } } - (Display *) display { return display; } - (XVisualInfo *) visualinfo { return visualinfo; } - (GLXContext)createGLXContext: (XGGLContext *)share { GLXContext context; if (glxminorversion >= 3) { context = glXCreateNewContext(display, fbconfig[pickedFBConfig], GLX_RGBA_TYPE, [share glxcontext], YES); } else { context = glXCreateContext(display, visualinfo, [share glxcontext], GL_TRUE); } if ( context == NULL ) { NSDebugMLLog(@"GLX", @"Cannot create GL context for pixel format %@ - Error %s", self, glGetString(glGetError())); } return context; } - (GLXWindow) drawableForWindow: (Window)xwindowid { GLXWindow win; GLenum error; if (glxminorversion >= 3) { win = glXCreateWindow(display, fbconfig[pickedFBConfig], xwindowid, NULL); } else { win = xwindowid; } error = glGetError(); if ( error != GL_NO_ERROR ) { NSDebugMLLog(@"GLX", @"Cannot create GL window for pixel format %@ - Error %s", self, glGetString(error)); } return win; } - (void) dealloc { if (glxminorversion >= 3) { XFree(fbconfig); } XFree(visualinfo); NSDebugMLLog(@"GLX", @"deallocation"); [super dealloc]; } - (int)numberOfVirtualScreens { //FIXME return 1; } @end #endif gnustep-back-0.29.0/Source/x11/XGServer.m000066400000000000000000000575251404163720200177360ustar00rootroot00000000000000/* -*- mode:ObjC -*- XGServer - X11 Server Class Copyright (C) 1998-2015 Free Software Foundation, Inc. Written by: Adam Fedor Date: Mar 2002 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Terminate cleanly if we get a signal to do so */ static void terminate(int sig) { if (nil != NSApp) { [NSApp terminate: NSApp]; } else { exit(1); } } #ifdef HAVE_WRASTER_H #include "wraster.h" #else #include "x11/wraster.h" #endif #include "x11/XGServer.h" #include "x11/XGInputServer.h" #ifdef HAVE_GLX #include "x11/XGOpenGL.h" #endif #ifdef HAVE_XRANDR #include #endif #include #include #include extern int XGErrorHandler(Display *display, XErrorEvent *err); static NSString * _parse_display_name(NSString *name, int *dn, int *sn) { int d, s; NSString *host; NSArray *a; host = @""; d = s = 0; a = [name componentsSeparatedByString: @":"]; if (name == nil) { NSLog(@"X DISPLAY environment variable not set," @" assuming local X server (DISPLAY=:0.0)"); } else if ([name hasPrefix: @":"] == YES) { int bnum; bnum = sscanf([name cString], ":%d.%d", &d, &s); if (bnum == 1) s = 0; if (bnum < 1) d = 0; } else if ([a count] != 2) { NSLog(@"X DISPLAY environment variable has bad format," @" assuming local X server (DISPLAY=:0.0)"); } else { int bnum; NSString *dnum; host = [a objectAtIndex: 0]; dnum = [a lastObject]; bnum = sscanf([dnum cString], "%d.%d", &d, &s); if (bnum == 1) s = 0; if (bnum < 1) d = 0; } if (dn) *dn = d; if (sn) *sn = s; return host; } @interface XGServer (Window) - (void) _setupRootWindow; @end @interface XGServer (Private) - (void) setupRunLoopInputSourcesForMode: (NSString*)mode; @end @interface XGScreenContext : NSObject { RContext *rcontext; XGDrawMechanism drawMechanism; } - initForDisplay: (Display *)dpy screen: (int)screen_id; - (XGDrawMechanism) drawMechanism; - (RContext *) context; @end @implementation XGScreenContext - (RContextAttributes *) _getXDefaults { int dummy; RContextAttributes *attribs; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; attribs = (RContextAttributes *)malloc(sizeof(RContextAttributes)); attribs->flags = 0; if ([defaults boolForKey: @"NSDefaultVisual"]) attribs->flags |= RC_DefaultVisual; if ((dummy = [defaults integerForKey: @"NSDefaultVisual"])) { attribs->flags |= RC_VisualID; attribs->visualid = dummy; } if ((dummy = [defaults integerForKey: @"NSColorsPerChannel"])) { attribs->flags |= RC_ColorsPerChannel; attribs->colors_per_channel = dummy; } return attribs; } - initForDisplay: (Display *)dpy screen: (int)screen_id { RContextAttributes *attribs; XColor testColor; unsigned char r, g, b; /* Get the visual information */ attribs = NULL; //attribs = [self _getXDefaults]; rcontext = RCreateContext(dpy, screen_id, attribs); /* * If we have shared memory available, only use it when the XGPS-Shm * default is set to YES */ if (rcontext->attribs->use_shared_memory == True && [[NSUserDefaults standardUserDefaults] boolForKey: @"XGPS-Shm"] != YES) rcontext->attribs->use_shared_memory = False; /* * Crude tests to see if we can accelerate creation of pixels from * 8-bit red, green and blue color values. */ if (rcontext->depth == 12 || rcontext->depth == 16) { drawMechanism = XGDM_FAST16; r = 8; g = 9; b = 7; testColor.pixel = (((r << 5) + g) << 6) + b; XQueryColor(rcontext->dpy, rcontext->cmap, &testColor); if (((testColor.red >> 11) != r) || ((testColor.green >> 11) != g) || ((testColor.blue >> 11) != b)) { NSLog(@"WARNING - XGServer is unable to use the " @"fast algorithm for writing to a 16-bit display on " @"this host - perhaps you'd like to adjust the code " @"to work ... and submit a patch."); drawMechanism = XGDM_PORTABLE; } } else if (rcontext->depth == 15) { drawMechanism = XGDM_FAST15; r = 8; g = 9; b = 7; testColor.pixel = (((r << 5) + g) << 5) + b; XQueryColor(rcontext->dpy, rcontext->cmap, &testColor); if (((testColor.red >> 11) != r) || ((testColor.green >> 11) != g) || ((testColor.blue >> 11) != b)) { NSLog(@"WARNING - XGServer is unable to use the " @"fast algorithm for writing to a 15-bit display on " @"this host - perhaps you'd like to adjust the code " @"to work ... and submit a patch."); drawMechanism = XGDM_PORTABLE; } } else if (rcontext->depth == 24 || rcontext->depth == 32) { drawMechanism = XGDM_FAST32; r = 32; g = 33; b = 31; testColor.pixel = (((r << 8) + g) << 8) + b; XQueryColor(rcontext->dpy, rcontext->cmap, &testColor); if (((testColor.red >> 8) == r) && ((testColor.green >> 8) == g) && ((testColor.blue >> 8) == b)) { drawMechanism = XGDM_FAST32; } else if (((testColor.red >> 8) == b) && ((testColor.green >> 8) == g) && ((testColor.blue >> 8) == r)) { drawMechanism = XGDM_FAST32_BGR; } else { NSLog(@"WARNING - XGServer is unable to use the " @"fast algorithm for writing to a 32-bit display on " @"this host - perhaps you'd like to adjust the code " @"to work ... and submit a patch."); drawMechanism = XGDM_PORTABLE; } } else if (rcontext->depth == 8) { drawMechanism = XGDM_FAST8; r = 2; g = 3; b = 1; testColor.pixel = (((r << 3) + g) << 2) + b; XQueryColor(rcontext->dpy, rcontext->cmap, &testColor); if (((testColor.red >> 13) != r) || ((testColor.green >> 13) != g) || ((testColor.blue >> 14) != b)) { NSLog(@"WARNING - XGServer is unable to use the " @"fast algorithm for writing to an 8-bit display on " @"this host - the most likely reason being " @"the StandardColormap RGB_BEST_MAP has not been installed."); drawMechanism = XGDM_PORTABLE; } } else { NSLog(@"WARNING - XGServer is unable to use a " @"fast algorithm for writing to the display on " @"this host - perhaps you'd like to adjust the code " @"to work ... and submit a patch."); drawMechanism = XGDM_PORTABLE; } NSDebugLLog(@"XGTrace", @"Draw mech %d for screen %d", drawMechanism, screen_id); return self; } - (void) dealloc { #ifndef HAVE_WRASTER_H // FIXME: context.c does not include a clean up function for Rcontext, // so we try do it here. /* Note that this can be done only when we use our own version of wraster. If we're using an external version of wraster, the rcontext structure might be different (different fields, or differently used fields), which breaks this code. */ if (rcontext) { XFreeGC(rcontext->dpy, rcontext->copy_gc); if (rcontext->drawable) { XDestroyWindow(rcontext->dpy, rcontext->drawable); } if (rcontext->pixels) { free(rcontext->pixels); } if (rcontext->colors) { free(rcontext->colors); } if (rcontext->hermes_data) { free(rcontext->hermes_data); } free(rcontext->attribs); free(rcontext); } #endif [super dealloc]; } - (XGDrawMechanism) drawMechanism { return drawMechanism; } - (RContext *) context { return rcontext; } @end /** XGServer

XGServer is a concrete subclass of GSDisplayServer that handles X-Window client communications. The class is broken into four sections. The main class handles setting up and closing down the display, as well as providing wrapper methods to access display and screen pointers. The WindowOps category handles window creating, display, movement, and other functions detailed in the GSDisplayServer(WindowOps) category. The EventOps category handles events received from X-Windows and the window manager. It implements the methods defined in the GSDisplayServer(EventOps) category. The last section */ @implementation XGServer /* Initialize AppKit backend */ + (void) initializeBackend { NSDebugLog(@"Initializing GNUstep x11 backend.\n"); [GSDisplayServer setDefaultServerClass: [XGServer class]]; signal(SIGTERM, terminate); signal(SIGINT, terminate); } /** Returns a pointer to the current X-Windows display variable for the current context. */ + (Display *) xDisplay { return [(XGServer*)GSCurrentServer() xDisplay]; } - (id) _initXContext { int screen_id, display_id; NSString *display_name; display_name = [server_info objectForKey: GSDisplayName]; if (display_name == nil) { NSString *host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"]; NSString *dn = [server_info objectForKey: GSDisplayNumber]; NSString *sn = [server_info objectForKey: GSScreenNumber]; if (dn || sn) { if (dn == NULL) dn = @"0"; if (sn == NULL) sn = @"0"; if (host == nil) host = @""; display_name = [NSString stringWithFormat: @"%@:%@.%@", host, dn,sn]; } else if ((host != nil) && ([host isEqual: @""] == NO)) { /** * If the NSHost default told us to display somewhere, we need * to generate a display name for X from the host name and the * default display and screen numbers (zero). */ display_name = [NSString stringWithFormat: @"%@:0.0", host]; } } XInitThreads(); if (display_name) { dpy = XOpenDisplay([display_name cString]); } else { dpy = XOpenDisplay(NULL); display_name = [NSString stringWithCString: XDisplayName(NULL)]; } if (dpy == NULL) { char *dname = XDisplayName([display_name cString]); [NSException raise: NSWindowServerCommunicationException format: @"Unable to connect to X Server `%s'", dname]; } /* Parse display information */ _parse_display_name(display_name, &display_id, &screen_id); NSDebugLog(@"Opened display %@, display %d screen %d", display_name, display_id, screen_id); [server_info setObject: display_name forKey: GSDisplayName]; [server_info setObject: [NSNumber numberWithInt: display_id] forKey: GSDisplayNumber]; [server_info setObject: [NSNumber numberWithInt: screen_id] forKey: GSScreenNumber]; /* Setup screen*/ if (screenList == NULL) screenList = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 20); defScreen = screen_id; /* Enumerate monitors */ if (monitors == NULL) [self screenList]; XSetErrorHandler(XGErrorHandler); #ifdef HAVE_X11_EXTENSIONS_SYNC_H { int xsync_evbase, xsync_errbase; int major, minor; if (XSyncQueryExtension(dpy, &xsync_evbase, &xsync_errbase)) XSyncInitialize(dpy, &major, &minor); } #endif if (GSDebugSet(@"XSynchronize") == YES) XSynchronize(dpy, True); [self _setupRootWindow]; inputServer = [[XIMInputServer allocWithZone: [self zone]] initWithDelegate: nil display: dpy name: @"XIM"]; #ifdef HAVE_XRANDR XRRQueryExtension(dpy, &randrEventBase, &randrErrorBase); XRRSelectInput(dpy, RootWindow(dpy, defScreen), RRScreenChangeNotifyMask); #endif return self; } /** Opens the X display (using a helper method) and sets up basic display mechanisms, such as visuals and colormaps. */ - (id) initWithAttributes: (NSDictionary *)info { [super initWithAttributes: info]; [self _initXContext]; [self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode]; [self setupRunLoopInputSourcesForMode: NSConnectionReplyMode]; [self setupRunLoopInputSourcesForMode: NSModalPanelRunLoopMode]; [self setupRunLoopInputSourcesForMode: NSEventTrackingRunLoopMode]; return self; } /** Closes all X resources, the X display and dealloc other ivars. */ - (void) dealloc { NSDebugLog(@"Destroying X11 Server"); [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; DESTROY(inputServer); [self _destroyServerWindows]; NSFreeMapTable(screenList); if (monitors != NULL) { NSZoneFree([self zone], monitors); } XCloseDisplay(dpy); [super dealloc]; } /** Returns a pointer to the X windows display variable */ - (Display *) xDisplay { return dpy; } /** Returns the root window of the display */ - (Window) xDisplayRootWindow; { return RootWindow(dpy, defScreen); } /** Returns the application root window, which is used for many things such as window hints */ - (Window) xAppRootWindow { return generic.appRootWindow; } - (NSSize) xScreenSize { return xScreenSize; } - (XGScreenContext *) _defaultScreenContext { XGScreenContext *screenCtxt; screenCtxt = NSMapGet(screenList, (void *)(uintptr_t)defScreen); if (screenCtxt == NULL) { screenCtxt = [[XGScreenContext alloc] initForDisplay: dpy screen: defScreen]; NSMapInsert(screenList, (void *)(uintptr_t)defScreen, (void *)screenCtxt); RELEASE(screenCtxt); } return screenCtxt; } /** Returns a pointer to a structure which describes aspects of the X windows display */ - (void *) screenRContext { return [[self _defaultScreenContext] context]; } - (Visual *) screenVisual { return [[self _defaultScreenContext] context]->visual; } - (int) screenDepth { return [[self _defaultScreenContext] context]->depth; } /** Returns the XGDrawMechanism, which roughly describes the depth of the screen and how pixels should be drawn to the screen for maximum speed. */ - (XGDrawMechanism) screenDrawMechanism { return [[self _defaultScreenContext] drawMechanism]; } // Could use NSSwapInt() instead static unsigned int flip_bytes32(unsigned int i) { return ((i >> 24) & 0xff) |((i >> 8) & 0xff00) |((i << 8) & 0xff0000) |((i << 24) & 0xff000000); } static unsigned int flip_bytes16(unsigned int i) { return ((i >> 8) & 0xff) |((i << 8) & 0xff00); } static int byte_order(void) { union { unsigned int i; char c; } foo; foo.i = 1; return foo.c != 1; } /** * Used by the art backend to determine the drawing mechanism. */ - (void) getForScreen: (int)screen_id pixelFormat: (int *)bpp_number masks: (int *)red_mask : (int *)green_mask : (int *)blue_mask { Visual *visual; XImage *i; int bpp; RContext *context; // Better to get the used visual from the context. context = [self screenRContext]; visual = context->visual; bpp = context->depth; i = XCreateImage(dpy, visual, bpp, ZPixmap, 0, NULL, 8, 8, 8, 0); bpp = i->bits_per_pixel; XDestroyImage(i); *red_mask = visual->red_mask; *green_mask = visual->green_mask; *blue_mask = visual->blue_mask; *bpp_number = bpp; /* If the server doesn't have the same endianness as we do, we need to flip the masks around (well, at least sometimes; not sure what'll really happen for 15/16bpp modes). */ { int us = byte_order(); /* True iff we're big-endian. */ int them = ImageByteOrder(dpy); /* True iff the server is big-endian. */ if (us != them) { if ((bpp == 32) || (bpp == 24)) { *red_mask = flip_bytes32(*red_mask); *green_mask = flip_bytes32(*green_mask); *blue_mask = flip_bytes32(*blue_mask); } else if (bpp == 16) { *red_mask = flip_bytes16(*red_mask); *green_mask = flip_bytes16(*green_mask); *blue_mask = flip_bytes16(*blue_mask); } } } } /** Returns the closest color in the current colormap to the indicated X color */ - (XColor) xColorFromColor: (XColor)color { Status ret; RColor rcolor; RContext *context = [self screenRContext]; XAllocColor(dpy, context->cmap, &color); rcolor.red = color.red / 256; rcolor.green = color.green / 256; rcolor.blue = color.blue / 256; ret = RGetClosestXColor(context, &rcolor, &color); if (ret == False) { NSLog(@"Failed to alloc color (%d,%d,%d)\n", (int)rcolor.red, (int)rcolor.green, (int)rcolor.blue); } return color; } /** Wait for all contexts to finish processing. Only used with XDPS graphics. */ + (void) waitAllContexts { if ([[GSCurrentContext() class] respondsToSelector: @selector(waitAllContexts)]) [[GSCurrentContext() class] waitAllContexts]; } - (void) beep { XBell(dpy, 0); } - glContextClass { #ifdef HAVE_GLX return [XGGLContext class]; #else return nil; #endif } - glPixelFormatClass { #ifdef HAVE_GLX return [XGGLPixelFormat class]; #else return nil; #endif } @end @implementation XGServer (InputMethod) - (NSString *) inputMethodStyle { return inputServer ? [(XIMInputServer *)inputServer inputMethodStyle] : (NSString*)nil; } - (NSString *) fontSize: (int *)size { return inputServer ? [(XIMInputServer *)inputServer fontSize: size] : (NSString*)nil; } - (BOOL) clientWindowRect: (NSRect *)rect { return inputServer ? [(XIMInputServer *)inputServer clientWindowRect: rect] : NO; } - (BOOL) statusArea: (NSRect *)rect { return inputServer ? [(XIMInputServer *)inputServer statusArea: rect] : NO; } - (BOOL) preeditArea: (NSRect *)rect { return inputServer ? [(XIMInputServer *)inputServer preeditArea: rect] : NO; } - (BOOL) preeditSpot: (NSPoint *)p { return inputServer ? [(XIMInputServer *)inputServer preeditSpot: p] : NO; } - (BOOL) setStatusArea: (NSRect *)rect { return inputServer ? [(XIMInputServer *)inputServer setStatusArea: rect] : NO; } - (BOOL) setPreeditArea: (NSRect *)rect { return inputServer ? [(XIMInputServer *)inputServer setPreeditArea: rect] : NO; } - (BOOL) setPreeditSpot: (NSPoint *)p { return inputServer ? [(XIMInputServer *)inputServer setPreeditSpot: p] : NO; } @end // XGServer (InputMethod) //==== Additional code for NSTextView ========================================= // // WARNING This section is not genuine part of the XGServer implementation. // ------- // // The methods implemented in this section override some of the internal // methods defined in NSTextView so that the class can support input methods // (XIM) in cooperation with XGServer. // // Note that the orverriding is done by defining the methods in a category, // the name of which is not explicitly mentioned in NSTextView.h; the // category is called 'InputMethod'. // #include #include #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" #endif @implementation NSTextView (InputMethod) - (void) _updateInputMethodState { NSRect frame; int font_size; NSRect status_area; NSRect preedit_area; id displayServer = (XGServer *)GSCurrentServer(); if (![displayServer respondsToSelector: @selector(inputMethodStyle)]) return; if (![displayServer fontSize: &font_size]) return; if ([[self superview] isKindOfClass: [NSClipView class]]) frame = [[self superview] frame]; else frame = [self frame]; status_area.size.width = 2 * font_size; status_area.size.height = font_size + 2; status_area.origin.x = 0; status_area.origin.y = frame.size.height - status_area.size.height; if ([[displayServer inputMethodStyle] isEqual: @"OverTheSpot"]) { preedit_area.origin.x = 0; preedit_area.origin.y = 0; preedit_area.size.width = frame.size.width; preedit_area.size.height = status_area.size.height; [displayServer setStatusArea: &status_area]; [displayServer setPreeditArea: &preedit_area]; } else if ([[displayServer inputMethodStyle] isEqual: @"OffTheSpot"]) { preedit_area.origin.x = status_area.size.width + 2; preedit_area.origin.y = status_area.origin.y; preedit_area.size.width = frame.origin.x + frame.size.width - preedit_area.origin.x; preedit_area.size.height = status_area.size.height; [displayServer setStatusArea: &status_area]; [displayServer setPreeditArea: &preedit_area]; } else { // Do nothing for the RootWindow style. } } - (void) _updateInputMethodWithInsertionPoint: (NSPoint)insertionPoint { id displayServer = (XGServer *)GSCurrentServer(); if (![displayServer respondsToSelector: @selector(inputMethodStyle)]) return; if ([[displayServer inputMethodStyle] isEqual: @"OverTheSpot"]) { id view; NSRect frame; NSPoint p; NSRect client_win_rect; NSPoint screenXY_of_frame; double x_offset; double y_offset; int font_size; NSRect doc_rect; NSRect doc_visible_rect; BOOL cond; float x = insertionPoint.x; float y = insertionPoint.y; [displayServer clientWindowRect: &client_win_rect]; [displayServer fontSize: &font_size]; cond = [[self superview] isKindOfClass: [NSClipView class]]; if (cond) view = [self superview]; else view = self; frame = [view frame]; screenXY_of_frame = [[view window] convertBaseToScreen: frame.origin]; // N.B. The window of NSTextView isn't necessarily the same as the input // method's client window. x_offset = screenXY_of_frame.x - client_win_rect.origin.x; y_offset = (client_win_rect.origin.y + client_win_rect.size.height) - (screenXY_of_frame.y + frame.size.height) + font_size; x += x_offset; y += y_offset; if (cond) // If 'view' is of NSClipView, then { // N.B. Remember, (x, y) are the values with respect to NSTextView. // We need to know the corresponding insertion position with respect // to NSClipView. doc_rect = [(NSClipView *)view documentRect]; doc_visible_rect = [view documentVisibleRect]; y -= doc_visible_rect.origin.y - doc_rect.origin.y; } p = NSMakePoint(x, y); [displayServer setPreeditSpot: &p]; } } @end // NSTextView #if defined(__clang__) #pragma clang diagnostic pop #endif //==== End: Additional Code for NSTextView ==================================== gnustep-back-0.29.0/Source/x11/XGServerEvent.m000066400000000000000000003021331404163720200207240ustar00rootroot00000000000000/* XGServerEvent - Window/Event code for X11 backends. Copyright (C) 1998-2015 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "x11/XGServerWindow.h" #include "x11/XGInputServer.h" #include "x11/XGDragView.h" #include "x11/XGGeneric.h" #include "x11/xdnd.h" #ifdef HAVE_WRASTER_H #include "wraster.h" #else #include "x11/wraster.h" #endif #ifdef HAVE_XRANDR #include #endif #include "math.h" #include #include #if LIB_FOUNDATION_LIBRARY # include #elif defined(NeXT_PDO) # include # include #endif #define cWin ((gswindow_device_t*)generic.cachedWindow) // NumLock's mask (it depends on the keyboard mapping) static unsigned int _num_lock_mask; // Modifier state static char _shift_pressed = 0; static char _control_pressed = 0; static char _command_pressed = 0; static char _alt_pressed = 0; static char _help_pressed = 0; /* Keys used for the modifiers (you may set them with user preferences). Note that the first and second key sym for a modifier must be different. Otherwise, the _*_pressed tracking will be confused. */ static KeySym _control_keysyms[2]; static KeySym _command_keysyms[2]; static KeySym _alt_keysyms[2]; static KeySym _help_keysyms[2]; static BOOL _is_keyboard_initialized = NO; static BOOL _mod_ignore_shift = NO; /* Mouse properties. In comments below specified defaults key and default value. */ static NSInteger clickTime; // "GSDoubleClickTime" - milisecond (250) static NSInteger clickMove; // "GSMouseMoveThreshold" - in pixels (3) static NSInteger mouseScrollMultiplier; // "GSMouseScrollMultiplier" - times (1) static NSEventType menuMouseButton; // "GSMenuButtonEvent" - (NSRightMouseButon) static BOOL menuButtonEnabled; // "GSMenuButtonEnabled" - BOOL static BOOL swapMouseButtons; // YES if "GSMenuButtonEvent" == NSLeftMouseButton void __objc_xgcontextevent_linking (void) { } static SEL procSel = 0; static void (*procEvent)(id, SEL, XEvent*) = 0; #ifdef XSHM @interface NSGraphicsContext (SharedMemory) -(void) gotShmCompletion: (Drawable)d; @end #endif @interface XGServer (Private) - (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode; - (void) setupRunLoopInputSourcesForMode: (NSString*)mode; - (NSDate*) timedOutEvent: (void*)data type: (RunLoopEventType)type forMode: (NSString*)mode; - (int) XGErrorHandler: (Display*)display : (XErrorEvent*)err; - (void) processEvent: (XEvent *) event; - (NSEvent *)_handleTakeFocusAtom: (XEvent)xEvent forContext: (NSGraphicsContext *)gcontext; @end int XGErrorHandler(Display *display, XErrorEvent *err) { XGServer *ctxt = (XGServer*)GSCurrentServer(); return [ctxt XGErrorHandler: display : err]; } static NSEvent*process_key_event (XEvent* xEvent, XGServer* ctxt, NSEventType eventType, NSMutableArray *event_queue, BOOL keyRepeat); static unichar process_char (KeySym keysym, unsigned *eventModifierFlags); static unsigned process_modifier_flags(unsigned int state); static void initialize_keyboard (void); static void set_up_num_lock (void); // checks whether a GNUstep modifier (key_sym) is pressed when we're only able // to check whether X keycodes are pressed in xEvent->xkeymap; static int check_modifier (XEvent *xEvent, KeySym key_sym) { char *key_vector; int by,bi; int key_code = XKeysymToKeycode(xEvent->xkeymap.display, key_sym); if (key_code != NoSymbol) { by = key_code / 8; bi = key_code % 8; key_vector = xEvent->xkeymap.key_vector; return (key_vector[by] & (1 << bi)); } return 0; } @interface XGServer (WindowOps) - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b : (unsigned int) style : (Window) win; - (NSRect) _XWinRectToOSWinRect: (NSRect)r for: (void*)windowNumber; @end @implementation XGServer (EventOps) - (int) XGErrorHandler: (Display*)display : (XErrorEvent*)err { int length = 1024; char buffer[length+1]; /* * Ignore attempts to set input focus to unmapped window, except for noting * if the most recent request failed (mark the request serial number to 0) * in which case we should repeat the request when the window becomes * mapped again. */ if (err->error_code == BadMatch && err->request_code == X_SetInputFocus) { if (err->serial == generic.focusRequestNumber) { generic.focusRequestNumber = 0; } return 0; } XGetErrorText(display, err->error_code, buffer, length); if (err->type == 0 && GSDebugSet(@"XSynchronize") == NO) { NSLog(@"X-Windows error - %s\n\ on display: %s\n\ type: %d\n\ serial number: %lu\n\ request code: %d\n", buffer, XDisplayName(DisplayString(display)), err->type, err->serial, err->request_code); return 0; } [NSException raise: NSWindowServerCommunicationException format: @"X-Windows error - %s\n\ on display: %s\n\ type: %d\n\ serial number: %lu\n\ request code: %d\n", buffer, XDisplayName(DisplayString(display)), err->type, err->serial, err->request_code]; return 0; } - (void) setupRunLoopInputSourcesForMode: (NSString*)mode { int xEventQueueFd = XConnectionNumber(dpy); NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; #if defined(LIB_FOUNDATION_LIBRARY) { id fileDescriptor = [[[NSPosixFileDescriptor alloc] initWithFileDescriptor: xEventQueueFd] autorelease]; // Invoke limitDateForMode: to setup the current // mode of the run loop (the doc says that this // method and acceptInputForMode: beforeDate: are // the only ones that setup the current mode). [currentRunLoop limitDateForMode: mode]; [fileDescriptor setDelegate: self]; [fileDescriptor monitorFileActivity: NSPosixReadableActivity]; } #elif defined(NeXT_PDO) { id fileDescriptor = [[[NSFileHandle alloc] initWithFileDescriptor: xEventQueueFd] autorelease]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(activityOnFileHandle:) name: NSFileHandleDataAvailableNotification object: fileDescriptor]; [fileDescriptor waitForDataInBackgroundAndNotifyForModes: [NSArray arrayWithObject: mode]]; } #else [currentRunLoop addEvent: (void*)(gsaddr)xEventQueueFd type: ET_RDESC watcher: (id)self forMode: mode]; #endif if (procSel == 0) { procSel = @selector(processEvent:); procEvent = (void (*)(id, SEL, XEvent*)) [self methodForSelector: procSel]; } } #if LIB_FOUNDATION_LIBRARY - (void) activity: (NSPosixFileActivities)activity posixFileDescriptor: (NSPosixFileDescriptor*)fileDescriptor { [self receivedEvent: 0 type: 0 extra: 0 forMode: nil]; } #elif defined(NeXT_PDO) - (void) activityOnFileHandle: (NSNotification*)notification { id fileDescriptor = [notification object]; id runLoopMode = [[NSRunLoop currentRunLoop] currentMode]; [fileDescriptor waitForDataInBackgroundAndNotifyForModes: [NSArray arrayWithObject: runLoopMode]]; [self receivedEvent: 0 type: 0 extra: 0 forMode: nil]; } #endif - (BOOL) runLoopShouldBlock: (BOOL*)trigger { *trigger = YES; // Should trigger this event if (XPending(dpy) > 0) { return NO; // Don't block } return YES; } - (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode { XEvent xEvent; // loop and grab all of the events from the X queue while (XPending(dpy) > 0) { XNextEvent(dpy, &xEvent); #ifdef USE_XIM if (XFilterEvent(&xEvent, None)) { NSDebugLLog(@"NSKeyEvent", @"Event filtered (by XIM?)\n"); continue; } #endif (*procEvent)(self, procSel, &xEvent); } } /* */ - (NSPoint) _XPointToOSPoint: (NSPoint)x for: (void*)window { gswindow_device_t *win = (gswindow_device_t*)window; unsigned int style = win->win_attrs.window_style; NSPoint o; float t, b, l, r; [self styleoffsets: &l : &r : &t : &b : style : win->ident]; o.x = x.x + l; o.y = NSHeight(win->xframe) - x.y + b; NSDebugLLog(@"Frame", @"X2OP %lu, %x, %@, %@", win->number, style, NSStringFromPoint(x), NSStringFromPoint(o)); return o; } - (void) mouseOptionsChanged: (NSNotification *)aNotif { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; clickTime = [defs integerForKey:@"GSDoubleClickTime"]; if (clickTime < 200) clickTime = 300; clickMove = [defs integerForKey:@"GSMouseMoveThreshold"]; if (clickMove < 3) clickMove = 3; mouseScrollMultiplier = [defs integerForKey:@"GSMouseScrollMultiplier"]; if (mouseScrollMultiplier == 0) mouseScrollMultiplier = 1; if ([defs objectForKey:@"GSMenuButtonEnabled"]) menuButtonEnabled = [defs boolForKey:@"GSMenuButtonEnabled"]; else menuButtonEnabled = YES; if ([defs objectForKey:@"GSMenuButtonEvent"]) menuMouseButton = [defs integerForKey:@"GSMenuButtonEvent"]; else menuMouseButton = NSRightMouseDown; switch (menuMouseButton) { case NSLeftMouseDown: swapMouseButtons = YES; break; default: swapMouseButtons = NO; break; } } - (void) initializeMouse { [self mouseOptionsChanged: nil]; [[NSDistributedNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseOptionsChanged:) name: NSUserDefaultsDidChangeNotification object: nil]; } - (void) processEvent: (XEvent *) event { static int clickCount = 1; static unsigned int eventFlags; static NSPoint eventLocation; NSEvent *e = nil; XEvent xEvent; NSWindow *nswin; Window xWin; NSEventType eventType; NSGraphicsContext *gcontext; float deltaX; float deltaY; int buttonNumber; gcontext = GSCurrentContext(); xEvent = *event; switch (xEvent.type) { // mouse button events case ButtonPress: NSDebugLLog(@"NSEvent", @"%lu ButtonPress: \ xEvent.xbutton.time %lu timeOfLastClick %lu \n", xEvent.xbutton.window, xEvent.xbutton.time, generic.lastClick); /* * hardwired test for a double click * * For multiple clicks, the clicks must remain in the same * region of the same window and must occur in a limited time. * * default time of 300 should be user set; * perhaps the movement of 3 should also be a preference? */ { BOOL incrementCount = YES; if (clickTime == 0) [self initializeMouse]; if (xEvent.xbutton.time >= (unsigned long)(generic.lastClick + clickTime)) incrementCount = NO; else if (generic.lastClickWindow != xEvent.xbutton.window) incrementCount = NO; else if ((generic.lastClickX - xEvent.xbutton.x) > clickMove) incrementCount = NO; else if ((generic.lastClickX - xEvent.xbutton.x) < -clickMove) incrementCount = NO; else if ((generic.lastClickY - xEvent.xbutton.y) > clickMove) incrementCount = NO; else if ((generic.lastClickY - xEvent.xbutton.y) < -clickMove) incrementCount = NO; if (incrementCount == YES) { clickCount++; } else { /* * Not a multiple-click, so we must set the stored * location of the click to the new values and * reset the counter. */ clickCount = 1; generic.lastClickWindow = xEvent.xbutton.window; generic.lastClickX = xEvent.xbutton.x; generic.lastClickY = xEvent.xbutton.y; } } generic.lastClick = xEvent.xbutton.time; [self setLastTime: generic.lastClick]; deltaX = 0.0; deltaY = 0.0; if (xEvent.xbutton.button == generic.lMouse) { if (swapMouseButtons) { eventType = NSRightMouseDown; buttonNumber = generic.rMouse; } else { eventType = NSLeftMouseDown; buttonNumber = generic.lMouse; } } else if (xEvent.xbutton.button == generic.rMouse && generic.rMouse != 0) { if (swapMouseButtons) { eventType = NSLeftMouseDown; buttonNumber = generic.lMouse; } else { eventType = NSRightMouseDown; buttonNumber = generic.rMouse; } } else if (xEvent.xbutton.button == generic.mMouse && generic.mMouse != 0) { eventType = NSOtherMouseDown; buttonNumber = generic.mMouse; } else if (xEvent.xbutton.button == generic.upMouse && generic.upMouse != 0) { deltaY = 1. * mouseScrollMultiplier; eventType = NSScrollWheel; buttonNumber = generic.upMouse; } else if (xEvent.xbutton.button == generic.downMouse && generic.downMouse != 0) { deltaY = -1. * mouseScrollMultiplier; eventType = NSScrollWheel; buttonNumber = generic.downMouse; } else if (xEvent.xbutton.button == generic.scrollLeftMouse && generic.scrollLeftMouse != 0) { deltaX = -1. * mouseScrollMultiplier; eventType = NSScrollWheel; buttonNumber = generic.scrollLeftMouse; } else if (xEvent.xbutton.button == generic.scrollRightMouse && generic.scrollRightMouse != 0) { deltaX = 1. * mouseScrollMultiplier; eventType = NSScrollWheel; buttonNumber = generic.scrollRightMouse; } else { break; /* Unknown button */ } if (menuButtonEnabled == NO && eventType == menuMouseButton) break; // disabled menu button was pressed eventFlags = process_modifier_flags(xEvent.xbutton.state); // if pointer is grabbed use grab window xWin = (grabWindow == 0) ? xEvent.xbutton.window : grabWindow; if (cWin == 0 || xWin != cWin->ident) generic.cachedWindow = [XGServer _windowForXWindow: xWin]; if (cWin == 0) break; eventLocation.x = xEvent.xbutton.x; eventLocation.y = xEvent.xbutton.y; eventLocation = [self _XPointToOSPoint: eventLocation for: cWin]; if (generic.flags.useWindowMakerIcons == 1) { /* * We must hand over control of our icon/miniwindow * to Window Maker. */ if ((cWin->win_attrs.window_style & (NSMiniWindowMask | NSIconWindowMask)) != 0 && eventType == NSLeftMouseDown) { if (cWin->parent == None) break; xEvent.xbutton.window = cWin->parent; XUngrabPointer(dpy, CurrentTime); XSendEvent(dpy, cWin->parent, True, ButtonPressMask, &xEvent); XFlush(dpy); if (clickCount == 1) break; } } // create NSEvent e = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)generic.lastClick / 1000.0 windowNumber: cWin->number context: gcontext eventNumber: xEvent.xbutton.serial clickCount: clickCount pressure: 1.0 buttonNumber: buttonNumber /* FIXME */ deltaX: deltaX deltaY: deltaY deltaZ: 0.]; break; case ButtonRelease: NSDebugLLog(@"NSEvent", @"%lu ButtonRelease\n", xEvent.xbutton.window); [self setLastTime: xEvent.xbutton.time]; if (xEvent.xbutton.button == generic.lMouse) { if (swapMouseButtons) { eventType = NSRightMouseUp; buttonNumber = generic.rMouse; } else { eventType = NSLeftMouseUp; buttonNumber = generic.lMouse; } } else if (xEvent.xbutton.button == generic.rMouse && generic.rMouse != 0) { if (swapMouseButtons) { eventType = NSLeftMouseUp; buttonNumber = generic.lMouse; } else { eventType = NSRightMouseUp; buttonNumber = generic.rMouse; } } else if (xEvent.xbutton.button == generic.mMouse && generic.mMouse != 0) { eventType = NSOtherMouseUp; buttonNumber = generic.mMouse; } else { // we ignore release of scrollUp or scrollDown break; /* Unknown button */ } if (menuButtonEnabled == NO && eventType == menuMouseButton) break; // disabled menu button was released eventFlags = process_modifier_flags(xEvent.xbutton.state); // if pointer is grabbed use grab window xWin = (grabWindow == 0) ? xEvent.xbutton.window : grabWindow; if (cWin == 0 || xWin != cWin->ident) generic.cachedWindow = [XGServer _windowForXWindow: xWin]; if (cWin == 0) break; eventLocation.x = xEvent.xbutton.x; eventLocation.y = xEvent.xbutton.y; eventLocation = [self _XPointToOSPoint: eventLocation for: cWin]; e = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)generic.lastTime / 1000.0 windowNumber: cWin->number context: gcontext eventNumber: xEvent.xbutton.serial clickCount: clickCount pressure: 1.0 buttonNumber: buttonNumber /* FIXMME */ deltaX: 0.0 deltaY: 0.0 deltaZ: 0.0]; break; case CirculateNotify: NSDebugLLog(@"NSEvent", @"%lu CirculateNotify\n", xEvent.xcirculate.window); break; case CirculateRequest: NSDebugLLog(@"NSEvent", @"%lu CirculateRequest\n", xEvent.xcirculaterequest.window); break; case ClientMessage: { NSTimeInterval time; DndClass dnd = xdnd (); NSDebugLLog(@"NSEvent", @"%lu ClientMessage - %s\n", xEvent.xclient.window, XGetAtomName(dpy, xEvent.xclient.message_type)); if (cWin == 0 || xEvent.xclient.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow: xEvent.xclient.window]; } if (cWin == 0) break; if (xEvent.xclient.message_type == generic.WM_PROTOCOLS_ATOM) { [self setLastTime: (Time)xEvent.xclient.data.l[1]]; NSDebugLLog(@"NSEvent", @"WM Protocol - %s\n", XGetAtomName(dpy, xEvent.xclient.data.l[0])); if ((Atom)xEvent.xclient.data.l[0] == generic.WM_DELETE_WINDOW_ATOM) { /* * WM is asking us to close a window */ eventLocation = NSMakePoint(0,0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowClose data1: 0 data2: 0]; } else if ((Atom)xEvent.xclient.data.l[0] == generic._GNUSTEP_WM_MINIATURIZE_WINDOW_ATOM) { NSDebugLLog(@"Miniaturize", @"%lu miniaturized", cWin->number); eventLocation = NSMakePoint(0,0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowMiniaturize data1: 0 data2: 0]; } else if ((Atom)xEvent.xclient.data.l[0] == generic._GNUSTEP_WM_HIDE_APP_ATOM) { NSDebugLLog(@"Hide", @"%lu application will be hidden", cWin->number); eventLocation = NSMakePoint(0,0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitAppHide data1: 0 data2: 0]; } else if ((Atom)xEvent.xclient.data.l[0] == generic.WM_TAKE_FOCUS_ATOM) { e = [self _handleTakeFocusAtom: xEvent forContext: gcontext]; } else if ((Atom)xEvent.xclient.data.l[0] == generic._NET_WM_PING_ATOM) { xEvent.xclient.window = RootWindow(dpy, cWin->screen_id); XSendEvent(dpy, xEvent.xclient.window, False, (SubstructureRedirectMask | SubstructureNotifyMask), &xEvent); } #ifdef HAVE_X11_EXTENSIONS_SYNC_H else if ((Atom)xEvent.xclient.data.l[0] == generic._NET_WM_SYNC_REQUEST_ATOM) { cWin->net_wm_sync_request_counter_value_low = (Atom)xEvent.xclient.data.l[2]; cWin->net_wm_sync_request_counter_value_high = (Atom)xEvent.xclient.data.l[3]; } #endif } else if (xEvent.xclient.message_type == dnd.XdndEnter) { Window source; NSDebugLLog(@"NSDragging", @" XdndEnter message\n"); source = XDND_ENTER_SOURCE_WIN(&xEvent); eventLocation = NSMakePoint(0,0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitDraggingEnter data1: source data2: 0]; /* If this is a non-local drag, set the dragInfo */ if ([XGServer _windowForXWindow: source] == NULL) { [[XGDragView sharedDragView] setupDragInfoFromXEvent: &xEvent]; } } else if (xEvent.xclient.message_type == dnd.XdndPosition) { Window source; Atom action; NSDragOperation operation; int root_x, root_y; Window root_child; NSDebugLLog(@"NSDragging", @" XdndPosition message\n"); source = XDND_POSITION_SOURCE_WIN(&xEvent); /* Work around a bug/feature in WindowMaker that does not send ConfigureNotify events for app icons. */ XTranslateCoordinates(dpy, xEvent.xclient.window, RootWindow(dpy, cWin->screen_id), 0, 0, &root_x, &root_y, &root_child); cWin->xframe.origin.x = root_x; cWin->xframe.origin.y = root_y; eventLocation.x = XDND_POSITION_ROOT_X(&xEvent) - NSMinX(cWin->xframe); eventLocation.y = XDND_POSITION_ROOT_Y(&xEvent) - NSMinY(cWin->xframe); eventLocation = [self _XPointToOSPoint: eventLocation for: cWin]; time = XDND_POSITION_TIME(&xEvent); action = XDND_POSITION_ACTION(&xEvent); operation = GSDragOperationForAction(action); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: time / 1000.0 windowNumber: cWin->number context: gcontext subtype: GSAppKitDraggingUpdate data1: source data2: operation]; /* If this is a non-local drag, update the dragInfo */ if ([XGServer _windowForXWindow: source] == NULL) { [[XGDragView sharedDragView] updateDragInfoFromEvent: e]; } } else if (xEvent.xclient.message_type == dnd.XdndStatus) { Window target; Atom action; NSDragOperation operation; NSDebugLLog(@"NSDragging", @" XdndStatus message\n"); target = XDND_STATUS_TARGET_WIN(&xEvent); eventLocation = NSMakePoint(0, 0); if (XDND_STATUS_WILL_ACCEPT (&xEvent)) { action = XDND_STATUS_ACTION(&xEvent); } else { action = NSDragOperationNone; } operation = GSDragOperationForAction(action); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitDraggingStatus data1: target data2: operation]; } else if (xEvent.xclient.message_type == dnd.XdndLeave) { Window source; NSDebugLLog(@"NSDragging", @" XdndLeave message\n"); source = XDND_LEAVE_SOURCE_WIN(&xEvent); eventLocation = NSMakePoint(0, 0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitDraggingExit data1: 0 data2: 0]; /* If this is a non-local drag, reset the dragInfo */ if ([XGServer _windowForXWindow: source] == NULL) { [[XGDragView sharedDragView] resetDragInfo]; } } else if (xEvent.xclient.message_type == dnd.XdndDrop) { Window source; NSDebugLLog(@"NSDragging", @" XdndDrop message\n"); source = XDND_DROP_SOURCE_WIN(&xEvent); eventLocation = NSMakePoint(0, 0); time = XDND_DROP_TIME(&xEvent); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: time / 1000.0 windowNumber: cWin->number context: gcontext subtype: GSAppKitDraggingDrop data1: source data2: 0]; } else if (xEvent.xclient.message_type == dnd.XdndFinished) { Window target; NSDebugLLog(@"NSDragging", @" XdndFinished message\n"); target = XDND_FINISHED_TARGET_WIN(&xEvent); eventLocation = NSMakePoint(0, 0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitDraggingFinished data1: target data2: 0]; } } break; case ColormapNotify: // colormap attribute NSDebugLLog(@"NSEvent", @"%lu ColormapNotify\n", xEvent.xcolormap.window); break; // the window has been resized, change the width and height // and update the window so the changes get displayed case ConfigureNotify: NSDebugLLog(@"NSEvent", @"%lu ConfigureNotify " @"x:%d y:%d w:%d h:%d b:%d %c", xEvent.xconfigure.window, xEvent.xconfigure.x, xEvent.xconfigure.y, xEvent.xconfigure.width, xEvent.xconfigure.height, xEvent.xconfigure.border_width, xEvent.xconfigure.send_event ? 'T' : 'F'); if (cWin == 0 || xEvent.xconfigure.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow:xEvent.xconfigure.window]; } if (cWin != 0) { NSRect r, x, n, h; NSTimeInterval ts = (NSTimeInterval)generic.lastMotion; r = cWin->xframe; x = NSMakeRect(xEvent.xconfigure.x, xEvent.xconfigure.y, xEvent.xconfigure.width, xEvent.xconfigure.height); /* According to the ICCCM, coordinates in synthetic events (ie. non-zero send_event) are in root space, while coordinates in real events are in the parent window's space. The parent window might be some window manager window, so we can't directly use those coordinates. Thus, if the event is real, we use XTranslateCoordinates to get the root space coordinates. */ if (xEvent.xconfigure.send_event == 0) { int root_x, root_y; Window root_child; XTranslateCoordinates(dpy, xEvent.xconfigure.window, RootWindow(dpy, cWin->screen_id), 0, 0, &root_x, &root_y, &root_child); x.origin.x = root_x; x.origin.y = root_y; } cWin->xframe = x; n = [self _XFrameToOSFrame: x for: cWin]; NSDebugLLog(@"Moving", @"Update win %lu:\n original:%@\n new:%@", cWin->number, NSStringFromRect(r), NSStringFromRect(x)); /* * Set size hints info to be up to date with new size. */ h = [self _XFrameToXHints: x for: cWin]; cWin->siz_hints.width = h.size.width; cWin->siz_hints.height = h.size.height; /* We only update the position hints if we're on the screen. Otherwise, the window manager might not have added decorations (if any) to the window yet. Since we compensate for decorations when we set the position, this will confuse us and we'll end up compensating twice, which makes windows drift. */ if (cWin->map_state == IsViewable) { cWin->siz_hints.x = h.origin.x; cWin->siz_hints.y = h.origin.y; } /* * create GNUstep event(s) */ if (!NSEqualSizes(r.size, x.size)) { NSEvent *r; /* Resize events move the origin. There's no good place to pass this info back, so we put it in the event location field */ r = [NSEvent otherEventWithType: NSAppKitDefined location: n.origin modifierFlags: eventFlags timestamp: ts / 1000.0 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowResized data1: n.size.width data2: n.size.height]; /* We don't add this event in event_queue, to don't delay * its sent. Instead, send it directly to the window. If not, * the programa can move/resize the window while we send * this event, causing a confusion. */ [[NSApp windowWithWindowNumber: cWin->number] sendEvent: r]; } if (!NSEqualPoints(r.origin, x.origin)) { NSEvent *r; NSWindow *window; r = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: eventFlags timestamp: ts / 1000.0 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowMoved data1: n.origin.x data2: n.origin.y]; /* We don't add this event in event_queue, to don't delay * its sent. Instead, send it directly to the window. If not, * the programa can move/resize the window while we send * this event, causing a confusion. */ window = [NSApp windowWithWindowNumber: cWin->number]; [window sendEvent: r]; /* Update monitor_id of the backend window. NSWindow may change screen pointer while processing the event. */ cWin->monitor_id = [[window screen] screenNumber]; } } break; // same as ConfigureNotify but we get this event // before the change has actually occurred case ConfigureRequest: NSDebugLLog(@"NSEvent", @"%lu ConfigureRequest\n", xEvent.xconfigurerequest.window); break; // a window has been created case CreateNotify: NSDebugLLog(@"NSEvent", @"%lu CreateNotify\n", xEvent.xcreatewindow.window); break; // a window has been destroyed case DestroyNotify: NSDebugLLog(@"NSEvent", @"%lu DestroyNotify\n", xEvent.xdestroywindow.window); break; // when the pointer enters a window case EnterNotify: NSDebugLLog(@"NSEvent", @"%lu EnterNotify\n", xEvent.xcrossing.window); break; // when the pointer leaves a window case LeaveNotify: NSDebugLLog(@"NSEvent", @"%lu LeaveNotify\n", xEvent.xcrossing.window); if (cWin == 0 || xEvent.xcrossing.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow: xEvent.xcrossing.window]; } if (cWin == 0) break; eventLocation = NSMakePoint(-1,-1); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowLeave data1: 0 data2: 0]; break; // the visibility of a window has changed case VisibilityNotify: NSDebugLLog(@"NSEvent", @"%lu VisibilityNotify %d\n", xEvent.xvisibility.window, xEvent.xvisibility.state); if (cWin == 0 || xEvent.xvisibility.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow:xEvent.xvisibility.window]; } // sub-window ? /* { Window xw; xw = xEvent.xvisibility.window; while (cWin == 0) { Window rw, *cw; unsigned int nc; if ( !XQueryTree(dpy, xw, &rw, &xw, &cw, &nc) ) continue; if ( cw != NULL ) XFree(cw); generic.cachedWindow = [XGServer _windowForXWindow:xw]; } } */ if (cWin != 0) cWin->visibility = xEvent.xvisibility.state; break; // a portion of the window has become visible and // we must redisplay it case Expose: NSDebugLLog(@"NSEvent", @"%lu Expose\n", xEvent.xexpose.window); { if (cWin == 0 || xEvent.xexpose.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow:xEvent.xexpose.window]; } // sub-window ? /* BOOL isSubWindow = NO; { Window xw; xw = xEvent.xexpose.window; XWindowAttributes wa; // We should not found more than one level, but who knows ? while (cWin == 0) { Window rw, *cw; unsigned int nc; XGetWindowAttributes(dpy,xEvent.xexpose.window,&wa); xEvent.xexpose.x += wa.x; xEvent.xexpose.y += wa.y; if ( !XQueryTree(dpy, xw, &rw, &xw, &cw, &nc) ) continue; if ( cw != NULL ) XFree(cw); generic.cachedWindow = [XGServer _windowForXWindow:xw]; } if ( xw != xEvent.xexpose.window ) { isSubWindow = YES; } } */ if (cWin != 0) { XRectangle rectangle; rectangle.x = xEvent.xexpose.x; rectangle.y = xEvent.xexpose.y; rectangle.width = xEvent.xexpose.width; rectangle.height = xEvent.xexpose.height; NSDebugLLog(@"NSEvent", @"Expose frame %d %d %d %d\n", rectangle.x, rectangle.y, rectangle.width, rectangle.height); #if 0 // ignore backing if sub-window [self _addExposedRectangle: rectangle : cWin->number : isSubWindow]; if (xEvent.xexpose.count == 0) [self _processExposedRectangles: cWin->number]; #else { NSRect rect; NSTimeInterval ts = (NSTimeInterval)generic.lastMotion; rect = [self _XWinRectToOSWinRect: NSMakeRect( rectangle.x, rectangle.y, rectangle.width, rectangle.height) for: cWin]; e = [NSEvent otherEventWithType: NSAppKitDefined location: rect.origin modifierFlags: eventFlags timestamp: ts / 1000.0 windowNumber: cWin->number context: gcontext subtype: GSAppKitRegionExposed data1: rect.size.width data2: rect.size.height]; } #endif } break; } // keyboard focus entered a window case FocusIn: NSDebugLLog(@"NSEvent", @"%lu FocusIn\n", xEvent.xfocus.window); if (cWin == 0 || xEvent.xfocus.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow:xEvent.xfocus.window]; } if (cWin == 0) break; NSDebugLLog(@"Focus", @"%lu got focus on %lu\n", xEvent.xfocus.window, cWin->number); // Store this for debugging, may not be the real focus window generic.currentFocusWindow = cWin->number; if (xEvent.xfocus.serial == generic.focusRequestNumber) { /* * This is a response to our own request - so we mark the * request as complete. */ generic.desiredFocusWindow = 0; generic.focusRequestNumber = 0; } break; // keyboard focus left a window case FocusOut: { Window fw; int rev; /* * See where the focus has moved to - * If it has gone to 'none' or 'PointerRoot' then * it's not one of ours. * If it has gone to our root window - use the icon window. * If it has gone to a window - we see if it is one of ours. */ XGetInputFocus(xEvent.xfocus.display, &fw, &rev); NSDebugLLog(@"NSEvent", @"%lu FocusOut\n", xEvent.xfocus.window); if (fw != None && fw != PointerRoot) { generic.cachedWindow = [XGServer _windowForXWindow: fw]; if (cWin == 0) { generic.cachedWindow = [XGServer _windowForXParent: fw]; } if (cWin == 0) { nswin = nil; } else { nswin = GSWindowWithNumber(cWin->number); } } else { nswin = nil; } NSDebugLLog(@"Focus", @"Focus went to %lu (xwin %lu)\n", (nswin != nil) ? cWin->number : 0, fw); // Focus went to a window not in this application. if (nswin == nil) { [NSApp deactivate]; } // Clean up old focus request generic.cachedWindow = [XGServer _windowForXWindow: xEvent.xfocus.window]; NSDebugLLog(@"Focus", @"%lu lost focus on %lu\n", xEvent.xfocus.window, (cWin) ? cWin->number : 0); generic.currentFocusWindow = 0; if (cWin && generic.desiredFocusWindow == cWin->number) { /* Request not valid anymore since we lost focus */ generic.focusRequestNumber = 0; } } break; case GraphicsExpose: NSDebugLLog(@"NSEvent", @"%lu GraphicsExpose\n", xEvent.xexpose.window); break; case NoExpose: NSDebugLLog(@"NSEvent", @"NoExpose\n"); break; // window is moved because of a change in the size of its parent case GravityNotify: NSDebugLLog(@"NSEvent", @"%lu GravityNotify\n", xEvent.xgravity.window); break; // a key has been pressed case KeyPress: NSDebugLLog(@"NSEvent", @"%lu KeyPress\n", xEvent.xkey.window); [self setLastTime: xEvent.xkey.time]; e = process_key_event (&xEvent, self, NSKeyDown, event_queue, NO); break; // a key has been released case KeyRelease: NSDebugLLog(@"NSEvent", @"%lu KeyRelease\n", xEvent.xkey.window); [self setLastTime: xEvent.xkey.time]; /* For key repeats X creates two corresponding KeyRelease/KeyPress events. So, first we check for the KeyRelease event, take a look at the next event in the queue and look if they are a matching KeyRelease/KeyPress pair. If so, we ignore the current KeyRelease event. */ if (XEventsQueued(dpy, QueuedAfterReading)) { XEvent nev; XPeekEvent(dpy, &nev); if (nev.type == KeyPress && nev.xkey.window == xEvent.xkey.window && nev.xkey.time == xEvent.xkey.time && nev.xkey.keycode == xEvent.xkey.keycode) { // Ignore the current KeyRelease event. } else { /* if (nev.type == ClientMessage) { NSDebugLLog(@"NSEvent", @"Next event ClientMessage type %ld %s", xEvent.xclient.message_type, XGetAtomName(dpy, xEvent.xclient.message_type)); } */ e = process_key_event(&xEvent, self, NSKeyUp, event_queue, NO); } } else { e = process_key_event(&xEvent, self, NSKeyUp, event_queue, NO); } break; // reports the state of the keyboard when pointer or // focus enters a window case KeymapNotify: { if (_is_keyboard_initialized == NO) initialize_keyboard (); NSDebugLLog(@"NSEvent", @"%lu KeymapNotify\n", xEvent.xkeymap.window); // Check if shift is pressed _shift_pressed = 0; if (check_modifier (&xEvent, XK_Shift_L)) { _shift_pressed |= 1; } if (check_modifier (&xEvent, XK_Shift_R)) { _shift_pressed |= 2; } // Check if control is pressed _control_pressed = 0; if ((_control_keysyms[0] != NoSymbol) && check_modifier (&xEvent, _control_keysyms[0])) { _control_pressed |= 1; } if ((_control_keysyms[1] != NoSymbol) && check_modifier (&xEvent, _control_keysyms[1])) { _control_pressed |= 2; } // Check if command is pressed _command_pressed = 0; if ((_command_keysyms[0] != NoSymbol) && check_modifier (&xEvent, _command_keysyms[0])) { _command_pressed |= 1; } if ((_command_keysyms[1] != NoSymbol) && check_modifier (&xEvent, _command_keysyms[1])) { _command_pressed |= 2; } // Check if alt is pressed _alt_pressed = 0; if ((_alt_keysyms[0] != NoSymbol) && check_modifier (&xEvent, _alt_keysyms[0])) { _alt_pressed |= 1; } if ((_alt_keysyms[1] != NoSymbol) && check_modifier (&xEvent, _alt_keysyms[1])) { _alt_pressed |= 2; } // Check if help is pressed _help_pressed = 0; if ((_help_keysyms[0] != NoSymbol) && check_modifier (&xEvent, _help_keysyms[0])) { _help_pressed |= 1; } if ((_help_keysyms[1] != NoSymbol) && check_modifier (&xEvent, _help_keysyms[1])) { _help_pressed |= 2; } } break; // when a window changes state from ummapped to // mapped or vice versa case MapNotify: NSDebugLLog(@"NSEvent", @"%lu MapNotify\n", xEvent.xmap.window); if (cWin == 0 || xEvent.xmap.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow:xEvent.xmap.window]; } if (cWin != 0) { cWin->map_state = IsViewable; /* * if the window that was just mapped wants the input * focus, re-do the request. */ if (generic.desiredFocusWindow == cWin->number && generic.focusRequestNumber == 0) { NSDebugLLog(@"Focus", @"Refocusing %lu on map notify", cWin->number); [self setinputfocus: cWin->number]; } /* * Make sure that the newly mapped window displays. */ nswin = GSWindowWithNumber(cWin->number); [nswin update]; } break; // Window is no longer visible. case UnmapNotify: NSDebugLLog(@"NSEvent", @"%lu UnmapNotify\n", xEvent.xunmap.window); if (cWin == 0 || xEvent.xunmap.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow:xEvent.xunmap.window]; } if (cWin != 0) { cWin->map_state = IsUnmapped; cWin->visibility = -1; } break; // like MapNotify but occurs before the request is carried out case MapRequest: NSDebugLLog(@"NSEvent", @"%lu MapRequest\n", xEvent.xmaprequest.window); break; // keyboard or mouse mapping has been changed by another client case MappingNotify: NSDebugLLog(@"NSEvent", @"%lu MappingNotify\n", xEvent.xmapping.window); if ((xEvent.xmapping.request == MappingModifier) || (xEvent.xmapping.request == MappingKeyboard)) { XRefreshKeyboardMapping (&xEvent.xmapping); set_up_num_lock (); } break; case MotionNotify: NSDebugLLog(@"NSMotionEvent", @"%lu MotionNotify - %d %d\n", xEvent.xmotion.window, xEvent.xmotion.x, xEvent.xmotion.y); { unsigned int state; /* * Compress motion events to avoid flooding. */ while (XPending(xEvent.xmotion.display)) { XEvent peek; XPeekEvent(xEvent.xmotion.display, &peek); if (peek.type == MotionNotify && xEvent.xmotion.window == peek.xmotion.window && xEvent.xmotion.subwindow == peek.xmotion.subwindow) { XNextEvent(xEvent.xmotion.display, &xEvent); } else { break; } } generic.lastMotion = xEvent.xmotion.time; [self setLastTime: generic.lastMotion]; state = xEvent.xmotion.state; if (state & generic.lMouseMask) { eventType = NSLeftMouseDragged; } else if (state & generic.rMouseMask) { eventType = NSRightMouseDragged; } else if (state & generic.mMouseMask) { eventType = NSOtherMouseDragged; } else { eventType = NSMouseMoved; } eventFlags = process_modifier_flags(state); // if pointer is grabbed use grab window instead xWin = (grabWindow == 0) ? xEvent.xmotion.window : grabWindow; if (cWin == 0 || xWin != cWin->ident) generic.cachedWindow = [XGServer _windowForXWindow: xWin]; if (cWin == 0) break; deltaX = - eventLocation.x; deltaY = - eventLocation.y; eventLocation = NSMakePoint(xEvent.xmotion.x, xEvent.xmotion.y); eventLocation = [self _XPointToOSPoint: eventLocation for: cWin]; deltaX += eventLocation.x; deltaY += eventLocation.y; e = [NSEvent mouseEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)generic.lastTime / 1000.0 windowNumber: cWin->number context: gcontext eventNumber: xEvent.xbutton.serial clickCount: clickCount pressure: 1.0 buttonNumber: 0 /* FIXME */ deltaX: deltaX deltaY: deltaY deltaZ: 0]; break; } // a window property has changed or been deleted case PropertyNotify: NSDebugLLog(@"NSEvent", @"%lu PropertyNotify - '%s'\n", xEvent.xproperty.window, XGetAtomName(dpy, xEvent.xproperty.atom)); if (xEvent.xproperty.atom == generic.WM_STATE_ATOM) { if (cWin == 0 || xEvent.xproperty.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow: xEvent.xproperty.window]; } if (cWin != 0) { int new_state; /* Get the new window state */ if (xEvent.xproperty.state == PropertyNewValue) new_state = [self _wm_state: xEvent.xproperty.window]; else new_state = WithdrawnState; switch (new_state) { case IconicState: /* Post miniaturize event upon transition from NormalState to IconicState. If the window manager supports the ewmh specification, also check that the _NET_WM_STATE property includes _NET_WM_STATE_HIDDEN. */ /* Note: Don't rely on WM_STATE (nor on _NET_WM_STATE) with Window Maker, since it is impossible to distinguish miniaturized windows from hidden windows by their window properties. Fortunately, Window Maker sends us a client message when a window is miniaturized. */ if ((generic.wm & XGWM_WINDOWMAKER) == 0 && cWin->wm_state == NormalState && ((generic.wm & XGWM_EWMH) == 0 || [self _ewmh_isHidden: xEvent.xproperty.window] == YES)) { /* Same event as when we get ClientMessage with the * atom equal to generic._GNUSTEP_WM_MINIATURIZE_WINDOW_ATOM */ NSDebugLLog(@"Miniaturize", @"%lu miniaturized", cWin->number); eventLocation = NSMakePoint(0,0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: xEvent.xproperty.time / 1000 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowMiniaturize data1: 0 data2: 0]; } break; case NormalState: /* Post deminiaturize event upon transition from IconicState to NormalState, but only if our window is actually miniaturized. */ if (cWin->wm_state == IconicState && [GSWindowWithNumber(cWin->number) isMiniaturized]) { NSDebugLLog(@"Miniaturize", @"%lu deminiaturized", cWin->number); eventLocation = NSMakePoint(0,0); e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: xEvent.xproperty.time / 1000 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowDeminiaturize data1: 0 data2: 0]; } break; } /* save the new state */ cWin->wm_state = new_state; } } break; // a client successfully reparents a window case ReparentNotify: NSDebugLLog(@"NSEvent", @"%lu ReparentNotify - offset %d %d\n", xEvent.xreparent.window, xEvent.xreparent.x, xEvent.xreparent.y); if (cWin == 0 || xEvent.xreparent.window != cWin->ident) { generic.cachedWindow = [XGServer _windowForXWindow:xEvent.xreparent.window]; } if (cWin != 0) { cWin->parent = xEvent.xreparent.parent; } if (cWin != 0 && xEvent.xreparent.parent != cWin->root && (xEvent.xreparent.x != 0 || xEvent.xreparent.y != 0)) { Window parent = xEvent.xreparent.parent; XWindowAttributes wattr; float l; float r; float t; float b; Offsets *o; /* Get the WM offset info which we hope is the same * for all parented windows with the same style. * The coordinates in the event are insufficient to determine * the offsets as the new parent window may have a border, * so we must get the attributes of that window and use them * to determine our offsets. */ XGetWindowAttributes(dpy, parent, &wattr); NSDebugLLog(@"NSEvent", @"Parent border,width,height %d,%d,%d\n", wattr.border_width, wattr.width, wattr.height); l = xEvent.xreparent.x + wattr.border_width; t = xEvent.xreparent.y + wattr.border_width; /* Find total parent size and subtract window size and * top-left-corner offset to determine bottom-right-corner * offset. */ r = wattr.width + wattr.border_width * 2; r -= (cWin->xframe.size.width + l); b = wattr.height + wattr.border_width * 2; b -= (cWin->xframe.size.height + t); // Some window manager e.g. KDE2 put in multiple windows, // so we have to find the right parent, closest to root /* FIXME: This section of code has caused problems with certain users. An X error occurs in XQueryTree and later a seg fault in XFree. It's 'commented' out for now unless you set the default 'GSDoubleParentWindows' */ if (generic.flags.doubleParentWindow) { Window new_parent = parent; r = wattr.width + wattr.border_width * 2; b = wattr.height + wattr.border_width * 2; while (new_parent && (new_parent != cWin->root)) { Window root; Window *children; unsigned int nchildren; parent = new_parent; NSLog(@"QueryTree window is %lu (cwin root %lu)", parent, cWin->root); if (!XQueryTree(dpy, parent, &root, &new_parent, &children, &nchildren)) { new_parent = None; if (children) { NSLog(@"Bad pointer from failed X call?"); children = 0; } } if (children) { XFree(children); } if (new_parent && new_parent != cWin->root) { XWindowAttributes pattr; XGetWindowAttributes(dpy, parent, &pattr); l += pattr.x + pattr.border_width; t += pattr.y + pattr.border_width; r = pattr.width + pattr.border_width * 2; b = pattr.height + pattr.border_width * 2; } } /* while */ r -= (cWin->xframe.size.width + l); b -= (cWin->xframe.size.height + t); } /* generic.flags.doubleParentWindow */ o = generic.offsets + (cWin->win_attrs.window_style & 15); if (o->known == NO) { o->l = l; o->r = r; o->t = t; o->b = b; o->known = YES; /* FIXME: if offsets have changed, from previously guessed * versions, we should go through window list and fix up * hints. */ } else { BOOL changed = NO; if (l != o->l) { NSLog(@"Ignore left offset change from %d to %d", (int)o->l, (int)l); changed = YES; } if (r != o->r) { NSLog(@"Ignore right offset change from %d to %d", (int)o->r, (int)r); changed = YES; } if (t != o->t) { NSLog(@"Ignore top offset change from %d to %d", (int)o->t, (int)t); changed = YES; } if (b != o->b) { NSLog(@"Ignore bottom offset change from %d to %d", (int)o->b, (int)b); changed = YES; } if (changed == YES) { NSLog(@"Reparent was with offset %d %d\n", xEvent.xreparent.x, xEvent.xreparent.y); NSLog(@"Parent border,width,height %d,%d,%d\n", wattr.border_width, wattr.width, wattr.height); } } /* Work around a bug in Window Maker, which does not preserve * the document edited status and uses the wrong close button * when a window is shown again after hiding it */ if (generic.wm & XGWM_WINDOWMAKER) { /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, cWin->ident, generic._GNUSTEP_WM_ATTR_ATOM, generic._GNUSTEP_WM_ATTR_ATOM, 32, PropModeReplace, (unsigned char *)&cWin->win_attrs, sizeof(GNUstepWMAttributes)/sizeof(CARD32)); } } break; // another client attempts to change the size of a window case ResizeRequest: NSDebugLLog(@"NSEvent", @"%lu ResizeRequest\n", xEvent.xresizerequest.window); break; // events dealing with the selection case SelectionClear: NSDebugLLog(@"NSEvent", @"%lu SelectionClear\n", xEvent.xselectionclear.window); break; case SelectionNotify: NSDebugLLog(@"NSEvent", @"%lu SelectionNotify\n", xEvent.xselection.requestor); break; case SelectionRequest: NSDebugLLog(@"NSEvent", @"%lu SelectionRequest\n", xEvent.xselectionrequest.requestor); { NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSDragPboard]; NSArray *types = [pb types]; NSData *data = nil; Atom xType = xEvent.xselectionrequest.target; if (((xType == generic.UTF8_STRING_ATOM) || (xType == XA_STRING) || (xType == generic.TEXT_ATOM)) && [types containsObject: NSStringPboardType]) { NSString *s = [pb stringForType: NSStringPboardType]; if (xType == generic.UTF8_STRING_ATOM) { data = [s dataUsingEncoding: NSUTF8StringEncoding]; } else if ((xType == XA_STRING) || (xType == generic.TEXT_ATOM)) { data = [s dataUsingEncoding: NSISOLatin1StringEncoding]; } } // FIXME: Add support for more types. See: xpbs.m if (data != nil) { DndClass dnd = xdnd(); // Send the data to the other process xdnd_selection_send(&dnd, &xEvent.xselectionrequest, (unsigned char *)[data bytes], [data length]); } } break; // We shouldn't get here unless we forgot to trap an event above default: #ifdef XSHM if (xEvent.type == XShmGetEventBase(dpy)+ShmCompletion && [gcontext respondsToSelector: @selector(gotShmCompletion:)]) { [gcontext gotShmCompletion: ((XShmCompletionEvent *)&xEvent)->drawable]; break; } #endif #ifdef HAVE_XRANDR int randr_event_type = randrEventBase + RRScreenChangeNotify; if (xEvent.type == randr_event_type && (xEvent.xconfigure.window == RootWindow(dpy, defScreen))) { // Check if other RandR events are waiting in the queue. XSync(dpy, 0); while (XCheckTypedEvent(dpy, randr_event_type, &xEvent)) {;} XRRUpdateConfiguration(event); // Regenerate NSScreens [NSScreen resetScreens]; // Notify application about screen parameters change [[NSNotificationCenter defaultCenter] postNotificationName: NSApplicationDidChangeScreenParametersNotification object: NSApp]; } break; #endif NSLog(@"Received an untrapped event\n"); break; } if (e) { [event_queue addObject: e]; } e = nil; } /* * WM is asking us to take the keyboard focus */ - (NSEvent *)_handleTakeFocusAtom: (XEvent)xEvent forContext: (NSGraphicsContext *)gcontext { NSWindow *keyWindow = [NSApp keyWindow]; int key_num = [keyWindow windowNumber]; NSEvent *e = nil; NSDebugLLog(@"Focus", @"TakeFocus received by: %li (%lu) (focused = %lu, key = %d)", cWin->number, xEvent.xfocus.window, generic.currentFocusWindow, key_num); /* Invalidate the previous request. It's possible the app lost focus before this request was fufilled and we are being focused again, or ??? */ { generic.focusRequestNumber = 0; generic.desiredFocusWindow = 0; } /* Sometimes window managers lose the setinputfocus on the key window * e.g. when ordering out a window with focus then ordering in the key window. * it might search for a window until one accepts its take focus request. */ if (key_num == 0) { cWin->ignore_take_focus = NO; } else if (cWin->number == [[[NSApp mainMenu] window] windowNumber]) { cWin->ignore_take_focus = NO; } /* We'd like to send this event directly to the front-end to handle, but the front-end polls events so slowly compared the speed at which X events could potentially come that we could easily get out of sync, particularly when there are a lot of window events */ if ([NSApp isHidden]) { if (generic.wm & XGWM_WINDOWMAKER) { /* If window receives WM_TAKE_FOCUS and application is in hidden state - it's time to unhide. There's no other method to tell us to unhide. */ NSDebugLLog(@"Focus", @"WM take focus while hidden - unhiding."); [NSApp unhide: nil]; } else { /* This often occurs when hidding an app, since a bunch of windows get hidden at once, and the WM is searching for a window to take focus after each one gets hidden. */ NSDebugLLog(@"Focus", @"WM take focus while hiding"); } } else if (cWin->ignore_take_focus == YES) { NSDebugLLog(@"Focus", @"Ignoring window focus request"); cWin->ignore_take_focus = NO; } else if (cWin->number == key_num) { NSDebugLLog(@"Focus", @"Reasserting key window"); [GSServerForWindow(keyWindow) setinputfocus: key_num]; } else if (key_num && cWin->number == [[[NSApp mainMenu] window] windowNumber]) { gswindow_device_t *key_window = [XGServer _windowWithTag:key_num]; /* This might occur when the window manager just wants someone to become key, so it tells the main menu (typically the first menu in the list), but since we already have a window that was key before, use that instead */ NSDebugLLog(@"Focus", @"Key window is already %d", key_num); if (key_window->map_state == IsUnmapped) { /* `key_window` was unmapped by window manager. this window and `key_window` are on the different workspace. */ [GSServerForWindow(keyWindow) setinputfocus: cWin->number]; } else { [GSServerForWindow(keyWindow) setinputfocus: key_num]; } } else { NSPoint eventLocation; /* * Here the app asked for this (if keyWindow==nil) or there was a * click on the title bar or some other reason (window mapped, * etc). We don't necessarily want to forward the event for the * last reason but we just have to deal with that since we can * never be sure if it's necessary. */ eventLocation = NSMakePoint(0,0); e = [NSEvent otherEventWithType:NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: 0 windowNumber: cWin->number context: gcontext subtype: GSAppKitWindowFocusIn data1: 0 data2: 0]; } return e; } // Return the key_sym corresponding to the user defaults string given, // or fallback if no default is registered. static KeySym key_sym_from_defaults (Display *display, NSUserDefaults *defaults, NSString *keyDefaultKey, KeySym fallback) { NSString *keyDefaultName; KeySym key_sym; keyDefaultName = [defaults stringForKey: keyDefaultKey]; if (keyDefaultName == nil) return fallback; key_sym = XStringToKeysym ([keyDefaultName cString]); #if 0 if (key_sym == NoSymbol && [keyDefaultName intValue] > 0) { key_sym = [keyDefaultName intValue]; } #endif if (key_sym == NoSymbol) { // This is not necessarily an error. // If you want on purpose to disable a key, // set its default to 'NoSymbol'. NSLog (@"KeySym %@ not found; disabling %@", keyDefaultName, keyDefaultKey); } return key_sym; } // This function should be called before any keyboard event is dealed with. static void initialize_keyboard (void) { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; Display *display = [XGServer xDisplay]; // Below must be stored and checked as keysyms, not keycodes, since // more than one keycode may be mapped t the same keysym // Initialize Control _control_keysyms[0] = key_sym_from_defaults(display, defaults, @"GSFirstControlKey", XK_Control_L); _control_keysyms[1] = key_sym_from_defaults(display, defaults, @"GSSecondControlKey", XK_Control_R); if (_control_keysyms[0] == _control_keysyms[1]) _control_keysyms[1] = NoSymbol; // Initialize Command _command_keysyms[0] = key_sym_from_defaults(display, defaults, @"GSFirstCommandKey", XK_Alt_L); _command_keysyms[1] = key_sym_from_defaults(display, defaults, @"GSSecondCommandKey", NoSymbol); if (_command_keysyms[0] == _command_keysyms[1]) _command_keysyms[1] = NoSymbol; // Initialize Alt _alt_keysyms[0] = key_sym_from_defaults(display, defaults, @"GSFirstAlternateKey", XK_Alt_R); if (XKeysymToKeycode(display, _alt_keysyms[0]) == 0) _alt_keysyms[0] = XK_Mode_switch; _alt_keysyms[1] = key_sym_from_defaults(display, defaults, @"GSSecondAlternateKey", NoSymbol); if (_alt_keysyms[0] == _alt_keysyms[1]) _alt_keysyms[1] = NoSymbol; // Initialize Help _help_keysyms[0] = key_sym_from_defaults(display, defaults, @"GSFirstHelpKey", XK_Help); if (XKeysymToKeycode(display, _help_keysyms[0]) == 0) _help_keysyms[0] = NoSymbol; _help_keysyms[1] = key_sym_from_defaults(display, defaults, @"GSSecondHelpKey", XK_Super_L); if (_help_keysyms[0] == _help_keysyms[1]) _help_keysyms[1] = NoSymbol; set_up_num_lock (); _mod_ignore_shift = ![defaults boolForKey: @"GSModifiersAreNotKeys"]; _is_keyboard_initialized = YES; } static void set_up_num_lock (void) { XModifierKeymap *modifier_map; int i, j; unsigned int modifier_masks[8] = { ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask }; Display *display = [XGServer xDisplay]; KeyCode _num_lock_keycode; // Get NumLock keycode _num_lock_keycode = XKeysymToKeycode (display, XK_Num_Lock); if (_num_lock_keycode == 0) { // Weird. There is no NumLock in this keyboard. _num_lock_mask = 0; return; } // Get the current modifier mapping modifier_map = XGetModifierMapping (display); // Scan the modifiers for NumLock for (j = 0; j < 8; j++) for (i = 0; i < (modifier_map->max_keypermod); i++) { if ((modifier_map->modifiermap)[i + j*modifier_map->max_keypermod] == _num_lock_keycode) { _num_lock_mask = modifier_masks[j]; XFreeModifiermap (modifier_map); return; } } // Weird. NumLock is not among the modifiers _num_lock_mask = 0; XFreeModifiermap (modifier_map); return; } static BOOL keysym_is_X_modifier (KeySym keysym) { switch (keysym) { case XK_Num_Lock: case XK_Caps_Lock: case XK_Shift_Lock: return YES; default: return NO; } } static NSEvent* process_key_event (XEvent* xEvent, XGServer* context, NSEventType eventType, NSMutableArray *event_queue, BOOL keyRepeat) { NSString *keys, *ukeys; KeySym keysym; NSPoint eventLocation; unsigned short keyCode; unsigned int eventFlags; unichar unicode; NSEvent *event = nil; NSEventType originalType; gswindow_device_t *window; int shift_key = 0; int control_key = 0; int command_key = 0; int alt_key = 0; int help_key = 0; KeySym modKeysym; // process modifier independently of shift, etc. if (_is_keyboard_initialized == NO) initialize_keyboard (); window = [XGServer _windowWithTag: [[NSApp keyWindow] windowNumber]]; if (!window) { // No key event if we don't have a key window return nil; } /* Process location */ eventLocation.x = xEvent->xbutton.x; eventLocation.y = xEvent->xbutton.y; eventLocation = [context _XPointToOSPoint: eventLocation for: window]; /* Process characters */ keys = [context->inputServer lookupStringForEvent: (XKeyEvent *)xEvent window: window keysym: &keysym]; /* Process keycode */ keyCode = ((XKeyEvent *)xEvent)->keycode; //ximKeyCode = XKeysymToKeycode([XGServer currentXDisplay],keysym); /* Process NSFlagsChanged events. We can't use a switch because we are not comparing to constants. Make sure keySym is not NoSymbol since XIM events can potentially return this. */ /* Possibly ignore shift/other modifier state in determining KeySym to work around correct but undesired behavior with shifted modifiers. See Back defaults documentation for "GSModifiersAreNotKeys". */ modKeysym = (_mod_ignore_shift == YES) ? XLookupKeysym((XKeyEvent *)xEvent, 0) : keysym; if (modKeysym != NoSymbol) { if (modKeysym == XK_Shift_L) { shift_key = 1; } else if (modKeysym == XK_Shift_R) { shift_key = 2; } else if (modKeysym == _control_keysyms[0]) { control_key = 1; } else if (modKeysym == _control_keysyms[1]) { control_key = 2; } else if (modKeysym == _command_keysyms[0]) { command_key = 1; } else if (modKeysym == _command_keysyms[1]) { command_key = 2; } else if (modKeysym == _alt_keysyms[0]) { alt_key = 1; } else if (modKeysym == _alt_keysyms[1]) { alt_key = 2; } else if (modKeysym == _help_keysyms[0]) { help_key = 1; } else if (modKeysym == _help_keysyms[1]) { help_key = 2; } } originalType = eventType; if (shift_key || control_key || command_key || alt_key || help_key) { eventType = NSFlagsChanged; if (xEvent->xkey.type == KeyPress) { if (shift_key) _shift_pressed |= shift_key; if (control_key) _control_pressed |= control_key; if (command_key) _command_pressed |= command_key; if (alt_key) _alt_pressed |= alt_key; if (help_key) _help_pressed |= help_key; } else if (xEvent->xkey.type == KeyRelease) { if (shift_key) _shift_pressed &= ~shift_key; if (control_key) _control_pressed &= ~control_key; if (command_key) _command_pressed &= ~command_key; if (alt_key) _alt_pressed &= ~alt_key; if (help_key) _help_pressed &= ~help_key; } } /* Process modifiers */ eventFlags = process_modifier_flags (xEvent->xkey.state); /* Add NSNumericPadKeyMask if the key is in the KeyPad */ if (IsKeypadKey (keysym)) eventFlags = eventFlags | NSNumericPadKeyMask; NSDebugLLog (@"NSKeyEvent", @"keysym=%lu, keyCode=%d flags=%d (state=%d)", keysym, keyCode, eventFlags, ((XKeyEvent *)xEvent)->state); /* Add NSFunctionKeyMask if the key is a function or a misc function key */ /* We prefer not to do this and do it manually in process_char because X's idea of what is a function key seems to be different from OPENSTEP's one */ /* if (IsFunctionKey (keysym) || IsMiscFunctionKey (keysym)) eventFlags = eventFlags | NSFunctionKeyMask; */ /* First, check to see if the key event if a Shift, NumLock or CapsLock or ShiftLock keypress/keyrelease. If it is, then use a NSFlagsChanged event type. This will generate a NSFlagsChanged event each time you press/release a shift key, even if the flags haven't actually changed. I don't see this as a problem - if we didn't, the shift keypress/keyrelease event would never be notified to the application. NB - to know if shift was pressed, we need to check the X keysym - it doesn't work to compare the X modifier flags of this keypress X event with the ones of the previous one, because when you press Shift, the X shift keypress event has the *same* X modifiers flags as the X keypress event before it - only keypresses coming *after* the shift keypress will get a different X modifier mask. */ if (keysym_is_X_modifier (keysym)) { eventType = NSFlagsChanged; } if (help_key) { unicode = NSHelpFunctionKey; keys = [NSString stringWithCharacters: &unicode length: 1]; if (originalType == NSKeyDown) { event = [NSEvent keyEventWithType: NSKeyDown location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)xEvent->xkey.time / 1000.0 windowNumber: window->number context: GSCurrentContext() characters: keys charactersIgnoringModifiers: keys isARepeat: keyRepeat keyCode: keyCode]; [event_queue addObject: event]; event = [NSEvent keyEventWithType: NSFlagsChanged location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)xEvent->xkey.time / 1000.0 windowNumber: window->number context: GSCurrentContext() characters: keys charactersIgnoringModifiers: keys isARepeat: NO keyCode: keyCode]; return event; } else { event = [NSEvent keyEventWithType: NSFlagsChanged location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)xEvent->xkey.time / 1000.0 windowNumber: window->number context: GSCurrentContext() characters: keys charactersIgnoringModifiers: keys isARepeat: NO keyCode: keyCode]; [event_queue addObject: event]; event = [NSEvent keyEventWithType: NSKeyUp location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)xEvent->xkey.time / 1000.0 windowNumber: window->number context: GSCurrentContext() characters: keys charactersIgnoringModifiers: keys isARepeat: keyRepeat keyCode: keyCode]; return event; } } else { /* Now we get the unicode character for the pressed key using our * internal table. */ unicode = process_char (keysym, &eventFlags); /* If that didn't work, we use what X gave us */ if (unicode != 0) { keys = [NSString stringWithCharacters: &unicode length: 1]; } // Now the same ignoring modifiers, except Shift, ShiftLock, NumLock. xEvent->xkey.state = (xEvent->xkey.state & (ShiftMask | LockMask | _num_lock_mask)); ukeys = [context->inputServer lookupStringForEvent: (XKeyEvent *)xEvent window: window keysym: &keysym]; unicode = process_char (keysym, &eventFlags); if (unicode != 0) { ukeys = [NSString stringWithCharacters: &unicode length: 1]; } event = [NSEvent keyEventWithType: eventType location: eventLocation modifierFlags: eventFlags timestamp: (NSTimeInterval)xEvent->xkey.time / 1000.0 windowNumber: window->number context: GSCurrentContext() characters: keys charactersIgnoringModifiers: ukeys isARepeat: keyRepeat keyCode: keyCode]; return event; } } static unichar process_char (KeySym keysym, unsigned *eventModifierFlags) { switch (keysym) { /* NB: Whatever is explicitly put in this conversion table takes precedence over what is returned by XLookupString. Not sure this is a good idea for latin-1 character input. */ case XK_Return: return NSCarriageReturnCharacter; case XK_KP_Enter: return NSEnterCharacter; case XK_Linefeed: return NSFormFeedCharacter; case XK_Tab: return NSTabCharacter; #ifdef XK_XKB_KEYS case XK_ISO_Left_Tab: return NSBackTabCharacter; #endif /* FIXME: The following line ? */ case XK_Escape: return 0x1b; case XK_BackSpace: return NSDeleteCharacter; /* The following keys need to be reported as function keys */ #define XGPS_FUNCTIONKEY \ *eventModifierFlags = *eventModifierFlags | NSFunctionKeyMask; case XK_F1: XGPS_FUNCTIONKEY return NSF1FunctionKey; case XK_F2: XGPS_FUNCTIONKEY return NSF2FunctionKey; case XK_F3: XGPS_FUNCTIONKEY return NSF3FunctionKey; case XK_F4: XGPS_FUNCTIONKEY return NSF4FunctionKey; case XK_F5: XGPS_FUNCTIONKEY return NSF5FunctionKey; case XK_F6: XGPS_FUNCTIONKEY return NSF6FunctionKey; case XK_F7: XGPS_FUNCTIONKEY return NSF7FunctionKey; case XK_F8: XGPS_FUNCTIONKEY return NSF8FunctionKey; case XK_F9: XGPS_FUNCTIONKEY return NSF9FunctionKey; case XK_F10: XGPS_FUNCTIONKEY return NSF10FunctionKey; case XK_F11: XGPS_FUNCTIONKEY return NSF11FunctionKey; case XK_F12: XGPS_FUNCTIONKEY return NSF12FunctionKey; case XK_F13: XGPS_FUNCTIONKEY return NSF13FunctionKey; case XK_F14: XGPS_FUNCTIONKEY return NSF14FunctionKey; case XK_F15: XGPS_FUNCTIONKEY return NSF15FunctionKey; case XK_F16: XGPS_FUNCTIONKEY return NSF16FunctionKey; case XK_F17: XGPS_FUNCTIONKEY return NSF17FunctionKey; case XK_F18: XGPS_FUNCTIONKEY return NSF18FunctionKey; case XK_F19: XGPS_FUNCTIONKEY return NSF19FunctionKey; case XK_F20: XGPS_FUNCTIONKEY return NSF20FunctionKey; case XK_F21: XGPS_FUNCTIONKEY return NSF21FunctionKey; case XK_F22: XGPS_FUNCTIONKEY return NSF22FunctionKey; case XK_F23: XGPS_FUNCTIONKEY return NSF23FunctionKey; case XK_F24: XGPS_FUNCTIONKEY return NSF24FunctionKey; case XK_F25: XGPS_FUNCTIONKEY return NSF25FunctionKey; case XK_F26: XGPS_FUNCTIONKEY return NSF26FunctionKey; case XK_F27: XGPS_FUNCTIONKEY return NSF27FunctionKey; case XK_F28: XGPS_FUNCTIONKEY return NSF28FunctionKey; case XK_F29: XGPS_FUNCTIONKEY return NSF29FunctionKey; case XK_F30: XGPS_FUNCTIONKEY return NSF30FunctionKey; case XK_F31: XGPS_FUNCTIONKEY return NSF31FunctionKey; case XK_F32: XGPS_FUNCTIONKEY return NSF32FunctionKey; case XK_F33: XGPS_FUNCTIONKEY return NSF33FunctionKey; case XK_F34: XGPS_FUNCTIONKEY return NSF34FunctionKey; case XK_F35: XGPS_FUNCTIONKEY return NSF35FunctionKey; case XK_Delete: XGPS_FUNCTIONKEY return NSDeleteFunctionKey; case XK_Home: XGPS_FUNCTIONKEY return NSHomeFunctionKey; case XK_Left: XGPS_FUNCTIONKEY return NSLeftArrowFunctionKey; case XK_Right: XGPS_FUNCTIONKEY return NSRightArrowFunctionKey; case XK_Up: XGPS_FUNCTIONKEY return NSUpArrowFunctionKey; case XK_Down: XGPS_FUNCTIONKEY return NSDownArrowFunctionKey; // case XK_Prior: XGPS_FUNCTIONKEY return NSPrevFunctionKey; // case XK_Next: XGPS_FUNCTIONKEY return NSNextFunctionKey; case XK_End: XGPS_FUNCTIONKEY return NSEndFunctionKey; case XK_Begin: XGPS_FUNCTIONKEY return NSBeginFunctionKey; case XK_Select: XGPS_FUNCTIONKEY return NSSelectFunctionKey; case XK_Print: XGPS_FUNCTIONKEY return NSPrintFunctionKey; case XK_Execute: XGPS_FUNCTIONKEY return NSExecuteFunctionKey; case XK_Insert: XGPS_FUNCTIONKEY return NSInsertFunctionKey; case XK_Undo: XGPS_FUNCTIONKEY return NSUndoFunctionKey; case XK_Redo: XGPS_FUNCTIONKEY return NSRedoFunctionKey; case XK_Menu: XGPS_FUNCTIONKEY return NSMenuFunctionKey; case XK_Find: XGPS_FUNCTIONKEY return NSFindFunctionKey; case XK_Help: XGPS_FUNCTIONKEY return NSHelpFunctionKey; case XK_Break: XGPS_FUNCTIONKEY return NSBreakFunctionKey; case XK_Mode_switch: XGPS_FUNCTIONKEY return NSModeSwitchFunctionKey; case XK_Scroll_Lock: XGPS_FUNCTIONKEY return NSScrollLockFunctionKey; case XK_Pause: XGPS_FUNCTIONKEY return NSPauseFunctionKey; case XK_Clear: XGPS_FUNCTIONKEY return NSClearDisplayFunctionKey; #ifndef NeXT case XK_Page_Up: XGPS_FUNCTIONKEY return NSPageUpFunctionKey; case XK_Page_Down: XGPS_FUNCTIONKEY return NSPageDownFunctionKey; case XK_Sys_Req: XGPS_FUNCTIONKEY return NSSysReqFunctionKey; #endif case XK_KP_F1: XGPS_FUNCTIONKEY return NSF1FunctionKey; case XK_KP_F2: XGPS_FUNCTIONKEY return NSF2FunctionKey; case XK_KP_F3: XGPS_FUNCTIONKEY return NSF3FunctionKey; case XK_KP_F4: XGPS_FUNCTIONKEY return NSF4FunctionKey; #ifndef NeXT case XK_KP_Home: XGPS_FUNCTIONKEY return NSHomeFunctionKey; case XK_KP_Left: XGPS_FUNCTIONKEY return NSLeftArrowFunctionKey; case XK_KP_Up: XGPS_FUNCTIONKEY return NSUpArrowFunctionKey; case XK_KP_Right: XGPS_FUNCTIONKEY return NSRightArrowFunctionKey; case XK_KP_Down: XGPS_FUNCTIONKEY return NSDownArrowFunctionKey; // case XK_KP_Prior: return NSPrevFunctionKey; case XK_KP_Page_Up: XGPS_FUNCTIONKEY return NSPageUpFunctionKey; // case XK_KP_Next: return NSNextFunctionKey; case XK_KP_Page_Down: XGPS_FUNCTIONKEY return NSPageDownFunctionKey; case XK_KP_End: XGPS_FUNCTIONKEY return NSEndFunctionKey; case XK_KP_Begin: XGPS_FUNCTIONKEY return NSBeginFunctionKey; case XK_KP_Insert: XGPS_FUNCTIONKEY return NSInsertFunctionKey; case XK_KP_Delete: XGPS_FUNCTIONKEY return NSDeleteFunctionKey; #endif #undef XGPS_FUNCTIONKEY default: return 0; } } // process_modifier_flags() determines which modifier keys (Command, Control, // Shift, and so forth) were held down while the event occured. static unsigned int process_modifier_flags(unsigned int state) { unsigned int eventModifierFlags = 0; if (_shift_pressed != 0) eventModifierFlags = eventModifierFlags | NSShiftKeyMask; if (state & LockMask) eventModifierFlags = eventModifierFlags | NSAlphaShiftKeyMask; if (_control_pressed != 0) eventModifierFlags = eventModifierFlags | NSControlKeyMask; if (_command_pressed != 0) eventModifierFlags = eventModifierFlags | NSCommandKeyMask; if (_alt_pressed != 0) eventModifierFlags = eventModifierFlags | NSAlternateKeyMask; if (_help_pressed != 0) eventModifierFlags = eventModifierFlags | NSHelpKeyMask; // Other modifiers ignored for now. return eventModifierFlags; } - (NSDate*) timedOutEvent: (void*)data type: (RunLoopEventType)type forMode: (NSString*)mode { return nil; } /* Drag and Drop */ - (id )dragInfo { return [XGDragView sharedDragView]; } @end @implementation XGServer (XSync) - (BOOL) xSyncMap: (void*)windowHandle { gswindow_device_t *window = (gswindow_device_t*)windowHandle; /* * if the window is not mapped, make sure we have sent all requests to the * X-server, it may be that our mapping request was buffered. */ if (window->map_state != IsViewable) { XSync(dpy, False); [self receivedEvent: 0 type: 0 extra: 0 forMode: nil]; } /* * If the window is still not mapped, it may be that the window-manager * intercepted our mapping request, and hasn't dealt with it yet. * Listen for input for up to a second, in the hope of getting the mapping. */ if (window->map_state != IsViewable) { NSDate *d = [NSDate dateWithTimeIntervalSinceNow: 1.0]; NSRunLoop *l = [NSRunLoop currentRunLoop]; NSString *m = [l currentMode]; while (window->map_state != IsViewable && [d timeIntervalSinceNow] > 0) { [l runMode: m beforeDate: d]; } } if (window->map_state != IsViewable) { NSLog(@"Window still not mapped a second after mapping request made"); return NO; } return YES; } @end @implementation XGServer (X11Ops) /* * Return mouse location in base coords ignoring the event loop */ - (NSPoint) mouselocation { return [self mouseLocationOnScreen: defScreen window: NULL]; } - (NSPoint) mouseLocationOnScreen: (int)screen window: (int *)win { Window rootWin; Window childWin; int currentX; int currentY; int winX; int winY; unsigned mask; BOOL ok; NSPoint p; int height; int screen_id; ok = XQueryPointer (dpy, [self xDisplayRootWindow], &rootWin, &childWin, ¤tX, ¤tY, &winX, &winY, &mask); p = NSMakePoint(-1,-1); /* FIXME: After multi-monitor support will be implemented `screen` method parameter doesn't make sense. The `if{}` block should be removed since we have only one screen and mouse can't be placed on "wrong" screen. Also actually we need `height` of the whole Xlib screen (defScreen). */ if (ok == False) { /* Mouse not on the specified screen_number */ XWindowAttributes attribs; ok = XGetWindowAttributes(dpy, rootWin, &attribs); if (ok == False) { return p; } screen_id = XScreenNumberOfScreen(attribs.screen); if (screen >= 0 && screen != screen_id) { /* Mouse not on the requred screen, return an invalid point */ return p; } height = attribs.height; } else { height = xScreenSize.height; } p = NSMakePoint(currentX, height - currentY); if (win) { gswindow_device_t *w = [XGServer _windowForXWindow: childWin]; if (w == NULL) w = [XGServer _windowForXParent: childWin]; if (w) *win = w->number; else *win = 0; } return p; } - (NSEvent*) getEventMatchingMask: (unsigned)mask beforeDate: (NSDate*)limit inMode: (NSString*)mode dequeue: (BOOL)flag { [self receivedEvent: 0 type: 0 extra: 0 forMode: nil]; return [super getEventMatchingMask: mask beforeDate: limit inMode: mode dequeue: flag]; } - (void) discardEventsMatchingMask: (unsigned)mask beforeEvent: (NSEvent*)limit { [self receivedEvent: 0 type: 0 extra: 0 forMode: nil]; [super discardEventsMatchingMask: mask beforeEvent: limit]; } @end @implementation XGServer (TimeKeeping) // Sync time with X server every 10 seconds #define MAX_TIME_DIFF 10 // Regard an X time stamp as valid for half a second #define OUT_DATE_TIME_DIFF 0.5 - (void) setLastTime: (Time)last { if (generic.lastTimeStamp == 0 || generic.baseXServerTime + MAX_TIME_DIFF * 1000 < last) { // We have not sync'ed with the clock for at least // MAX_TIME_DIFF seconds ... so we do it now. generic.lastTimeStamp = [NSDate timeIntervalSinceReferenceDate]; generic.baseXServerTime = last; } else { // Optimisation to compute the new time stamp instead. generic.lastTimeStamp += (last - generic.lastTime) / 1000.0; } generic.lastTime = last; } - (Time) lastTime { // In the case of activation via DO the lastTime is outdated and cannot be used. if (generic.lastTimeStamp == 0 || ((generic.lastTimeStamp + OUT_DATE_TIME_DIFF) < [NSDate timeIntervalSinceReferenceDate])) { return CurrentTime; } else { return generic.lastTime; } } @end gnustep-back-0.29.0/Source/x11/XGServerWindow.m000066400000000000000000004304071404163720200211200ustar00rootroot00000000000000/* XGServerWindows - methods for window/screen handling Copyright (C) 1999-2020 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1999 This file is part of GNUstep 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_WRASTER_H #include "wraster.h" #else #include "x11/wraster.h" #endif // For X_HAVE_UTF8_STRING #include #include #if HAVE_XCURSOR #include #endif #ifdef HAVE_XSHAPE #include #endif #if HAVE_XFIXES #include #endif #ifdef HAVE_XRANDR #include #endif #include "x11/XGDragView.h" #include "x11/XGInputServer.h" #define ROOT generic.appRootWindow static BOOL handlesWindowDecorations = YES; static int _wmAppIcon = -1; #define WINDOW_WITH_TAG(windowNumber) (gswindow_device_t *)NSMapGet(windowtags, (void *)(uintptr_t)windowNumber) /* Current mouse grab window */ static gswindow_device_t *grab_window = NULL; /* Keep track of windows */ static NSMapTable *windowmaps = NULL; static NSMapTable *windowtags = NULL; /* Track used window numbers */ static int last_win_num = 0; @interface NSCursor (BackendPrivate) - (void *)_cid; @end @interface NSBitmapImageRep (GSPrivate) - (NSBitmapImageRep *) _convertToFormatBitsPerSample: (NSInteger)bps samplesPerPixel: (NSInteger)spp hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString*)colorSpaceName bitmapFormat: (NSBitmapFormat)bitmapFormat bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits; @end static NSBitmapImageRep *getStandardBitmap(NSImage *image) { NSBitmapImageRep *rep; if (image == nil) { return nil; } /* We should rather convert the image to a bitmap representation here via the following code, but this is currently not supported by the libart backend { NSSize size = [image size]; [image lockFocus]; rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: NSMakeRect(0, 0, size.width, size.height)]; AUTORELEASE(rep); [image unlockFocus]; } */ rep = (NSBitmapImageRep *)[image bestRepresentationForDevice: nil]; if (!rep || ![rep respondsToSelector: @selector(samplesPerPixel)]) { return nil; } else { // Convert into something usable by the backend return [rep _convertToFormatBitsPerSample: 8 samplesPerPixel: [rep hasAlpha] ? 4 : 3 hasAlpha: [rep hasAlpha] isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bitmapFormat: [rep bitmapFormat] bytesPerRow: 0 bitsPerPixel: 0]; } } void __objc_xgcontextwindow_linking (void) { } /* * The next two functions derived from WindowMaker by Alfredo K. Kojima */ static unsigned char* PropGetCheckProperty(Display *dpy, Window window, Atom hint, Atom type, int format, int count, int *retCount) { Atom type_ret; int fmt_ret; unsigned long nitems_ret; unsigned long bytes_after_ret; unsigned char *data; int tmp; if (count <= 0) { tmp = 0xffffff; } else { tmp = count; } if (XGetWindowProperty(dpy, window, hint, 0, tmp, False, type, &type_ret, &fmt_ret, &nitems_ret, &bytes_after_ret, (unsigned char **)&data)!=Success || !data) { return NULL; } if ((type != AnyPropertyType && type != type_ret) || (count > 0 && nitems_ret != (unsigned long)count) || (bytes_after_ret != 0) || (format != 0 && format != fmt_ret)) { NSLog(@"XGetWindowProperty type %lu type_ret %lu count %d count_ret %lu format %d format_ret %d bytes_after_ret %lu", type, type_ret, count, nitems_ret, format, fmt_ret, bytes_after_ret); XFree(data); return NULL; } if (retCount) { *retCount = nitems_ret; } return data; } static void setNormalHints(Display *d, gswindow_device_t *w) { if (w->siz_hints.flags & (USPosition | PPosition)) NSDebugLLog(@"XGTrace", @"Hint posn %lu: %d, %d", w->number, w->siz_hints.x, w->siz_hints.y); if (w->siz_hints.flags & (USSize | PSize)) NSDebugLLog(@"XGTrace", @"Hint size %lu: %d, %d", w->number, w->siz_hints.width, w->siz_hints.height); if (w->siz_hints.flags & PMinSize) NSDebugLLog(@"XGTrace", @"Hint mins %lu: %d, %d", w->number, w->siz_hints.min_width, w->siz_hints.min_height); if (w->siz_hints.flags & PMaxSize) NSDebugLLog(@"XGTrace", @"Hint maxs %lu: %d, %d", w->number, w->siz_hints.max_width, w->siz_hints.max_height); if (w->siz_hints.flags & PResizeInc) NSDebugLLog(@"XGTrace", @"Hint incr %lu: %d, %d", w->number, w->siz_hints.width_inc, w->siz_hints.height_inc); if (handlesWindowDecorations && !(w->win_attrs.window_style & NSResizableWindowMask)) { /* Some silly window managers (*cough* metacity *cough*) ignore our "non-resizable" hints unless we set the min and max sizes equal to the current size, hence the ugly code here. */ CARD32 oldFlags; int old_w0, old_h0, old_w1, old_h1; old_w0 = w->siz_hints.min_width; old_h0 = w->siz_hints.max_width; old_w1 = w->siz_hints.min_height; old_h1 = w->siz_hints.max_height; oldFlags = w->siz_hints.flags; w->siz_hints.flags |= PMinSize | PMaxSize; w->siz_hints.min_width = w->siz_hints.max_width = w->xframe.size.width; w->siz_hints.min_height = w->siz_hints.max_height = w->xframe.size.height; XSetWMNormalHints(d, w->ident, &w->siz_hints); w->siz_hints.min_width = old_w0; w->siz_hints.max_width = old_h0; w->siz_hints.min_height = old_w1; w->siz_hints.max_height = old_h1; w->siz_hints.flags = oldFlags; } else XSetWMNormalHints(d, w->ident, &w->siz_hints); } /* * Setting Motif Hints for Window Managers (Nicola Pero, July 2000) */ /* * Motif window hints to communicate to a window manager * that we want a window to have a titlebar/resize button/etc. */ /* Motif window hints struct */ typedef struct { unsigned long flags; unsigned long functions; unsigned long decorations; unsigned long input_mode; unsigned long status; } MwmHints; /* Number of entries in the struct */ #define PROP_MWM_HINTS_ELEMENTS 5 /* Now for each field in the struct, meaningful stuff to put in: */ /* flags */ #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_INPUT_MODE (1L << 2) #define MWM_HINTS_STATUS (1L << 3) /* functions */ #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) /* decorations */ #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) /* Now the code */ /* Set the style `styleMask' for the XWindow `window' using motif * window hints. This makes an X call, please make sure you do it * only once. */ static void setWindowHintsForStyle (Display *dpy, Window window, unsigned int styleMask, Atom mwhints_atom) { MwmHints *hints; BOOL needToFreeHints = YES; Atom type_ret; int format_ret, success; unsigned long nitems_ret; unsigned long bytes_after_ret; /* Get the already-set window hints */ success = XGetWindowProperty (dpy, window, mwhints_atom, 0, sizeof (MwmHints) / sizeof (unsigned long), False, AnyPropertyType, &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, (unsigned char **)&hints); /* If no window hints were set, create new hints to 0 */ if (success != Success || type_ret == None) { needToFreeHints = NO; hints = alloca (sizeof (MwmHints)); memset (hints, 0, sizeof (MwmHints)); } /* Remove the hints we want to change */ hints->flags &= ~MWM_HINTS_DECORATIONS; hints->flags &= ~MWM_HINTS_FUNCTIONS; hints->decorations = 0; hints->functions = 0; /* Now add to the hints from the styleMask */ if (styleMask == NSBorderlessWindowMask || !handlesWindowDecorations) { hints->flags |= MWM_HINTS_DECORATIONS; hints->flags |= MWM_HINTS_FUNCTIONS; hints->decorations = 0; hints->functions = 0; } else { /* These need to be on all windows except mini and icon windows, where they are specifically set to 0 (see below) */ hints->flags |= MWM_HINTS_DECORATIONS; hints->decorations |= (MWM_DECOR_TITLE | MWM_DECOR_BORDER); if (styleMask & NSTitledWindowMask) { // Without this, iceWM does not let you move the window! // [idem below] hints->flags |= MWM_HINTS_FUNCTIONS; hints->functions |= MWM_FUNC_MOVE; } if (styleMask & NSClosableWindowMask) { hints->flags |= MWM_HINTS_FUNCTIONS; hints->functions |= MWM_FUNC_CLOSE; hints->functions |= MWM_FUNC_MOVE; } if (styleMask & NSMiniaturizableWindowMask) { hints->flags |= MWM_HINTS_DECORATIONS; hints->flags |= MWM_HINTS_FUNCTIONS; hints->decorations |= MWM_DECOR_MINIMIZE; hints->functions |= MWM_FUNC_MINIMIZE; hints->functions |= MWM_FUNC_MOVE; } if (styleMask & NSResizableWindowMask) { hints->flags |= MWM_HINTS_DECORATIONS; hints->flags |= MWM_HINTS_FUNCTIONS; hints->decorations |= MWM_DECOR_RESIZEH; hints->decorations |= MWM_DECOR_MAXIMIZE; hints->functions |= MWM_FUNC_RESIZE; hints->functions |= MWM_FUNC_MAXIMIZE; hints->functions |= MWM_FUNC_MOVE; } if (styleMask & NSIconWindowMask) { // FIXME hints->flags |= MWM_HINTS_DECORATIONS; hints->flags |= MWM_HINTS_FUNCTIONS; hints->decorations = 0; hints->functions = 0; } if (styleMask & NSMiniWindowMask) { // FIXME hints->flags |= MWM_HINTS_DECORATIONS; hints->flags |= MWM_HINTS_FUNCTIONS; hints->decorations = 0; hints->functions = 0; } } /* Set the hints */ XChangeProperty (dpy, window, mwhints_atom, mwhints_atom, 32, PropModeReplace, (unsigned char *)hints, sizeof (MwmHints) / sizeof (unsigned long)); /* Free the hints if allocated by the X server for us */ if (needToFreeHints == YES) XFree (hints); } /* * End of motif hints for window manager code */ BOOL AtomPresentAndPointsToItself(Display *dpy, Atom atom, Atom type) { int count; BOOL result = NO; Window root = DefaultRootWindow(dpy); Window *win = (Window*)PropGetCheckProperty(dpy, root, atom, type, 32, -1, &count); if (win != 0) { Window *win1 = (Window*)PropGetCheckProperty(dpy, *win, atom, type, 32, -1, &count); // If the two are not identical, the flag on the root window, was // a left over from an old window manager. if (win1 && *win1 == *win) { result= YES; } if (win1) { XFree(win1); } XFree(win); } return result; } @interface XGServer (WindowOps) - (gswindow_device_t *) _rootWindow; - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b : (unsigned int) style : (Window) win; - (void) _setSupportedWMProtocols: (gswindow_device_t *) window; @end @implementation XGServer (WindowOps) - (BOOL) handlesWindowDecorations { return handlesWindowDecorations; } /* * Where a window has been reparented by the wm, we use this method to * locate the window given knowledge of its border window. */ + (gswindow_device_t *) _windowForXParent: (Window)xWindow { NSMapEnumerator enumerator; void *key; gswindow_device_t *d; enumerator = NSEnumerateMapTable(windowmaps); while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&d) == YES) { if (d->root != d->parent && d->parent == xWindow) { return d; } } return 0; } + (gswindow_device_t *) _windowForXWindow: (Window)xWindow { return NSMapGet(windowmaps, (void *)xWindow); } + (gswindow_device_t *) _windowWithTag: (int)windowNumber { return WINDOW_WITH_TAG(windowNumber); } /* * Convert a window frame in OpenStep absolute screen coordinates to * a frame in X absolute screen coordinates by flipping an applying * offsets to allow for the X window decorations. * The result is the rectangle of the window we can actually draw * to (in the X coordinate system). */ - (NSRect) _OSFrameToXFrame: (NSRect)o for: (void*)window { gswindow_device_t *win = (gswindow_device_t*)window; unsigned int style = win->win_attrs.window_style; NSRect x; float t, b, l, r; [self styleoffsets: &l : &r : &t : &b : style : win->ident]; x.size.width = o.size.width - l - r; x.size.height = o.size.height - t - b; x.origin.x = o.origin.x + l; x.origin.y = o.origin.y + o.size.height - t; x.origin.y = xScreenSize.height - x.origin.y; NSDebugLLog(@"Frame", @"O2X %lu, %x, %@, %@", win->number, style, NSStringFromRect(o), NSStringFromRect(x)); return x; } /* * Convert a window frame in OpenStep absolute screen coordinates to * a frame suitable for setting X hints for a window manager. * NB. Hints use the coordinates of the parent decoration window, * but the size of the actual window. */ - (NSRect) _OSFrameToXHints: (NSRect)o for: (void*)window { gswindow_device_t *win = (gswindow_device_t*)window; unsigned int style = win->win_attrs.window_style; NSRect x; float t, b, l, r; [self styleoffsets: &l : &r : &t : &b : style : win->ident]; x.size.width = o.size.width - l - r; x.size.height = o.size.height - t - b; x.origin.x = o.origin.x; x.origin.y = o.origin.y + o.size.height; x.origin.y = xScreenSize.height - x.origin.y; NSDebugLLog(@"Frame", @"O2H %lu, %x, %@, %@", win->number, style, NSStringFromRect(o), NSStringFromRect(x)); return x; } /* * Convert a rectangle in X coordinates relative to the X-window * to a rectangle in OpenStep coordinates (base coordinates of the NSWindow). */ - (NSRect) _XWinRectToOSWinRect: (NSRect)x for: (void*)window { gswindow_device_t *win = (gswindow_device_t*)window; unsigned int style = win->win_attrs.window_style; NSRect o; float t, b, l, r; [self styleoffsets: &l : &r : &t : &b : style : win->ident]; o.size.width = x.size.width; o.size.height = x.size.height; o.origin.x = x.origin.x + l; o.origin.y = NSHeight(win->xframe) - (x.origin.y + x.size.height); o.origin.y = o.origin.y + b; NSDebugLLog(@"Frame", @"XW2OW %@ %@", NSStringFromRect(x), NSStringFromRect(o)); return o; } /* * Convert a window frame in X absolute screen coordinates to a frame * in OpenStep absolute screen coordinates by flipping an applying * offsets to allow for the X window decorations. */ - (NSRect) _XFrameToOSFrame: (NSRect)x for: (void*)window { gswindow_device_t *win = (gswindow_device_t*)window; unsigned int style = win->win_attrs.window_style; NSRect o; float t, b, l, r; [self styleoffsets: &l : &r : &t : &b : style : win->ident]; o = x; o.origin.y = xScreenSize.height - x.origin.y; o.origin.y = o.origin.y - x.size.height - b; o.origin.x -= l; o.size.width += l + r; o.size.height += t + b; NSDebugLLog(@"Frame", @"X2O %lu, %x, %@, %@", win->number, style, NSStringFromRect(x), NSStringFromRect(o)); return o; } /* * Convert a window frame in X absolute screen coordinates to * a frame suitable for setting X hints for a window manager. */ - (NSRect) _XFrameToXHints: (NSRect)o for: (void*)window { gswindow_device_t *win = (gswindow_device_t*)window; unsigned int style = win->win_attrs.window_style; NSRect x; float t, b, l, r; [self styleoffsets: &l : &r : &t : &b : style : win->ident]; /* WARNING: if we adjust the frame size we get problems, * but we do seem to need to adjust the position to allow for * decorations. */ x.size.width = o.size.width; x.size.height = o.size.height; x.origin.x = o.origin.x - l; x.origin.y = o.origin.y - t; NSDebugLLog(@"Frame", @"X2H %lu, %x, %@, %@", win->number, style, NSStringFromRect(o), NSStringFromRect(x)); return x; } - (void)_sendRoot: (Window)root type: (Atom)type window: (Window)window data0: (long)data0 data1: (long)data1 data2: (long)data2 data3: (long)data3 { XEvent event; memset(&event, 0, sizeof(event)); event.xclient.type = ClientMessage; event.xclient.message_type = type; event.xclient.format = 32; event.xclient.display = dpy; event.xclient.window = window; event.xclient.data.l[0] = data0; event.xclient.data.l[1] = data1; event.xclient.data.l[2] = data2; event.xclient.data.l[3] = data3; XSendEvent(dpy, root, False, (SubstructureNotifyMask|SubstructureRedirectMask), &event); XFlush(dpy); } /* * Check if the window manager supports a feature. */ - (BOOL) _checkWMSupports: (Atom)feature { Window root; int count; Atom *data; if ((generic.wm & XGWM_EWMH) == 0) { return NO; } root = DefaultRootWindow(dpy); data = (Atom*)PropGetCheckProperty(dpy, root, generic._NET_SUPPORTED_ATOM, XA_ATOM, 32, -1, &count); if (data != 0) { int i = 0; while (i < count && data[i] != feature) { i++; } XFree(data); if (i < count) { return YES; } } return NO; } static void select_input(Display *display, Window w, BOOL ignoreMouse) { long event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | StructureNotifyMask | FocusChangeMask /* enable property notifications to detect window (de)miniaturization */ | PropertyChangeMask // | ColormapChangeMask | KeymapStateMask | VisibilityChangeMask; if (!ignoreMouse) { event_mask |= ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask; } XSelectInput(display, w, event_mask); } Bool _get_next_prop_new_event(Display *display, XEvent *event, char *arg) { XID *data = (XID*)arg; if (event->type == PropertyNotify && event->xproperty.window == data[0] && event->xproperty.atom == data[1] && event->xproperty.state == PropertyNewValue) { return True; } else { return False; } } - (BOOL) _tryRequestFrameExtents: (gswindow_device_t *)window { XEvent xEvent; XID event_data[2]; NSDate *limit; if (![self _checkWMSupports: generic._NET_REQUEST_FRAME_EXTENTS_ATOM]) { return NO; } [self _sendRoot: window->root type: generic._NET_REQUEST_FRAME_EXTENTS_ATOM window: window->ident data0: 0 data1: 0 data2: 0 data3: 0]; event_data[0] = window->ident; event_data[1] = generic._NET_FRAME_EXTENTS_ATOM; limit = [NSDate dateWithTimeIntervalSinceNow: 1.0]; while ([limit timeIntervalSinceNow] > 0.0) { if (XCheckTypedWindowEvent(dpy, window->ident, DestroyNotify, &xEvent)) { return NO; } else if (XCheckIfEvent(dpy, &xEvent, _get_next_prop_new_event, (char*)(&event_data))) { return YES; } else { CREATE_AUTORELEASE_POOL(pool); [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; IF_NO_GC([pool release]); } } return NO; } - (unsigned long*) _getExtents: (Window)win { int count; unsigned long *extents; /* If our window manager supports _NET_FRAME_EXTENTS we trust that as * definitive information. */ extents = (unsigned long *)PropGetCheckProperty(dpy, win, generic._NET_FRAME_EXTENTS_ATOM, XA_CARDINAL, 32, 4, &count); if (extents != 0) { NSDebugLLog(@"Offset", @"Offsets retrieved from _NET_FRAME_EXTENTS"); } if (extents == 0) { /* If our window manager supports _KDE_NET_WM_FRAME_STRUT we assume * its as reliable as _NET_FRAME_EXTENTS */ extents = (unsigned long *)PropGetCheckProperty(dpy, win, generic._KDE_NET_WM_FRAME_STRUT_ATOM, XA_CARDINAL, 32, 4, &count); if (extents!= 0) { NSDebugLLog(@"Offset", @"Offsets retrieved from _KDE_NET_WM_FRAME_STRUT"); } } return extents; } - (BOOL) _checkStyle: (unsigned)style { gswindow_device_t *window; gswindow_device_t *root; NSRect frame; XGCValues values; unsigned long valuemask; XClassHint classhint; RContext *context; XEvent xEvent; unsigned long *extents; Offsets *o = generic.offsets + (style & 15); int repp = 0; int repx = 0; int repy = 0; BOOL onScreen; BOOL reparented = NO; NSDebugLLog(@"Offset", @"Checking offsets for style %d\n", style); onScreen = [[NSUserDefaults standardUserDefaults] boolForKey: @"GSBackChecksOffsetsOnScreen"]; root = [self _rootWindow]; context = [self screenRContext]; window = NSAllocateCollectable(sizeof(gswindow_device_t), NSScannedOption); memset(window, '\0', sizeof(gswindow_device_t)); window->display = dpy; window->screen_id = defScreen; window->win_attrs.flags |= GSWindowStyleAttr; window->win_attrs.window_style = style; if (onScreen == YES) { frame = NSMakeRect(100,100,100,100); } else { frame = NSMakeRect(-200,100,100,100); } window->xframe = frame; window->type = NSBackingStoreNonretained; window->root = root->ident; window->parent = root->ident; window->depth = context->depth; window->xwn_attrs.border_pixel = context->black; window->xwn_attrs.background_pixel = context->white; window->xwn_attrs.colormap = context->cmap; window->xwn_attrs.save_under = False; window->xwn_attrs.override_redirect = False; window->ident = XCreateWindow(dpy, window->root, NSMinX(frame), NSMinY(frame), NSWidth(frame), NSHeight(frame), 0, context->depth, CopyFromParent, context->visual, (CWColormap | CWBorderPixel | CWOverrideRedirect), &window->xwn_attrs); /* * Mark this as a GNUstep app with the current application name. */ classhint.res_name = "CheckWindowStyle"; classhint.res_class = "GNUstep"; XSetClassHint(dpy, window->ident, &classhint); window->map_state = IsUnmapped; window->visibility = 2; window->wm_state = WithdrawnState; // Create an X GC for the content view set it's colors values.foreground = window->xwn_attrs.background_pixel; values.background = window->xwn_attrs.background_pixel; values.function = GXcopy; valuemask = (GCForeground | GCBackground | GCFunction); window->gc = XCreateGC(dpy, window->ident, valuemask, &values); /* Set the X event mask */ select_input(dpy, window->ident, YES); /* * Initial attributes for any GNUstep window tell Window Maker not to * create an app icon for us. */ window->win_attrs.flags |= GSExtraFlagsAttr; window->win_attrs.extra_flags |= GSNoApplicationIconFlag; /* * Prepare size/position hints, but don't set them now - ordering * the window in should automatically do it. */ window->siz_hints.x = NSMinX(frame); window->siz_hints.y = NSMinY(frame); window->siz_hints.width = NSWidth(frame); window->siz_hints.height = NSHeight(frame); window->siz_hints.flags = USPosition|PPosition|USSize|PSize; // Always send GNUstepWMAttributes /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, window->ident, generic._GNUSTEP_WM_ATTR_ATOM, generic._GNUSTEP_WM_ATTR_ATOM, 32, PropModeReplace, (unsigned char *)&window->win_attrs, sizeof(GNUstepWMAttributes)/sizeof(CARD32)); // send to the WM window style hints if ((generic.wm & XGWM_WINDOWMAKER) == 0) { setWindowHintsForStyle(dpy, window->ident, style, generic._MOTIF_WM_HINTS_ATOM); } // Use the globally active input mode window->gen_hints.flags = InputHint; window->gen_hints.input = False; /* * Prepare the protocols supported by the window. * These protocols should be set on the window when it is ordered in. */ [self _setSupportedWMProtocols: window]; window->exposedRects = [NSMutableArray new]; window->region = XCreateRegion(); window->buffer = 0; window->alpha_buffer = 0; window->ic = 0; // make sure that new window has the correct cursor [self _initializeCursorForXWindow: window->ident]; /* * FIXME - should this be protected by a lock for thread safety? * generate a unique tag for this new window. */ do { last_win_num++; } while (last_win_num == 0 || WINDOW_WITH_TAG(last_win_num) != 0); window->number = last_win_num; // Insert window into the mapping NSMapInsert(windowmaps, (void*)(uintptr_t)window->ident, window); NSMapInsert(windowtags, (void*)(uintptr_t)window->number, window); [self _setWindowOwnedByServer: window->number]; if (![self _tryRequestFrameExtents: window]) { // Only display the window, if the window manager does not support // _NET_REQUEST_FRAME_EXTENTS [self orderwindow: NSWindowAbove : 0 : window->number]; XSync(dpy, False); while (XPending(dpy) > 0 || window->visibility > 1) { if (XPending(dpy) == 0) { NSDate *until; /* In theory, after executing XSync() all events resulting from * our window creation and ordering front should be available in * the X event queue. * However, it's possible that a window manager * could send some events after the XSync() has been satisfied, * so if we have not received a visibility notification * we can wait for up to a second for more events. */ until = [NSDate dateWithTimeIntervalSinceNow: 1.0]; while (XPending(dpy) == 0 && [until timeIntervalSinceNow] > 0.0) { CREATE_AUTORELEASE_POOL(pool); [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; IF_NO_GC([pool release]); } if (XPending(dpy) == 0) { NSLog(@"Waited for a second, but the X system never" @" made the window visible"); break; } } XNextEvent(dpy, &xEvent); NSDebugLLog(@"Offset", @"Testing ... event %d window %lu\n", xEvent.type, xEvent.xany.window); if (xEvent.xany.window != window->ident) { continue; } switch (xEvent.type) { case VisibilityNotify: window->visibility = xEvent.xvisibility.state; break; case ReparentNotify: NSDebugLLog(@"Offset", @"%lu ReparentNotify - offset %d %d\n", xEvent.xreparent.window, xEvent.xreparent.x, xEvent.xreparent.y); repp = xEvent.xreparent.parent; repx = xEvent.xreparent.x; repy = xEvent.xreparent.y; reparented = YES; break; } if (onScreen == NO && reparented == YES) { /* If we are not testing on screen, the window will never * become visible, so we only wait for it to be reparented * and hope that the reparenting indicates completion of * an window decoration. */ break; } } } extents = [self _getExtents: window->ident]; if (extents != 0) { o->l = extents[0]; o->r = extents[1]; o->t = extents[2]; o->b = extents[3]; o->known = YES; NSDebugLLog(@"Offset", @"Extents left %lu, right %lu, top %lu, bottom %lu", extents[0], extents[1], extents[2], extents[3]); XFree(extents); } else if (repp != 0) { NSDebugLLog(@"Offset", @"Offsets retrieved from ReparentNotify"); window->parent = repp; if (repp != window->root) { Window parent = repp; XWindowAttributes wattr; int l; int r; int t; int b; /* Get the WM offset info which we hope is the same * for all parented windows with the same style. * The coordinates in the event are insufficient to determine * the offsets as the new parent window may have a border, * so we must get the attributes of that window and use them * to determine our offsets. */ XGetWindowAttributes(dpy, parent, &wattr); NSDebugLLog(@"Offset", @"Parent border,width,height %d,%d,%d\n", wattr.border_width, wattr.width, wattr.height); l = repx + wattr.border_width; t = repy + wattr.border_width; // Some window manager e.g. KDE2 put in multiple windows, // so we have to find the right parent, closest to root /* FIXME: This section of code has caused problems with certain users. An X error occurs in XQueryTree and later a seg fault in XFree. It's 'commented' out for now unless you set the default 'GSDoubleParentWindows' or we are reparented to 0,0 (which presumably must mean that we have a double parent). */ if (generic.flags.doubleParentWindow == YES || (repx == 0 && repy == 0)) { Window new_parent = parent; Window root = window->root; while (new_parent && (new_parent != window->root)) { Window *children = 0; unsigned int nchildren; parent = new_parent; repx = wattr.x; repy = wattr.y; NSDebugLLog(@"Offset", @"QueryTree window is %lu (root %lu cwin root %lu)", parent, root, window->root); if (!XQueryTree(dpy, parent, &root, &new_parent, &children, &nchildren)) { new_parent = None; if (children) { NSLog(@"Bad pointer from failed X call?"); children = 0; } } if (children) { XFree(children); } if (new_parent && new_parent != window->root) { XGetWindowAttributes(dpy, new_parent, &wattr); l += repx + wattr.border_width; t += repy + wattr.border_width; } } /* while */ } /* generic.flags.doubleParentWindow */ /* Find total parent size and subtract window size and * top-left-corner offset to determine bottom-right-corner * offset. */ r = wattr.width + wattr.border_width * 2; r -= (window->xframe.size.width + l); b = wattr.height + wattr.border_width * 2; b -= (window->xframe.size.height + t); if ((l >= 0) && (r >= 0) && (t >= 0) && (b >= 0)) { o->l = (float)l; o->r = (float)r; o->t = (float)t; o->b = (float)b; o->known = YES; NSDebugLLog(@"Offset", @"Style %d lrtb set to %d,%d,%d,%d\n", style, l, r, t, b); } else { NSLog(@"Reparenting resulted in negative border %d, %d, %d, %d", l, r, t, b); } } } [self termwindow: window->number]; XSync(dpy, False); while (XPending(dpy) > 0) { XNextEvent(dpy, &xEvent); NSDebugLLog(@"Offset", @"Destroying ... event %d window %lu\n", xEvent.type, xEvent.xany.window); if (xEvent.xany.window != window->ident) { continue; } } if (o->known == NO) { NSLog(@"Failed to determine offsets for style %d", style); return NO; } return YES; } - (NSString *) windowManagerName { if (generic.wm & XGWM_WINDOWMAKER) { return @"WindowMaker"; } else if (generic.wm & XGWM_EWMH) { int count; Window *win = (Window*)PropGetCheckProperty(dpy, DefaultRootWindow(dpy), generic._NET_SUPPORTING_WM_CHECK_ATOM, XA_WINDOW, 32, -1, &count); char *name = (char *)PropGetCheckProperty(dpy, *win, generic._NET_WM_NAME_ATOM, generic.UTF8_STRING_ATOM, 0, 0, &count); if (name) { NSString *wm_name = [NSString stringWithUTF8String: name]; XFree(name); return wm_name; } } return nil; } - (XGWMProtocols) _checkWindowManager { int wmflags; Window root; Atom *data; int count; root = DefaultRootWindow(dpy); wmflags = XGWM_UNKNOWN; /* Check for WindowMaker */ data = (Atom*)PropGetCheckProperty(dpy, root, generic._WINDOWMAKER_WM_PROTOCOLS_ATOM, XA_ATOM, 32, -1, &count); if (data != 0) { int i = 0; while (i < count && data[i] != generic._WINDOWMAKER_NOTICEBOARD_ATOM) { i++; } XFree(data); if (i < count) { if (AtomPresentAndPointsToItself(dpy, generic._WINDOWMAKER_NOTICEBOARD_ATOM, XA_WINDOW)) { wmflags |= XGWM_WINDOWMAKER; } } else { wmflags |= XGWM_WINDOWMAKER; } } /* Now check for Gnome */ if (AtomPresentAndPointsToItself(dpy, generic._WIN_SUPPORTING_WM_CHECK_ATOM, XA_CARDINAL)) { wmflags |= XGWM_GNOME; } /* Now check for NET (EWMH) compliant window manager */ if (AtomPresentAndPointsToItself(dpy, generic._NET_SUPPORTING_WM_CHECK_ATOM, XA_WINDOW)) { wmflags |= XGWM_EWMH; } NSDebugLLog(@"WM", @"WM Protocols: WindowMaker=(%s) GNOME=(%s) EWMH=(%s)", (wmflags & XGWM_WINDOWMAKER) ? "YES" : "NO", (wmflags & XGWM_GNOME) ? "YES" : "NO", (wmflags & XGWM_EWMH) ? "YES" : "NO"); return wmflags; } - (gswindow_device_t *) _rootWindow { int x, y; unsigned int width, height; gswindow_device_t *window; /* Screen number is negative to avoid conflict with windows */ window = WINDOW_WITH_TAG(-defScreen); if (window) return window; window = NSAllocateCollectable(sizeof(gswindow_device_t), NSScannedOption); memset(window, '\0', sizeof(gswindow_device_t)); window->display = dpy; window->screen_id = defScreen; window->ident = RootWindow(dpy, defScreen); window->root = window->ident; window->type = NSBackingStoreNonretained; window->number = -defScreen; window->map_state = IsViewable; window->visibility = -1; window->wm_state = NormalState; window->monitor_id = 0; if (window->ident) { XGetGeometry(dpy, window->ident, &window->root, &x, &y, &width, &height, &window->border, &window->depth); } else { NSLog(@"Failed to get root window"); x = 0; y = 0; width = 0; height = 0; } window->xframe = NSMakeRect(x, y, width, height); NSMapInsert (windowtags, (void*)(uintptr_t)window->number, window); NSMapInsert (windowmaps, (void*)(uintptr_t)window->ident, window); return window; } /* Create the window and screen list if necessary, add the root window to the window list as window 0 */ - (void) _checkWindowlist { if (windowmaps) return; windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 20); windowtags = NSCreateMapTable(NSIntMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 20); } - (void) _setupMouse { int numButtons; unsigned char mouseNumbers[7]; unsigned char buttons[7] = { Button1, Button2, Button3, Button4, Button5, 6, 7 }; int masks[5] = { Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask }; /* * Get pointer information - so we know which mouse buttons we have. * With a two button */ numButtons = XGetPointerMapping(dpy, mouseNumbers, 7); if (numButtons > 7) { NSDebugLLog(@"XGTrace", @"Warning - mouse/pointer seems to have more than 7 buttons " @"(%d) - just using one to seven", numButtons); numButtons = 7; } generic.lMouse = buttons[0]; generic.lMouseMask = masks[0]; if (numButtons >= 7) { generic.scrollLeftMouse = buttons[5]; generic.scrollRightMouse = buttons[6]; } if (numButtons >= 5) { generic.upMouse = buttons[3]; generic.downMouse = buttons[4]; generic.rMouse = buttons[2]; generic.rMouseMask = masks[2]; generic.mMouse = buttons[1]; generic.mMouseMask = masks[1]; } else if (numButtons == 3) { // FIXME: Button4 and Button5 are ScrollWheel up and ScrollWheel down // generic.rMouse = buttons[numButtons-1]; // generic.rMouseMask = masks[numButtons-1]; generic.upMouse = 0; generic.downMouse = 0; generic.rMouse = buttons[2]; generic.rMouseMask = masks[2]; generic.mMouse = buttons[1]; generic.mMouseMask = masks[1]; } else if (numButtons == 2) { generic.upMouse = 0; generic.downMouse = 0; generic.rMouse = buttons[1]; generic.rMouseMask = masks[1]; generic.mMouse = 0; generic.mMouseMask = 0; } else if (numButtons == 1) { generic.upMouse = 0; generic.downMouse = 0; generic.rMouse = 0; generic.rMouseMask = 0; generic.mMouse = 0; generic.mMouseMask = 0; } else { NSLog(@"Warning - mouse/pointer seems to have NO buttons"); } } - (void) _setSupportedWMProtocols: (gswindow_device_t *) window { NSWindow *nswin = GSWindowWithNumber(window->number); window->numProtocols = 0; if (!nswin || [nswin canBecomeKeyWindow]) { window->protocols[window->numProtocols++] = generic.WM_TAKE_FOCUS_ATOM; } if ((window->win_attrs.window_style & NSClosableWindowMask) != 0) window->protocols[window->numProtocols++] = generic.WM_DELETE_WINDOW_ATOM; // Add ping protocol for EWMH if ((generic.wm & XGWM_EWMH) != 0) { window->protocols[window->numProtocols++] = generic._NET_WM_PING_ATOM; #ifdef HAVE_X11_EXTENSIONS_SYNC_H window->protocols[window->numProtocols++] = generic._NET_WM_SYNC_REQUEST_ATOM; #endif } if ((generic.wm & XGWM_WINDOWMAKER) != 0) { if ((window->win_attrs.window_style & NSMiniaturizableWindowMask) != 0) { window->protocols[window->numProtocols++] = generic._GNUSTEP_WM_MINIATURIZE_WINDOW_ATOM; } window->protocols[window->numProtocols++] = generic._GNUSTEP_WM_HIDE_APP_ATOM; } NSAssert1(window->numProtocols <= GSMaxWMProtocols, @"Too many protocols (%d > GSMaxWMProtocols)", window->numProtocols); XSetWMProtocols(dpy, window->ident, window->protocols, window->numProtocols); } - (void) _setupRootWindow { NSProcessInfo *pInfo = [NSProcessInfo processInfo]; NSArray *args; unsigned int i; unsigned int argc; char **argv; XClassHint classhint; XTextProperty windowName; NSUserDefaults *defs; const char *host_name = [[pInfo hostName] UTF8String]; /* * Initialize time of last events to be the start of time - not * the current time! */ generic.lastClick = 1; generic.lastMotion = 1; generic.lastTime = 1; /* * Set up standard atoms. */ #ifdef HAVE_XINTERNATOMS XInternAtoms(dpy, atom_names, sizeof(atom_names)/sizeof(char*), False, generic.atoms); #else { int atomCount; for (atomCount = 0; atomCount < sizeof(atom_names)/sizeof(char*); atomCount++) generic.atoms[atomCount] = XInternAtom(dpy, atom_names[atomCount], False); } #endif [self _setupMouse]; [self _checkWindowlist]; /* * determine window manager in use. */ generic.wm = [self _checkWindowManager]; if (generic.rootName == 0) { const char *str = [[pInfo processName] UTF8String]; int len = strlen(str) +1; generic.rootName = malloc(len); strncpy(generic.rootName, str, len); } /* * Now check user defaults. */ defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSBackHandlesWindowDecorations"]) { handlesWindowDecorations = [defs boolForKey: @"GSBackHandlesWindowDecorations"]; } else { if ([defs objectForKey: @"GSX11HandlesWindowDecorations"]) { handlesWindowDecorations = [defs boolForKey: @"GSX11HandlesWindowDecorations"]; } } generic.flags.useWindowMakerIcons = NO; if ((generic.wm & XGWM_WINDOWMAKER) != 0) { generic.flags.useWindowMakerIcons = YES; if ([defs objectForKey: @"UseWindowMakerIcons"] != nil && [defs boolForKey: @"UseWindowMakerIcons"] == NO) { generic.flags.useWindowMakerIcons = NO; } } generic.flags.appOwnsMiniwindow = YES; if ([defs objectForKey: @"GSAppOwnsMiniwindow"] != nil && [defs boolForKey: @"GSAppOwnsMiniwindow"] == NO) { generic.flags.appOwnsMiniwindow = NO; } generic.flags.doubleParentWindow = NO; if ([defs objectForKey: @"GSDoubleParentWindows"] != nil && [defs boolForKey: @"GSDoubleParentWindows"] == YES) { generic.flags.doubleParentWindow = YES; } /* * make app root window */ ROOT = XCreateSimpleWindow(dpy,RootWindow(dpy,defScreen),0,0,1,1,0,0,0); /* * set hints for root window */ { XWMHints gen_hints; gen_hints.flags = WindowGroupHint | StateHint; gen_hints.initial_state = WithdrawnState; gen_hints.window_group = ROOT; XSetWMHints(dpy, ROOT, &gen_hints); } /* * Mark this as a GNUstep app with the current application name. */ classhint.res_name = generic.rootName; classhint.res_class = "GNUstep"; XSetClassHint(dpy, ROOT, &classhint); /* * Set app name as root window title - probably unused unless * the window manager wants to keep us in a menu or something like that. */ XStringListToTextProperty((char**)&classhint.res_name, 1, &windowName); XSetWMName(dpy, ROOT, &windowName); XSetWMIconName(dpy, ROOT, &windowName); XFree(windowName.value); /* * Record the information used to start this app. * If we have a user default set up (eg. by the openapp script) use it. * otherwise use the process arguments. */ args = [defs arrayForKey: @"GSLaunchCommand"]; if (args == nil) { args = [pInfo arguments]; } argc = [args count]; argv = (char**)malloc(argc*sizeof(char*)); for (i = 0; i < argc; i++) { argv[i] = (char*)[[args objectAtIndex: i] UTF8String]; } XSetCommand(dpy, ROOT, argv, argc); free(argv); // Store the host name of the machine we a running on XStringListToTextProperty((char**)&host_name, 1, &windowName); XSetWMClientMachine(dpy, ROOT, &windowName); XFree(windowName.value); // Always send GNUstepWMAttributes { GNUstepWMAttributes win_attrs; /* * Tell WindowMaker not to set up an app icon for us - we'll make our own. */ win_attrs.flags = GSExtraFlagsAttr; win_attrs.extra_flags = GSNoApplicationIconFlag; /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, ROOT, generic._GNUSTEP_WM_ATTR_ATOM, generic._GNUSTEP_WM_ATTR_ATOM, 32, PropModeReplace, (unsigned char *)&win_attrs, sizeof(GNUstepWMAttributes)/sizeof(CARD32)); } if ((generic.wm & XGWM_EWMH) != 0) { // Store the id of our process long pid = [pInfo processIdentifier]; /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, ROOT, generic._NET_WM_PID_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&pid, 1); // FIXME: Need to set WM_CLIENT_MACHINE as well. } /* We need to determine the offsets between the actual decorated window * and the window we draw into. */ if (handlesWindowDecorations == YES) { unsigned i; int count; uint16_t *offsets; /* Offsets for NSBorderlessWindowMask *should* always be zero. * We record them in the offsets block only for consistency. */ generic.offsets[0].l = 0.0; generic.offsets[0].r = 0.0; generic.offsets[0].t = 0.0; generic.offsets[0].b = 0.0; generic.offsets[0].known = YES; /* We trust the _GNUSTEP_FRAME_OFFSETS values set on the root window * of the X server if present. * Of course, these could have changed if the window manager has * changed. (FIXME) * The GSIgnoreRootOffsets default turns off this trusting approach. */ if ([defs boolForKey: @"GSIgnoreRootOffsets"] == YES) { NSLog(@"Ignoring _GNUSTEP_FRAME_OFFSETS root window property."); offsets = 0; } else { offsets = (uint16_t *)PropGetCheckProperty(dpy, DefaultRootWindow(dpy), generic._GNUSTEP_FRAME_OFFSETS_ATOM, XA_CARDINAL, 16, 60, &count); } if (offsets == 0) { BOOL ok = YES; /* No offsets available on the root window ... so we test each * style of window to determine its offsets. */ for (i = 1; i < 16; i++) { if ([self _checkStyle: i] == NO) { ok = NO; // test failed for this style } } if (ok == YES) { uint16_t off[60]; /* We have obtained all the offsets, so we store them to * the root window so that other GNUstep applications don't * need to test to determine offsets. */ count = 0; for (i = 1; i < 16; i++) { off[count++] = (uint16_t)generic.offsets[i].l; off[count++] = (uint16_t)generic.offsets[i].r; off[count++] = (uint16_t)generic.offsets[i].t; off[count++] = (uint16_t)generic.offsets[i].b; } XChangeProperty(dpy, DefaultRootWindow(dpy), generic._GNUSTEP_FRAME_OFFSETS_ATOM, XA_CARDINAL, 16, PropModeReplace, (unsigned char *)off, 60); } } else { /* Got offsets from the root window. * Let's copy them into our local table. */ count = 0; for (i = 1; i < 16; i++) { generic.offsets[i].l = (float)(offsets[count++]); generic.offsets[i].r = (float)(offsets[count++]); generic.offsets[i].t = (float)(offsets[count++]); generic.offsets[i].b = (float)(offsets[count++]); generic.offsets[i].known = YES; } XFree(offsets); } } } /* Destroys all the windows and other window resources that belong to this context */ - (void) _destroyServerWindows { void *key; gswindow_device_t *d; NSMapEnumerator enumerator; NSMapTable *mapcopy; /* Have to get a copy, since termwindow will remove them from the map table */ mapcopy = NSCopyMapTableWithZone(windowtags, [self zone]); enumerator = NSEnumerateMapTable(mapcopy); while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&d) == YES) { if (d->display == dpy && d->ident != d->root) [self termwindow: (int)(intptr_t)key]; } NSFreeMapTable(mapcopy); } /* Sets up a backing pixmap when a window is created or resized. This is only done if the Window is buffered or retained. */ - (void) _createBuffer: (gswindow_device_t *)window { if (window->depth == 0) window->depth = DefaultDepth(dpy, window->screen_id); if (NSWidth(window->xframe) == 0 && NSHeight(window->xframe) == 0) { NSDebugLLog(@"NSWindow", @"Cannot create buffer for ZeroRect frame"); return; } window->buffer = XCreatePixmap(dpy, window->root, NSWidth(window->xframe), NSHeight(window->xframe), window->depth); if (!window->buffer) { NSLog(@"DPS Windows: Unable to create backing store\n"); return; } XFillRectangle(dpy, window->buffer, window->gc, 0, 0, NSWidth(window->xframe), NSHeight(window->xframe)); } /* * Code to build up a NET WM icon from our application icon */ -(BOOL) _createNetIcon: (NSImage*)image result: (long**)pixeldata size: (int*)size { NSBitmapImageRep *rep; int i, j, w, h, samples; unsigned char *data; int index; long *iconPropertyData; int iconSize; rep = getStandardBitmap(image); if (rep == nil) { NSLog(@"Wrong image type for WM icon"); return NO; } h = [rep pixelsHigh]; w = [rep pixelsWide]; samples = [rep samplesPerPixel]; data = [rep bitmapData]; iconSize = 2 + w * h; iconPropertyData = (long *)malloc(sizeof(long) * iconSize); if (iconPropertyData == NULL) { NSLog(@"No memory for WM icon"); return NO; } memset(iconPropertyData, 0, sizeof(long)*iconSize); index = 0; iconPropertyData[index++] = w; iconPropertyData[index++] = h; for (i = 0; i < h; i++) { unsigned char *d = data; for (j = 0; j < w; j++) { unsigned char A, R, G, B; // red R = d[0]; // green G = d[1]; // blue B = d[2]; // alpha if (samples == 4) { A = d[3]; } else { A = 255; } iconPropertyData[index++] = A << 24 | R << 16 | G << 8 | B; d += samples; } data += [rep bytesPerRow]; } *pixeldata = iconPropertyData; *size = iconSize; return YES; } - (void) _setNetWMIconFor: (Window) window { // We store the GNUstep application icon image in the window // and use that as our title bar icon. // FIXME: This code should rather use the window mini icon, // but currently this image is not available in the backend. static BOOL didCreateNetIcon = NO; static long *iconPropertyData = NULL; static int iconSize; NSImage *image; if (!didCreateNetIcon) { if (iconPropertyData != NULL) { free(iconPropertyData); } image = [NSApp applicationIconImage]; if (image != nil) { didCreateNetIcon = YES; [self _createNetIcon: image result: &iconPropertyData size: &iconSize]; } } if (iconPropertyData != 0) { XChangeProperty(dpy, window, generic._NET_WM_ICON_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)iconPropertyData, iconSize); } } - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style : (int)screen { gswindow_device_t *window; gswindow_device_t *root; XGCValues values; unsigned long valuemask; XClassHint classhint; RContext *context; NSDebugLLog(@"XGTrace", @"DPSwindow: %@ %d", NSStringFromRect(frame), (int)type); /* WindowMaker hack: Reuse the empty app icon allocated in _createWMAppiconHack * for the real app icon. */ if ((style & NSIconWindowMask) == NSIconWindowMask && _wmAppIcon != -1) { int win = _wmAppIcon; NSDebugLLog(@"XGTrace", @"WindowMaker hack: Returning window %d as app icon window", win); _wmAppIcon = -1; return win; } root = [self _rootWindow]; context = [self screenRContext]; /* Create the window structure and set the style early so we can use it to convert frames. */ window = NSAllocateCollectable(sizeof(gswindow_device_t), NSScannedOption); memset(window, '\0', sizeof(gswindow_device_t)); window->display = dpy; window->screen_id = defScreen; window->monitor_id = screen; window->win_attrs.flags |= GSWindowStyleAttr; if (handlesWindowDecorations) { window->win_attrs.window_style = style; } else { window->win_attrs.window_style = style & (NSIconWindowMask | NSMiniWindowMask); } frame = [self _OSFrameToXFrame: frame for: window]; /* We're not allowed to create a zero rect window */ if (NSWidth(frame) <= 0 || NSHeight(frame) <= 0) { frame.size.width = 2; frame.size.height = 2; } window->xframe = frame; window->type = type; window->root = root->ident; window->parent = root->ident; window->depth = context->depth; window->xwn_attrs.border_pixel = context->black; window->xwn_attrs.background_pixel = context->white; window->xwn_attrs.colormap = context->cmap; window->xwn_attrs.save_under = False; /* * Setting this to True should only be done, when we also grap the pointer. * It could be done for popup windows, but at this point we don't know * about the usage of the window. */ window->xwn_attrs.override_redirect = False; window->ident = XCreateWindow(dpy, window->root, NSMinX(frame), NSMinY(frame), NSWidth(frame), NSHeight(frame), 0, context->depth, CopyFromParent, context->visual, // Don't set the CWBackPixel, as the background of the // window may be different. (CWColormap | CWBorderPixel | CWOverrideRedirect), &window->xwn_attrs); /* * Mark this as a GNUstep app with the current application name. */ classhint.res_name = generic.rootName; classhint.res_class = "GNUstep"; XSetClassHint(dpy, window->ident, &classhint); window->map_state = IsUnmapped; window->visibility = -1; window->wm_state = WithdrawnState; // Create an X GC for the content view set it's colors values.foreground = window->xwn_attrs.background_pixel; values.background = window->xwn_attrs.background_pixel; values.function = GXcopy; valuemask = (GCForeground | GCBackground | GCFunction); window->gc = XCreateGC(dpy, window->ident, valuemask, &values); /* Set the X event mask */ select_input(dpy, window->ident, NO); /* * Initial attributes for any GNUstep window tell Window Maker not to * create an app icon for us. */ window->win_attrs.flags |= GSExtraFlagsAttr; window->win_attrs.extra_flags |= GSNoApplicationIconFlag; /* * Prepare size/position hints, but don't set them now - ordering * the window in should automatically do it. */ frame = [self _XFrameToXHints: window->xframe for: window]; window->siz_hints.x = NSMinX(frame); window->siz_hints.y = NSMinY(frame); window->siz_hints.width = NSWidth(frame); window->siz_hints.height = NSHeight(frame); window->siz_hints.flags = USPosition|PPosition|USSize|PSize; // Always send GNUstepWMAttributes /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, window->ident, generic._GNUSTEP_WM_ATTR_ATOM, generic._GNUSTEP_WM_ATTR_ATOM, 32, PropModeReplace, (unsigned char *)&window->win_attrs, sizeof(GNUstepWMAttributes)/sizeof(CARD32)); // send to the WM window style hints if ((generic.wm & XGWM_WINDOWMAKER) == 0) { setWindowHintsForStyle(dpy, window->ident, style, generic._MOTIF_WM_HINTS_ATOM); } // For window managers supporting EWMH, but not Window Maker, // where we use a different solution, set the window icon. if ((generic.wm & XGWM_EWMH) != 0) { [self _setNetWMIconFor: window->ident]; } // Use the globally active input mode window->gen_hints.flags = InputHint; window->gen_hints.input = False; // All the windows of a GNUstep application belong to one group. window->gen_hints.flags |= WindowGroupHint; window->gen_hints.window_group = ROOT; #ifdef HAVE_X11_EXTENSIONS_SYNC_H /** * Setup net_wm_sync_request_counter */ { XSyncValue value; XSyncIntToValue(&value, 0); window->net_wm_sync_request_counter = XSyncCreateCounter(dpy, value); XChangeProperty(dpy, window->ident, generic._NET_WM_SYNC_REQUEST_COUNTER_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &(window->net_wm_sync_request_counter), 1); window->net_wm_sync_request_counter_value_low = 0; window->net_wm_sync_request_counter_value_high = 0; } #endif /* * Prepare the protocols supported by the window. * These protocols should be set on the window when it is ordered in. */ [self _setSupportedWMProtocols: window]; window->exposedRects = [NSMutableArray new]; window->region = XCreateRegion(); window->buffer = 0; window->alpha_buffer = 0; window->ic = 0; // make sure that new window has the correct cursor [self _initializeCursorForXWindow: window->ident]; /* * FIXME - should this be protected by a lock for thread safety? * generate a unique tag for this new window. */ do { last_win_num++; } while (last_win_num == 0 || WINDOW_WITH_TAG(last_win_num) != 0); window->number = last_win_num; // Insert window into the mapping NSMapInsert(windowmaps, (void*)(uintptr_t)window->ident, window); NSMapInsert(windowtags, (void*)(uintptr_t)window->number, window); [self _setWindowOwnedByServer: window->number]; return window->number; } - (int) nativeWindow: (void *)winref : (NSRect*)frame : (NSBackingStoreType*)type : (unsigned int*)style : (int*)screen { gswindow_device_t *window; gswindow_device_t *root; XGCValues values; unsigned long valuemask; RContext *context; XWindowAttributes win_attributes; Window windowRef; NSRect xframe; windowRef = *((Window*)winref); NSDebugLLog(@"XGTrace", @"nativeWindow: %lu", windowRef); if (!XGetWindowAttributes(dpy, windowRef, &win_attributes)) { return 0; } *screen = XScreenNumberOfScreen(win_attributes.screen); *type = NSBackingStoreNonretained; *style = NSBorderlessWindowMask; root = [self _rootWindow]; context = [self screenRContext]; /* Create the window structure and set the style early so we can use it to convert frames. */ window = NSAllocateCollectable(sizeof(gswindow_device_t), NSScannedOption); memset(window, '\0', sizeof(gswindow_device_t)); window->display = dpy; window->screen_id = *screen; window->monitor_id = 0; window->ident = windowRef; window->root = root->ident; window->parent = root->ident; window->type = *type; window->win_attrs.flags |= GSWindowStyleAttr; window->win_attrs.window_style = *style; window->border = win_attributes.border_width; window->depth = win_attributes.depth; window->xframe = NSMakeRect(win_attributes.x, win_attributes.y, win_attributes.width, win_attributes.height); window->xwn_attrs.colormap = win_attributes.colormap; window->xwn_attrs.save_under = win_attributes.save_under; window->xwn_attrs.override_redirect = win_attributes.override_redirect; window->map_state = win_attributes.map_state; window->xwn_attrs.border_pixel = context->black; window->xwn_attrs.background_pixel = context->white; window->visibility = -1; window->wm_state = [self _wm_state: windowRef]; // Create an X GC for the content view set it's colors values.foreground = window->xwn_attrs.background_pixel; values.background = window->xwn_attrs.background_pixel; values.function = GXcopy; valuemask = (GCForeground | GCBackground | GCFunction); window->gc = XCreateGC(dpy, window->ident, valuemask, &values); /* * Initial attributes for any GNUstep window tell Window Maker not to * create an app icon for us. */ window->win_attrs.flags |= GSExtraFlagsAttr; window->win_attrs.extra_flags |= GSNoApplicationIconFlag; /* * Prepare size/position hints, but don't set them now - ordering * the window in should automatically do it. */ *frame = [self _XFrameToOSFrame: window->xframe for: window]; // Use the globally active input mode window->gen_hints.flags = InputHint; window->gen_hints.input = False; // All the windows of a GNUstep application belong to one group. window->gen_hints.flags |= WindowGroupHint; window->gen_hints.window_group = ROOT; window->exposedRects = [NSMutableArray new]; window->region = XCreateRegion(); window->buffer = 0; window->alpha_buffer = 0; window->ic = 0; /* * Prepare size/position hints, but don't set them now - ordering * the window in should automatically do it. */ xframe = [self _XFrameToXHints: window->xframe for: window]; window->siz_hints.x = NSMinX(xframe); window->siz_hints.y = NSMinY(xframe); window->siz_hints.width = NSWidth(xframe); window->siz_hints.height = NSHeight(xframe); window->siz_hints.flags = USPosition|PPosition|USSize|PSize; // make sure that new window has the correct cursor [self _initializeCursorForXWindow: window->ident]; /* * FIXME - should this be protected by a lock for thread safety? * generate a unique tag for this new window. */ do { last_win_num++; } while (last_win_num == 0 || WINDOW_WITH_TAG(last_win_num) != 0); window->number = last_win_num; // Insert window into the mapping NSMapInsert(windowmaps, (void*)(uintptr_t)window->ident, window); NSMapInsert(windowtags, (void*)(uintptr_t)window->number, window); [self _setWindowOwnedByServer: window->number]; return window->number; } - (void) termwindow: (int)win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; if (window->root == window->ident) { NSLog(@"DPStermwindow: Trying to destroy root window"); return; } NSDebugLLog(@"XGTrace", @"DPStermwindow: %d", win); if (window->ic) { [inputServer ximCloseIC: window->ic]; } if (window->ident) { XDestroyWindow(dpy, window->ident); if (window->gc) XFreeGC (dpy, window->gc); if (generic.cachedWindow != 0 && window->ident == ((gswindow_device_t*)(generic.cachedWindow))->ident) { generic.cachedWindow = 0; } NSMapRemove(windowmaps, (void*)window->ident); } if (window->buffer) XFreePixmap (dpy, window->buffer); if (window->alpha_buffer) XFreePixmap (dpy, window->alpha_buffer); if (window->region) XDestroyRegion (window->region); RELEASE(window->exposedRects); NSMapRemove(windowtags, (void*)(uintptr_t)win); NSZoneFree(0, window); } /* * Return the offsets between the window content-view and it's frame * depending on the window style. */ - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b : (unsigned int) style { [self styleoffsets: l : r : t : b : style : (Window) 0]; } - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b : (unsigned int) style : (Window) win { Offsets *o; if (!handlesWindowDecorations) { /* If we don't handle decorations, all our windows are going to be border- and decorationless. In that case, -gui won't call this method, but we still use it internally. */ *l = *r = *t = *b = 0.0; return; } /* First check _NET_FRAME_EXTENTS */ if (win && ((generic.wm & XGWM_EWMH) != 0)) { unsigned long *extents = [self _getExtents: win]; if (extents) { NSDebugLLog(@"Frame", @"Window %lu, left %lu, right %lu, top %lu, bottom %lu", win, extents[0], extents[1], extents[2], extents[3]); *l = extents[0]; *r = extents[1]; *t = extents[2]; *b = extents[3]; XFree(extents); return; } } if ((style & NSIconWindowMask) || (style & NSMiniWindowMask)) { style = NSBorderlessWindowMask; } /* Next try to get the offset information that we have obtained from the WM. This will only work if the application has already created a window that has been reparented by the WM. Otherwise we have to guess. */ o = generic.offsets + (style & 15); if (o->known == YES) { *l = o->l; *r = o->r; *b = o->b; *t = o->t; NSDebugLLog(@"Frame", @"Window %lu, offsets %f, %f, %f, %f", win, *l, *r, *t, *b); return; } NSDebugLLog(@"Frame", @"styleoffsets ... guessing offsets\n"); if ((generic.wm & XGWM_WINDOWMAKER) != 0) { *l = *r = *t = *b = 1.0; if (NSResizableWindowMask & style) { *b = 9.0; } if ((style & NSTitledWindowMask) || (style & NSClosableWindowMask) || (style & NSMiniaturizableWindowMask)) { *t = 25.0; } NSDebugLLog(@"Frame", @"Window %lu, windowmaker %f, %f, %f, %f", win, *l, *r, *t, *b); } else if ((generic.wm & XGWM_EWMH) != 0) { *l = *r = *t = *b = 4; if (NSResizableWindowMask & style) { *b = 7; } if ((style & NSTitledWindowMask) || (style & NSClosableWindowMask) || (style & NSMiniaturizableWindowMask)) { *t = 20; } NSDebugLLog(@"Frame", @"Window %lu, EWMH %f, %f, %f, %f", win, *l, *r, *t, *b); } else { /* No known WM protocols */ /* * FIXME * This should make a good guess - at the moment use no offsets. */ *l = *r = *t = *b = 0.0; NSDebugLLog(@"Frame", @"Window %lu, unknown %f, %f, %f, %f", win, *l, *r, *t, *b); } } - (void) stylewindow: (unsigned int)style : (int) win { gswindow_device_t *window; NSAssert(handlesWindowDecorations, @"-stylewindow:: called when handlesWindowDecorations==NO"); window = WINDOW_WITH_TAG(win); if (!window) return; NSDebugLLog(@"XGTrace", @"DPSstylewindow: %d : %d", style, win); if (window->win_attrs.window_style != style || (window->win_attrs.flags & GSWindowStyleAttr) == 0) { NSRect h; window->win_attrs.flags |= GSWindowStyleAttr; window->win_attrs.window_style = style; /* Fix up hints */ h = [self _XFrameToXHints: window->xframe for: window]; window->siz_hints.x = NSMinX(h); window->siz_hints.y = NSMinY(h); window->siz_hints.width = NSWidth(h); window->siz_hints.height = NSHeight(h); // send to the WM window style hints /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, window->ident, generic._GNUSTEP_WM_ATTR_ATOM, generic._GNUSTEP_WM_ATTR_ATOM, 32, PropModeReplace, (unsigned char *)&window->win_attrs, sizeof(GNUstepWMAttributes)/sizeof(CARD32)); // send to the WM window style hints if ((generic.wm & XGWM_WINDOWMAKER) == 0) { setWindowHintsForStyle(dpy, window->ident, style, generic._MOTIF_WM_HINTS_ATOM); } } } - (void) setbackgroundcolor: (NSColor *)color : (int)win { XColor xf; gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; color = [color colorUsingColorSpaceName: NSDeviceRGBColorSpace]; xf.red = 65535 * [color redComponent]; xf.green = 65535 * [color greenComponent]; xf.blue = 65535 * [color blueComponent]; NSDebugLLog(@"XGTrace", @"setbackgroundcolor: %@ %d", color, win); xf = [self xColorFromColor: xf]; window->xwn_attrs.background_pixel = xf.pixel; XSetWindowBackground(dpy, window->ident, window->xwn_attrs.background_pixel); } - (void) windowbacking: (NSBackingStoreType)type : (int) win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; NSDebugLLog(@"XGTrace", @"DPSwindowbacking: %d : %d", (int)type, win); window->type = type; if ((window->gdriverProtocol & GDriverHandlesBacking)) { return; } if (window->buffer && type == NSBackingStoreNonretained) { XFreePixmap (dpy, window->buffer); window->buffer = 0; } else if (window->buffer == 0) { [self _createBuffer: window]; } } - (void) titlewindow: (NSString *)window_title : (int) win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; NSDebugLLog(@"XGTrace", @"DPStitlewindow: %@ : %d", window_title, win); if (window_title && window->ident) { XTextProperty windowName; const char *title; int error = XLocaleNotSupported; if (handlesWindowDecorations && (generic.wm & XGWM_WINDOWMAKER) == 0 && (window->win_attrs.flags & GSExtraFlagsAttr) && (window->win_attrs.extra_flags & GSDocumentEditedFlag)) { window_title = [@"*" stringByAppendingString: window_title]; } #ifdef X_HAVE_UTF8_STRING title = [window_title UTF8String]; error = Xutf8TextListToTextProperty(dpy, (char **)&title, 1, XUTF8StringStyle, &windowName); #endif if (error != Success) { title = [window_title lossyCString]; XStringListToTextProperty((char **)&title, 1, &windowName); } XSetWMName(dpy, window->ident, &windowName); XSetWMIconName(dpy, window->ident, &windowName); XFree(windowName.value); { /* Set _NET_WM_NAME and _NET_WM_ICON_NAME */ char *name = (char *)[window_title UTF8String]; XChangeProperty(dpy, window->ident, generic._NET_WM_NAME_ATOM, generic.UTF8_STRING_ATOM, 8, PropModeReplace, (unsigned char *)name, strlen(name)); XChangeProperty(dpy, window->ident, generic._NET_WM_ICON_NAME_ATOM, generic.UTF8_STRING_ATOM, 8, PropModeReplace, (unsigned char *)name, strlen(name)); } } } - (void) docedited: (int)edited : (int) win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; NSDebugLLog(@"XGTrace", @"DPSdocedited: %d : %d", edited, win); window->win_attrs.flags |= GSExtraFlagsAttr; if (edited) { window->win_attrs.extra_flags |= GSDocumentEditedFlag; } else { window->win_attrs.extra_flags &= ~GSDocumentEditedFlag; } // send WindowMaker WM window style hints // Always send GNUstepWMAttributes /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, window->ident, generic._GNUSTEP_WM_ATTR_ATOM, generic._GNUSTEP_WM_ATTR_ATOM, 32, PropModeReplace, (unsigned char *)&window->win_attrs, sizeof(GNUstepWMAttributes)/sizeof(CARD32)); /* * Reflect the document's edited status in the window's title when the * backend does not manage the window decorations */ if (handlesWindowDecorations && (generic.wm & XGWM_WINDOWMAKER) == 0) { NSWindow *nswin = GSWindowWithNumber(win); [self titlewindow: [nswin title] : win]; } } - (BOOL) appOwnsMiniwindow { return generic.flags.appOwnsMiniwindow; } - (void) miniwindow: (int) win { gswindow_device_t *window; XEvent e; window = WINDOW_WITH_TAG(win); if (window == 0) { return; } NSDebugLLog(@"XGTrace", @"DPSminiwindow: %d ", win); /* * If we haven't already done so - set the icon window hint for this * window so that the GNUstep miniwindow is displayed (if supported). */ if (generic.flags.appOwnsMiniwindow && (window->gen_hints.flags & IconWindowHint) == 0) { NSWindow *nswin; nswin = GSWindowWithNumber(window->number); if (nswin != nil) { int iNum = [[nswin counterpart] windowNumber]; gswindow_device_t *iconw = WINDOW_WITH_TAG(iNum); if (iconw != 0) { window->gen_hints.flags |= IconWindowHint; window->gen_hints.icon_window = iconw->ident; XSetWMHints(dpy, window->ident, &window->gen_hints); } } } /* First discard all existing events for thsi window ... we don't need them * because the window is being miniaturised, and they might confuse us when * we try to find the event telling us that the miniaturisation worked. */ XSync(dpy, False); while (XCheckWindowEvent(dpy, window->ident, 0xffffffff, &e) == True) ; /* When the application owns the mini window, we withdraw the window itself during miniaturization and put up the mini window instead. However, this does not work for WindowMaker, which unmaps the mini window, too, when the actual window is withdrawn. Fortunately, miniaturizing the actual window does already the right thing on WindowMaker. */ /* Note: The wm_state != IconicState check is there to avoid iconifying a window when -miniwindow: is called as a consequence of processing a GSAppKitWindowMiniaturize event. This avoids iconifying shaded windows under metacity, which sets _NET_WM_STATE for shaded windows to both _NET_WM_STATE_SHADED and _NET_WM_STATE_HIDDEN. */ if (generic.flags.appOwnsMiniwindow && !(generic.wm & XGWM_WINDOWMAKER)) XWithdrawWindow(dpy, window->ident, window->screen_id); else if (window->wm_state != IconicState) XIconifyWindow(dpy, window->ident, window->screen_id); } /* Actually this is "hide application" action. However, key press may be received by particular window. */ - (BOOL) hideApplication: (int)win { gswindow_device_t *window; if ((generic.wm & XGWM_WINDOWMAKER) == 0) return NO; window = [XGServer _windowWithTag: win]; [self _sendRoot: window->root type: generic._WINDOWMAKER_WM_FUNCTION_ATOM window: ROOT data0: WMFHideApplication data1: CurrentTime data2: 0 data3: 0]; XSync(dpy, False); return YES; } /** Make sure we have the most up-to-date window information and then make sure the context has our new information */ - (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt { unsigned width, height; gswindow_device_t *window; float t, b, l, r; NSDebugLLog(@"XGTrace", @"DPSwindowdevice: %d ", win); window = WINDOW_WITH_TAG(win); if (!window) { NSLog(@"Invalidparam: Invalid window number %d", win); return; } if (!window->ident) return; width = NSWidth(window->xframe); height = NSHeight(window->xframe); if (window->buffer && (window->buffer_width != width || window->buffer_height != height) && (window->gdriverProtocol & GDriverHandlesBacking) == 0) { [[self class] waitAllContexts]; XFreePixmap(dpy, window->buffer); window->buffer = 0; if (window->alpha_buffer) XFreePixmap (dpy, window->alpha_buffer); window->alpha_buffer = 0; } window->buffer_width = width; window->buffer_height = height; #if (BUILD_GRAPHICS == GRAPHICS_xlib) /* The window->gdriverProtocol flag does not work as intended; it doesn't get set until after _createBuffer is called, so it's not a relaible way to tell whether we need to create a backing pixmap here. This method was causing a serious leak with the default Cairo XGCairoModernSurface because we were erroneously creating a pixmap, and then not releasing it in -termwindow: because the GDriverHandlesBacking flag was set in between. So this #if servers as a foolproof way of ensuring we don't ever create window->buffer in the default configuration. */ if ((window->buffer == 0) && (window->type != NSBackingStoreNonretained) && ((window->gdriverProtocol & GDriverHandlesBacking) == 0)) { [self _createBuffer: window]; } #endif [self styleoffsets: &l : &r : &t : &b : window->win_attrs.window_style : window->ident]; GSSetDevice(ctxt, window, l, NSHeight(window->xframe) + b); DPSinitmatrix(ctxt); //DPStranslate(ctxt, -l, -b); DPSinitclip(ctxt); } /* Build a Pixmap of our icon so the windowmaker dock will remember our icon when we quit. ICCCM really only allows 1-bit pixmaps for IconPixmapHint, but this code is only used if windowmaker is the window manager, and windowmaker can handle real color pixmaps. */ static Pixmap xIconPixmap; static Pixmap xIconMask; static BOOL didCreatePixmaps; Pixmap alphaMaskForImage(Display *xdpy, Drawable draw, const unsigned char *data, int w, int h, int colors, unsigned int alpha_treshold) { Pixmap pix; // (w/8) rounded up times height int bitmapSize = ((w + 7) >> 3) * h; unsigned char *aData = calloc(1, bitmapSize); if (colors == 4) { int j, i; unsigned int ialpha; unsigned char *cData = aData; // skip R, G, B data += 3; for (j = 0; j < h; j++) { int k = 0; for (i = 0; i < w; i++, k++) { if (k > 7) { cData++; k = 0; } ialpha = (unsigned int)(*data); if (ialpha > alpha_treshold) { *cData |= (0x01 << k); } data += 4; } cData++; } } else { memset(aData, 0xff, bitmapSize); } pix = XCreatePixmapFromBitmapData(xdpy, draw, (char *)aData, w, h, 1L, 0L, 1); free(aData); return pix; } // Convert RGBA unpacked to ARGB packed. // Packed ARGB values are layed out as ARGB on big endian systems // and as BGRA on little endian systems void swapColors(unsigned char *image_data, NSBitmapImageRep *rep) { unsigned char *target = image_data; unsigned char *source = [rep bitmapData]; NSInteger width = [rep pixelsWide]; NSInteger height = [rep pixelsHigh]; NSInteger samples_per_pixel = [rep samplesPerPixel]; NSInteger bytes_per_row = [rep bytesPerRow]; unsigned char *r, *g, *b, *a; NSInteger x, y; #if GS_WORDS_BIGENDIAN // RGBA -> ARGB r = target + 1; g = target + 2; b = target + 3; a = target; #else // RGBA -> BGRA r = target + 2; g = target + 1; b = target; a = target + 3; #endif if (samples_per_pixel == 4) { for (y = 0; y < height; y++) { unsigned char *d = source; for (x = 0; x < width; x++) { *r = d[0]; *g = d[1]; *b = d[2]; *a = d[3]; r += 4; g += 4; b += 4; a += 4; d += samples_per_pixel; } source += bytes_per_row; } } else if (samples_per_pixel == 3) { for (y = 0; y < height; y++) { unsigned char *d = source; for (x = 0; x < width; x++) { *r = d[0]; *g = d[1]; *b = d[2]; *a = 255; r += 4; g += 4; b += 4; a += 4; d += samples_per_pixel; } source += bytes_per_row; } } } - (int) _createAppIconPixmaps { NSBitmapImageRep *rep; int width, height, colors; RContext *rcontext; RXImage *rxImage; NSAssert(!didCreatePixmaps, @"called _createAppIconPixmap twice"); didCreatePixmaps = YES; rep = getStandardBitmap([NSApp applicationIconImage]); if (rep == nil) { return 0; } rcontext = [self screenRContext]; width = [rep pixelsWide]; height = [rep pixelsHigh]; colors = [rep samplesPerPixel]; if (rcontext->depth != 32) { NSLog(@"Unsupported context depth %d", rcontext->depth); return 0; } rxImage = RCreateXImage(rcontext, rcontext->depth, width, height); if (rxImage->image->bytes_per_line != 4 * width) { NSLog(@"bytes_per_line %d does not match width %d", rxImage->image->bytes_per_line, width); RDestroyXImage(rcontext, rxImage); return 0; } swapColors((unsigned char *)rxImage->image->data, rep); xIconPixmap = XCreatePixmap(dpy, rcontext->drawable, width, height, rcontext->depth); XPutImage(dpy, xIconPixmap, rcontext->copy_gc, rxImage->image, 0, 0, 0, 0, width, height); RDestroyXImage(rcontext, rxImage); xIconMask = alphaMaskForImage(dpy, ROOT, [rep bitmapData], width, height, colors, 0); return 1; } - (void) orderwindow: (int)op : (int)otherWin : (int)winNum { gswindow_device_t *window; gswindow_device_t *other; int level; window = WINDOW_WITH_TAG(winNum); if (winNum == 0 || window == NULL) { NSLog(@"Invalidparam: Ordering invalid window %d", winNum); return; } if (op != NSWindowOut) { /* * Some window managers ignore any hints and properties until the * window is actually mapped, so we need to set them all up * immediately before mapping the window ... */ setNormalHints(dpy, window); XSetWMHints(dpy, window->ident, &window->gen_hints); /* * If we are asked to set hints for the appicon and the window manager is * to control it, we must let the window manager know that this window is * the icon window for the app root window. */ if ((window->win_attrs.window_style & NSIconWindowMask) != 0) { XWMHints gen_hints; gen_hints.flags = WindowGroupHint | StateHint | IconWindowHint; gen_hints.initial_state = WithdrawnState; gen_hints.window_group = ROOT; gen_hints.icon_window = window->ident; if ((generic.wm & XGWM_WINDOWMAKER) != 0) { if (!didCreatePixmaps) { [self _createAppIconPixmaps]; } if (xIconPixmap) { gen_hints.flags |= IconPixmapHint; gen_hints.icon_pixmap = xIconPixmap; } if (xIconMask) { gen_hints.flags |= IconMaskHint; gen_hints.icon_mask = xIconMask; } } XSetWMHints(dpy, ROOT, &gen_hints); } /* * Tell the window manager what protocols this window conforms to. */ [self _setSupportedWMProtocols: window]; } if (generic.flags.useWindowMakerIcons == 1) { /* * Icon windows are mapped/unmapped by the window manager - so we * mustn't do anything with them here - though we can raise the * application root window to let Window Maker know it should use * our appicon window. */ if ((window->win_attrs.window_style & NSIconWindowMask) != 0) { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if (op != NSWindowOut && window->map_state == IsUnmapped && [[defaults objectForKey: @"autolaunch"] isEqualToString:@"YES"]) { XEvent ev; // Inform WindowMaker to ignore focus events ev.xclient.type = ClientMessage; ev.xclient.message_type = generic.WM_IGNORE_FOCUS_EVENTS_ATOM; ev.xclient.format = 32; ev.xclient.data.l[0] = True; XSendEvent(dpy, ROOT, True, EnterWindowMask, &ev); // Display application icon XMapWindow(dpy, ROOT); // Inform WindowMaker to process focus events again ev.xclient.data.l[0] = False; XSendEvent(dpy, ROOT, True, EnterWindowMask, &ev); } return; } if ((window->win_attrs.window_style & NSMiniWindowMask) != 0) { return; } } NSDebugLLog(@"XGTrace", @"DPSorderwindow: %d : %d : %d",op,otherWin,winNum); level = window->win_attrs.window_level; if (otherWin > 0) { other = WINDOW_WITH_TAG(otherWin); if (other) level = other->win_attrs.window_level; } else if (otherWin == 0 && op == NSWindowAbove) { /* Don't let the window go in front of the current key/main window. */ /* FIXME: Don't know how to get the current main window. */ Window keywin; int revert, status; status = XGetInputFocus(dpy, &keywin, &revert); other = NULL; if (status == True) { /* Alloc a temporary window structure */ other = GSAutoreleasedBuffer(sizeof(gswindow_device_t)); other->ident = keywin; op = NSWindowBelow; } } else { other = NULL; } [self setwindowlevel: level : winNum]; /* * When we are ordering a window in, we must ensure that the position * and size hints are set for the window - the window could have been * moved or resized by the window manager before it was ordered out, * in which case, we will have been notified of the new position, but * will not yet have updated the window hints, so if the window manager * looks at the existing hints when re-mapping the window it will * place the window in an old location. * We also set other hints and protocols supported by the window. */ if (op != NSWindowOut && window->map_state != IsViewable) { XMoveWindow(dpy, window->ident, window->siz_hints.x, window->siz_hints.y); setNormalHints(dpy, window); /* Set this to ignore any take focus events for this window */ window->ignore_take_focus = YES; } switch (op) { case NSWindowBelow: if (other != 0) { XWindowChanges chg; chg.sibling = other->ident; chg.stack_mode = Below; XReconfigureWMWindow(dpy, window->ident, window->screen_id, CWSibling|CWStackMode, &chg); } else { XWindowChanges chg; chg.stack_mode = Below; XReconfigureWMWindow(dpy, window->ident, window->screen_id, CWStackMode, &chg); } XMapWindow(dpy, window->ident); break; case NSWindowAbove: if (other != 0) { XWindowChanges chg; chg.sibling = other->ident; chg.stack_mode = Above; XReconfigureWMWindow(dpy, window->ident, window->screen_id, CWSibling|CWStackMode, &chg); } else { XWindowChanges chg; chg.stack_mode = Above; XReconfigureWMWindow(dpy, window->ident, window->screen_id, CWStackMode, &chg); } XMapWindow(dpy, window->ident); break; case NSWindowOut: XWithdrawWindow (dpy, window->ident, window->screen_id); break; } /* * When we are ordering a window in, we must ensure that the position * and size hints are set for the window - the window could have been * moved or resized by the window manager before it was ordered out, * in which case, we will have been notified of the new position, but * will not yet have updated the window hints, so if the window manager * looks at the existing hints when re-mapping the window it will * place the window in an old location. */ if (op != NSWindowOut && window->map_state != IsViewable) { XMoveWindow(dpy, window->ident, window->siz_hints.x, window->siz_hints.y); setNormalHints(dpy, window); /* * Do we need to setup drag types when the window is mapped or will * they work on the set up before mapping? * * [self _resetDragTypesForWindow: GSWindowWithNumber(window->number)]; */ if ((window->win_attrs.window_level != NSNormalWindowLevel) || ((window->win_attrs.window_style & (NSIconWindowMask|NSMiniWindowMask)) != 0)) { /* * Make any window which assumes the desktop level act as the * background. */ if (window->win_attrs.window_level == NSDesktopWindowLevel) { [self _sendRoot: window->root type: generic._NET_WM_STATE_ATOM window: window->ident data0: _NET_WM_STATE_ADD data1: generic._NET_WM_STATE_SKIP_TASKBAR_ATOM data2: generic._NET_WM_STATE_STICKY_ATOM data3: 1]; } else { BOOL sticky = NO; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; [self _sendRoot: window->root type: generic._NET_WM_STATE_ATOM window: window->ident data0: _NET_WM_STATE_ADD data1: generic._NET_WM_STATE_SKIP_TASKBAR_ATOM data2: generic._NET_WM_STATE_SKIP_PAGER_ATOM data3: 1]; if ((window->win_attrs.window_style & NSIconWindowMask) != 0) { sticky = [defs boolForKey: @"GSStickyAppIcons"]; } else if ((window->win_attrs.window_style & NSMiniWindowMask) != 0) { sticky = [defs boolForKey: @"GSStickyMiniWindows"]; } if (sticky == YES) { [self _sendRoot: window->root type: generic._NET_WM_STATE_ATOM window: window->ident data0: _NET_WM_STATE_ADD data1: generic._NET_WM_STATE_STICKY_ATOM data2: 0 data3: 1]; } } } if (window->win_attrs.window_level == NSModalPanelWindowLevel) { [self _sendRoot: window->root type: generic._NET_WM_STATE_ATOM window: window->ident data0: _NET_WM_STATE_ADD data1: generic._NET_WM_STATE_MODAL_ATOM data2: 0 data3: 1]; } } XFlush(dpy); } #define ALPHA_THRESHOLD 158 /* Restrict the displayed part of the window to the given image. This only yields usefull results if the window is borderless and displays the image itself */ - (void) restrictWindow: (int)win toImage: (NSImage*)image { gswindow_device_t *window; Pixmap pixmap = 0; window = WINDOW_WITH_TAG(win); if (win == 0 || window == NULL) { NSLog(@"Invalidparam: Restricting invalid window %d", win); return; } #ifdef HAVE_XSHAPE if ([[image backgroundColor] alphaComponent] * 256 <= ALPHA_THRESHOLD) { // The mask computed here is only correct for unscaled images. NSBitmapImageRep *rep = getStandardBitmap(image); if (rep != nil) { if ([rep samplesPerPixel] == 4) { pixmap = alphaMaskForImage(dpy, GET_XDRAWABLE(window), [rep bitmapData], [rep pixelsWide], [rep pixelsHigh], [rep samplesPerPixel], ALPHA_THRESHOLD); } } } XShapeCombineMask(dpy, window->ident, ShapeBounding, 0, 0, pixmap, ShapeSet); if (pixmap) { XFreePixmap(dpy, pixmap); } #endif } /* This method is a fast implementation of move that only works correctly for borderless windows. Use with caution. */ - (void) movewindow: (NSPoint)loc : (int)win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (win == 0 || window == NULL) { NSLog(@"Invalidparam: Moving invalid window %d", win); return; } window->siz_hints.x = (int)loc.x; window->siz_hints.y = (int)(xScreenSize.height - loc.y - window->siz_hints.height); XMoveWindow (dpy, window->ident, window->siz_hints.x, window->siz_hints.y); setNormalHints(dpy, window); } - (void) placewindow: (NSRect)rect : (int)win { NSEvent *e; NSRect xFrame; NSRect xHint; gswindow_device_t *window; NSWindow *nswin; BOOL resize = NO; BOOL move = NO; window = WINDOW_WITH_TAG(win); if (win == 0 || window == NULL) { NSLog(@"Invalidparam: Placing invalid window %d", win); return; } NSDebugLLog(@"XGTrace", @"DPSplacewindow: %@ : %d", NSStringFromRect(rect), win); xFrame = [self _OSFrameToXFrame: rect for: window]; if (NSEqualRects(rect, window->osframe) == YES && NSEqualRects(xFrame, window->xframe) == YES) { return; } if (NSEqualSizes(rect.size, window->osframe.size) == NO) { resize = YES; move = YES; } else if (NSEqualPoints(rect.origin, window->osframe.origin) == NO || NSEqualPoints(xFrame.origin, window->xframe.origin) == NO) { move = YES; } // Cache OpenStep window frame for future comparison window->osframe = rect; /* Temporarily remove minimum and maximum window size hints to make * the window resizable programatically. */ if (window->siz_hints.flags & (PMinSize | PMaxSize)) { long flags = window->siz_hints.flags; window->siz_hints.flags &= ~(PMinSize | PMaxSize); XSetWMNormalHints(dpy, window->ident, &window->siz_hints); window->siz_hints.flags = flags; } xHint = [self _XFrameToXHints: xFrame for: window]; window->siz_hints.width = (int)xHint.size.width; window->siz_hints.height = (int)xHint.size.height; window->siz_hints.x = (int)xHint.origin.x; window->siz_hints.y = (int)xHint.origin.y; NSDebugLLog(@"Moving", @"Place %lu - o:%@, x:%@", window->number, NSStringFromRect(rect), NSStringFromRect(xFrame)); XMoveResizeWindow (dpy, window->ident, window->siz_hints.x, window->siz_hints.y, window->siz_hints.width, window->siz_hints.height); /* Update xframe right away. We optimistically assume that we'll get the frame we asked for. If we're right, -gui can update/redraw right away, and we don't have to do anything when the ConfigureNotify arrives later. If we're wrong, the ConfigureNotify will have the exact coordinates, and at that point, we'll send new GSAppKitWindow* events to -gui. */ window->xframe = xFrame; /* Update the hints. Note that we do this _after_ updating xframe since the hint setting code needs the new xframe to work around problems with min/max sizes and resizability in some window managers. */ setNormalHints(dpy, window); nswin = GSWindowWithNumber(win); if (resize == YES) { NSDebugLLog(@"Moving", @"Fake size %lu - %@", window->number, NSStringFromSize(rect.size)); e = [NSEvent otherEventWithType: NSAppKitDefined location: rect.origin modifierFlags: 0 timestamp: 0 windowNumber: win context: GSCurrentContext() subtype: GSAppKitWindowResized data1: rect.size.width data2: rect.size.height]; [nswin sendEvent: e]; } else if (move == YES) { NSDebugLLog(@"Moving", @"Fake move %lu - %@", window->number, NSStringFromPoint(rect.origin)); e = [NSEvent otherEventWithType: NSAppKitDefined location: NSZeroPoint modifierFlags: 0 timestamp: 0 windowNumber: win context: GSCurrentContext() subtype: GSAppKitWindowMoved data1: rect.origin.x data2: rect.origin.y]; [nswin sendEvent: e]; } } - (BOOL) findwindow: (NSPoint)loc : (int) op : (int) otherWin : (NSPoint *)floc : (int*) winFound { return NO; } - (NSRect) windowbounds: (int)win { gswindow_device_t *window; int screenHeight; NSRect rect; int x, y; unsigned int width, height; window = WINDOW_WITH_TAG(win); if (!window) return NSZeroRect; NSDebugLLog(@"XGTrace", @"DPScurrentwindowbounds: %d", win); // get the current xframe of the window XGetGeometry(dpy, window->ident, &window->root, &x, &y, &width, &height, &window->border, &window->depth); window->xframe = NSMakeRect(x, y, width, height); screenHeight = [self boundsForScreen: window->monitor_id].size.height; rect = window->xframe; rect.origin.y = screenHeight - NSMaxY(window->xframe); return rect; } - (void) setwindowlevel: (int)level : (int)win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; NSDebugLLog(@"XGTrace", @"DPSsetwindowlevel: %d : %d", level, win); if ((int)(window->win_attrs.window_level) != level || (window->win_attrs.flags & GSWindowLevelAttr) == 0) { window->win_attrs.flags |= GSWindowLevelAttr; window->win_attrs.window_level = level; // send WindowMaker WM window style hints // Always send GNUstepWMAttributes /* * First change the window properties so that, if the window * is not mapped, we have stored the required info for when * the WM maps it. */ /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, window->ident, generic._GNUSTEP_WM_ATTR_ATOM, generic._GNUSTEP_WM_ATTR_ATOM, 32, PropModeReplace, (unsigned char *)&window->win_attrs, sizeof(GNUstepWMAttributes)/sizeof(CARD32)); /* * Now send a message for rapid handling. */ [self _sendRoot: window->root type: generic._GNUSTEP_WM_ATTR_ATOM window: window->ident data0: GSWindowLevelAttr data1: window->win_attrs.window_level data2: 0 data3: 0]; if ((generic.wm & XGWM_EWMH) != 0) { int len; long data[2]; BOOL skipTaskbar = NO; data[0] = generic._NET_WM_WINDOW_TYPE_NORMAL_ATOM; data[1] = None; len = 1; if (level == NSModalPanelWindowLevel) { data[0] = generic._NET_WM_WINDOW_TYPE_NORMAL_ATOM; skipTaskbar = YES; } else if (level == NSMainMenuWindowLevel) { data[0] = generic._NET_WM_WINDOW_TYPE_DOCK_ATOM; skipTaskbar = YES; } else if (level == NSSubmenuWindowLevel || level == NSTornOffMenuWindowLevel) { data[0] = generic._NET_WM_WINDOW_TYPE_MENU_ATOM; skipTaskbar = YES; } else if (level == NSFloatingWindowLevel) { data[0] = generic._NET_WM_WINDOW_TYPE_UTILITY_ATOM; skipTaskbar = YES; } else if (level == NSDockWindowLevel || level == NSStatusWindowLevel) { data[0] =generic._NET_WM_WINDOW_TYPE_DOCK_ATOM; skipTaskbar = YES; } // Does this belong into a different category? else if (level == NSPopUpMenuWindowLevel) { NSWindow *nswin = GSWindowWithNumber(window->number); if ([[nswin className] isEqual: @"GSTTPanel"]) { data[0] = generic._NET_WM_WINDOW_TYPE_TOOLTIP_ATOM; } else { // data[0] = generic._NET_WM_WINDOW_TYPE_POPUP_MENU_ATOM; data[0] = generic._NET_WM_WINDOW_TYPE_DIALOG_ATOM; } skipTaskbar = YES; } else if (level == NSDesktopWindowLevel) { data[0] = generic._NET_WM_WINDOW_TYPE_DESKTOP_ATOM; skipTaskbar = YES; } /* Warning ... X-bug .. when we specify 32bit data X actually expects data * of type 'long' or 'unsigned long' even on machines where those types * hold 64bit values. */ XChangeProperty(dpy, window->ident, generic._NET_WM_WINDOW_TYPE_ATOM, XA_ATOM, 32, PropModeReplace, (unsigned char *)&data, len); /* * Change _NET_WM_STATE based on window level. * This should be based on real window type (NSMenu, NSPanel, etc). * This feature is only needed for window managers that cannot properly * handle the window type set above. */ if (skipTaskbar) { [self _sendRoot: window->root type: generic._NET_WM_STATE_ATOM window: window->ident data0: _NET_WM_STATE_ADD data1: generic._NET_WM_STATE_SKIP_TASKBAR_ATOM data2: generic._NET_WM_STATE_SKIP_PAGER_ATOM data3: 1]; } else { [self _sendRoot: window->root type: generic._NET_WM_STATE_ATOM window: window->ident data0: _NET_WM_STATE_REMOVE data1: generic._NET_WM_STATE_SKIP_TASKBAR_ATOM data2: generic._NET_WM_STATE_SKIP_PAGER_ATOM data3: 1]; } } else if ((generic.wm & XGWM_GNOME) != 0) { long flag = WIN_LAYER_NORMAL; if (level == NSDesktopWindowLevel) flag = WIN_LAYER_DESKTOP; else if (level == NSSubmenuWindowLevel || level == NSFloatingWindowLevel || level == NSTornOffMenuWindowLevel) flag = WIN_LAYER_ONTOP; else if (level == NSMainMenuWindowLevel) flag = WIN_LAYER_MENU; else if (level == NSDockWindowLevel || level == NSStatusWindowLevel) flag = WIN_LAYER_DOCK; else if (level == NSModalPanelWindowLevel || level == NSPopUpMenuWindowLevel) flag = WIN_LAYER_ONTOP; else if (level == NSScreenSaverWindowLevel) flag = WIN_LAYER_ABOVE_DOCK; XChangeProperty(dpy, window->ident, generic._WIN_LAYER_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&flag, 1); [self _sendRoot: window->root type: generic._WIN_LAYER_ATOM window: window->ident data0: flag data1: 0 data2: 0 data3: 0]; } } } - (int) windowlevel: (int)win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); /* * If we have previously set a level for this window - return the value set. */ if (window != 0 && (window->win_attrs.flags & GSWindowLevelAttr)) return window->win_attrs.window_level; return 0; } - (NSArray *) windowlist { gswindow_device_t *rootWindow; Window *windowOrder; gswindow_device_t *tmp; NSMutableArray *ret; int c; rootWindow = [self _rootWindow]; windowOrder = (Window *)PropGetCheckProperty(dpy, rootWindow->ident, generic._NET_CLIENT_LIST_STACKING_ATOM, XA_WINDOW, 32, -1, &c); if (windowOrder == NULL || !c) { return [super windowlist]; } ret = [NSMutableArray array]; while (c-- > 0) { tmp = [[self class] _windowForXWindow: windowOrder[c]]; /* CLIENT_LIST_STACKING returns all windows on the server, we're only * interested in the ones which are ours. */ if (tmp) { [ret addObject: [NSNumber numberWithInt: tmp->number]]; } } XFree(windowOrder); return ret; } - (int) windowdepth: (int)win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return 0; return window->depth; } - (void) setmaxsize: (NSSize)size : (int)win { gswindow_device_t *window; NSRect r; window = WINDOW_WITH_TAG(win); if (window == 0) { return; } r = NSMakeRect(0, 0, size.width, size.height); r = [self _OSFrameToXFrame: r for: window]; window->siz_hints.flags |= PMaxSize; window->siz_hints.max_width = r.size.width; window->siz_hints.max_height = r.size.height; setNormalHints(dpy, window); } - (void) setminsize: (NSSize)size : (int)win { gswindow_device_t *window; NSRect r; window = WINDOW_WITH_TAG(win); if (window == 0) { return; } r = NSMakeRect(0, 0, size.width, size.height); r = [self _OSFrameToXFrame: r for: window]; window->siz_hints.flags |= PMinSize; window->siz_hints.min_width = r.size.width; window->siz_hints.min_height = r.size.height; setNormalHints(dpy, window); } - (void) setresizeincrements: (NSSize)size : (int)win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (window == 0) { return; } window->siz_hints.flags |= PResizeInc; window->siz_hints.width_inc = size.width; window->siz_hints.height_inc = size.height; setNormalHints(dpy, window); } // process expose event - (void) _addExposedRectangle: (XRectangle)rectangle : (int)win : (BOOL) ignoreBacking { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; if (!ignoreBacking && window->type != NSBackingStoreNonretained) { XGCValues values; unsigned long valuemask; // window has a backing store so just copy the exposed rect from the // pixmap to the X window NSDebugLLog (@"NSWindow", @"copy exposed area ((%d, %d), (%d, %d))", rectangle.x, rectangle.y, rectangle.width, rectangle.height); values.function = GXcopy; values.plane_mask = AllPlanes; values.clip_mask = None; values.foreground = window->xwn_attrs.background_pixel; valuemask = (GCFunction | GCPlaneMask | GCClipMask | GCForeground); XChangeGC(dpy, window->gc, valuemask, &values); [[self class] waitAllContexts]; if ((window->gdriverProtocol & GDriverHandlesExpose)) { /* Temporary protocol until we standardize the backing buffer */ NSRect rect = NSMakeRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height); [[GSCurrentContext() class] handleExposeRect: rect forDriver: window->gdriver]; } else { XCopyArea (dpy, window->buffer, window->ident, window->gc, rectangle.x, rectangle.y, rectangle.width, rectangle.height, rectangle.x, rectangle.y); } } else { NSRect rect; // no backing store, so keep a list of exposed rects to be // processed in the _processExposedRectangles method // Add the rectangle to the region used in -_processExposedRectangles // to set the clipping path. XUnionRectWithRegion (&rectangle, window->region, window->region); // Transform the rectangle's coordinates to OS coordinates and add // this new rectangle to the list of exposed rectangles. { rect = [self _XWinRectToOSWinRect: NSMakeRect( rectangle.x, rectangle.y, rectangle.width, rectangle.height) for: window]; [window->exposedRects addObject: [NSValue valueWithRect: rect]]; } } } - (void) flushwindowrect: (NSRect)rect : (int)win { int xi, yi, width, height; XGCValues values; unsigned long valuemask; gswindow_device_t *window; float l, r, t, b; window = WINDOW_WITH_TAG(win); if (win == 0 || window == NULL) { NSLog(@"Invalidparam: Placing invalid window %d", win); return; } NSDebugLLog(@"XGFlush", @"DPSflushwindowrect: %@ : %d", NSStringFromRect(rect), win); if (window->type == NSBackingStoreNonretained) { XFlush(dpy); return; } values.function = GXcopy; values.plane_mask = AllPlanes; values.clip_mask = None; valuemask = (GCFunction | GCPlaneMask | GCClipMask); XChangeGC(dpy, window->gc, valuemask, &values); [self styleoffsets: &l : &r : &t : &b : window->win_attrs.window_style : window->ident]; xi = rect.origin.x = NSMinX(rect) - l; yi = rect.origin.y = NSHeight(window->xframe) + b - NSMaxY(rect); width = NSWidth(rect); height = NSHeight(rect); if (width > 0 || height > 0) { [[self class] waitAllContexts]; if ((window->gdriverProtocol & GDriverHandlesBacking)) { NSDebugLLog (@"XGFlush", @"expose X rect ((%d, %d), (%d, %d))", xi, yi, width, height); /* Temporary protocol until we standardize the backing buffer */ [[GSCurrentContext() class] handleExposeRect: rect forDriver: window->gdriver]; } else { NSDebugLLog (@"XGFlush", @"copy X rect ((%d, %d), (%d, %d))", xi, yi, width, height); XCopyArea (dpy, window->buffer, window->ident, window->gc, xi, yi, width, height, xi, yi); } } #ifdef HAVE_X11_EXTENSIONS_SYNC_H if (window->net_wm_sync_request_counter_value_low != 0 || window->net_wm_sync_request_counter_value_high != 0) { XSyncValue value; XSyncIntsToValue(&value, window->net_wm_sync_request_counter_value_low, window->net_wm_sync_request_counter_value_high); XSyncSetCounter(dpy, window->net_wm_sync_request_counter, value); window->net_wm_sync_request_counter_value_low = 0; window->net_wm_sync_request_counter_value_high = 0; } #endif XFlush(dpy); } // handle X expose events - (void) _processExposedRectangles: (int)win { int n; gswindow_device_t *window; NSWindow *gui_win; window = WINDOW_WITH_TAG(win); if (!window) return; // Set the clipping path to the exposed rectangles // so that further drawing will not affect the non-exposed region XSetRegion (dpy, window->gc, window->region); // We should determine the views that need to be redisplayed. Until we // fully support scalation and rotation of views redisplay everything. // FIXME: It seems wierd to trigger a front-end method from here... // We simply invalidate the // corresponding rectangle of the top most view of the window. gui_win = GSWindowWithNumber(win); n = [window->exposedRects count]; if (n > 0) { NSView *v; NSValue *val[n]; int i; v = [[gui_win contentView] superview]; [window->exposedRects getObjects: val]; for (i = 0; i < n; ++i) { NSRect rect = [val[i] rectValue]; [v setNeedsDisplayInRect: rect]; } } // Restore the exposed rectangles and the region [window->exposedRects removeAllObjects]; XDestroyRegion (window->region); window->region = XCreateRegion(); XSetClipMask (dpy, window->gc, None); } - (BOOL) capturemouse: (int)win { int ret; gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return NO; ret = XGrabPointer(dpy, window->ident, False, PointerMotionMask | ButtonReleaseMask | ButtonPressMask, GrabModeAsync, GrabModeAsync, None, None, [self lastTime]); if (ret != GrabSuccess) NSDebugLLog(@"XGTrace", @"Failed to grab pointer %d\n", win); else { grab_window = window; NSDebugLLog(@"XGTrace", @"Grabbed pointer %d\n", win); } return (ret == GrabSuccess) ? YES : NO; } - (void) releasemouse { NSDebugLLog(@"XGTrace", @"Released pointer\n"); XUngrabPointer(dpy, [self lastTime]); grab_window = NULL; } - (void) setMouseLocation: (NSPoint)mouseLocation onScreen: (int)aScreen { int height; int destX, destY; height = [self boundsForScreen: aScreen].size.height; destY = height - mouseLocation.y; destX = mouseLocation.x; XWarpPointer(dpy, None, [self xDisplayRootWindow], 0, 0, 0, 0, destX, destY); } - (void) setinputfocus: (int)win { gswindow_device_t *window = WINDOW_WITH_TAG(win); if (win == 0 || window == 0) { NSDebugLLog(@"Focus", @"Setting focus to unknown win %d", win); return; } NSDebugLLog(@"XGTrace", @"DPSsetinputfocus: %d", win); /* * If we have an outstanding request to set focus to this window, * we don't want to do it again. */ if (win == generic.desiredFocusWindow && generic.focusRequestNumber != 0) { NSDebugLLog(@"Focus", @"Focus already set on %lu", window->number); return; } if ((generic.wm & XGWM_EWMH) != 0) { Time last = [self lastTime]; NSDebugLLog(@"Focus", @"Setting user time for %lu to %lu", window->ident, last); XChangeProperty(dpy, window->ident, generic._NET_WM_USER_TIME_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&last, 1); } NSDebugLLog(@"Focus", @"Setting focus to %lu", window->number); generic.desiredFocusWindow = win; generic.focusRequestNumber = XNextRequest(dpy); XSetInputFocus(dpy, window->ident, RevertToParent, [self lastTime]); [inputServer ximFocusICWindow: window]; } /* * Instruct window manager that the specified window is 'key', 'main', or * just a normal window. */ - (void) setinputstate: (int)st : (int)win { if (!handlesWindowDecorations) return; NSDebugLLog(@"XGTrace", @"DPSsetinputstate: %d : %d", st, win); if ((generic.wm & XGWM_WINDOWMAKER) != 0) { gswindow_device_t *window = WINDOW_WITH_TAG(win); if (win == 0 || window == 0) { return; } [self _sendRoot: window->root type: generic._GNUSTEP_TITLEBAR_STATE_ATOM window: window->ident data0: st data1: 0 data2: 0 data3: 0]; } #if 0 else if ((generic.wm & XGWM_EWMH) != 0) { if ((st == GSTitleBarKey) || (st == GSTitleBarMain)) { gswindow_device_t *window = WINDOW_WITH_TAG(win); if (win == 0 || window == 0) { return; } /* * Work around "focus stealing prevention" by first asking for focus * before we try to take it. */ [self _sendRoot: window->root type: generic._NET_ACTIVE_WINDOW_ATOM window: window->ident data0: 1 data1: [self lastTime] data2: 0 data3: 0]; } } #endif } /** Sets the transparancy value for the whole window */ - (void) setalpha: (float)alpha : (int) win { gswindow_device_t *window = WINDOW_WITH_TAG(win); if (win == 0 || window == 0) { NSDebugLLog(@"XGTrace", @"Setting alpha to unknown win %d", win); return; } NSDebugLLog(@"XGTrace", @"setalpha: %d", win); if (alpha == 1.0) { XDeleteProperty(window->display, window->ident, generic._NET_WM_WINDOW_OPACITY_ATOM); } else { unsigned int opacity; opacity = (unsigned int)(alpha * 0xffffffffU); XChangeProperty(window->display, window->ident, generic._NET_WM_WINDOW_OPACITY_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&opacity, 1L); if (window->parent != window->root) { XChangeProperty(window->display, window->parent, generic._NET_WM_WINDOW_OPACITY_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&opacity, 1); } // GDK uses an event to set opacity, but most window manager still wait // for property changes. What is the official stanard? } } - (float) getAlpha: (int)win { gswindow_device_t *window = WINDOW_WITH_TAG(win); int c; unsigned int *num; float alpha = 0.0; if (win == 0 || window == 0) { NSDebugLLog(@"XGTrace", @"Setting alpha to unknown win %d", win); return alpha; } num = (unsigned int*)PropGetCheckProperty(dpy, window->ident, generic._NET_WM_WINDOW_OPACITY_ATOM, XA_CARDINAL, 32, 1, &c); if (num) { if (*num) alpha = (float)*num / 0xffffffffU; XFree(num); } return alpha; } - (void *) serverDevice { return dpy; } - (void *) windowDevice: (int)win { Window ptrloc; gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (window != NULL) ptrloc = window->ident; else ptrloc = 0; return (void *)ptrloc; } /* Cursor Ops */ static char xgps_blank_cursor_bits [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static Cursor xgps_blank_cursor = None; static BOOL cursor_hidden = NO; - (Cursor) _blankCursor { if (xgps_blank_cursor == None) { Pixmap shape, mask; XColor black, white; Drawable drw = [self xDisplayRootWindow]; shape = XCreatePixmapFromBitmapData(dpy, drw, xgps_blank_cursor_bits, 16, 16, 1, 0, 1); mask = XCreatePixmapFromBitmapData(dpy, drw, xgps_blank_cursor_bits, 16, 16, 1, 0, 1); black.red = black.green = black.blue = 0; black = [self xColorFromColor: black]; white.red = white.green = white.blue = 65535; white = [self xColorFromColor: white]; xgps_blank_cursor = XCreatePixmapCursor(dpy, shape, mask, &white, &black, 0, 0); XFreePixmap(dpy, shape); XFreePixmap(dpy, mask); } return xgps_blank_cursor; } /* set the cursor for a newly created window. */ - (void) _initializeCursorForXWindow: (Window) win { if (cursor_hidden) { XDefineCursor (dpy, win, [self _blankCursor]); } else { Cursor cid = (Cursor)[[NSCursor currentCursor] _cid]; XDefineCursor (dpy, win, cid); } } /* set cursor on all XWindows we own. if `set' is NO the cursor is unset on all windows. Normally the cursor `c' correspond to the [NSCursor currentCursor] The only exception should be when the cursor is hidden. In that case `c' will be a blank cursor. */ - (void) _DPSsetcursor: (Cursor)c : (BOOL)set { void *key; NSMapEnumerator enumerator; gswindow_device_t *d; Window root; NSDebugLLog (@"NSCursor", @"_DPSsetcursor: cursor = %lu, set = %d", c, set); root = DefaultRootWindow(dpy); enumerator = NSEnumerateMapTable (windowmaps); while (NSNextMapEnumeratorPair (&enumerator, &key, (void**)&d) == YES) { Window win = (Window)key; if (win == root) continue; if (set) XDefineCursor(dpy, win, c); else XUndefineCursor(dpy, win); } } #if !HAVE_XCURSOR Pixmap xgps_cursor_image(Display *xdpy, Drawable draw, const unsigned char *data, int w, int h, int colors, XColor *fg, XColor *bg) { int j, i, min, max; Pixmap pix; int bitmapSize = ((w + 7) >> 3) * h; // w/8 rounded up multiplied by h char *aData = calloc(1, bitmapSize); char *cData = aData; min = 1 << 16; max = 0; if (colors == 4 || colors == 3) { int k; for (j = 0; j < h; j++) { k = 0; for (i = 0; i < w; i++, k++) { /* colors is in the range 0..65535 and value is the percieved brightness, obtained by averaging 0.3 red + 0.59 green + 0.11 blue */ int color = ((77 * data[0]) + (151 * data[1]) + (28 * data[2])); if (k > 7) { cData++; k = 0; } if (color > (1 << 15)) { *cData |= (0x01 << k); } if (color < min) { min = color; bg->red = (int)data[0] * 256; bg->green = (int)data[1] * 256; bg->blue = (int)data[2] * 256; } else if (color > max) { max = color; fg->red = (int)data[0] * 256; fg->green = (int)data[1] * 256; fg->blue = (int)data[2] * 256; } data += 3; if (colors == 4) { data++; } } cData++; } } else { for (j = 0; j < bitmapSize; j++) { if ((unsigned short)((char)*data++) > 128) { *cData |= (0x01 << j); } cData++; } } pix = XCreatePixmapFromBitmapData(xdpy, draw, (char *)aData, w, h, 1L, 0L, 1); free(aData); return pix; } #endif - (void) hidecursor { if (cursor_hidden) return; [self _DPSsetcursor: [self _blankCursor] : YES]; cursor_hidden = YES; } - (void) showcursor { if (cursor_hidden) { /* This just resets the cursor to the parent window's cursor. I'm not even sure it's needed */ [self _DPSsetcursor: None : NO]; /* Reset the current cursor */ [[NSCursor currentCursor] set]; } cursor_hidden = NO; } - (void) standardcursor: (int)style : (void **)cid { Cursor cursor = None; switch (style) { case GSArrowCursor: cursor = XCreateFontCursor(dpy, XC_left_ptr); break; case GSIBeamCursor: cursor = XCreateFontCursor(dpy, XC_xterm); break; case GSOpenHandCursor: cursor = XCreateFontCursor(dpy, XC_hand1); break; case GSPointingHandCursor: cursor = XCreateFontCursor(dpy, XC_hand2); break; case GSCrosshairCursor: cursor = XCreateFontCursor(dpy, XC_crosshair); break; case GSResizeDownCursor: cursor = XCreateFontCursor(dpy, XC_bottom_side); break; case GSResizeLeftCursor: cursor = XCreateFontCursor(dpy, XC_left_side); break; case GSResizeLeftRightCursor: cursor = XCreateFontCursor(dpy, XC_sb_h_double_arrow); break; case GSResizeRightCursor: cursor = XCreateFontCursor(dpy, XC_right_side); break; case GSResizeUpCursor: cursor = XCreateFontCursor(dpy, XC_top_side); break; case GSResizeUpDownCursor: cursor = XCreateFontCursor(dpy, XC_sb_v_double_arrow); break; default: return; } if (cid) *cid = (void *)cursor; } - (void) imagecursor: (NSPoint)hotp : (NSImage *)image : (void **)cid { Cursor cursor; NSBitmapImageRep *rep; int w, h; int colors; rep = getStandardBitmap(image); if (rep == nil) { /* FIXME: We might create a blank cursor here? */ NSLog(@"Could not convert cursor bitmap data"); *cid = NULL; return; } if (hotp.x >= [rep pixelsWide]) hotp.x = [rep pixelsWide]-1; if (hotp.y >= [rep pixelsHigh]) hotp.y = [rep pixelsHigh]-1; w = [rep pixelsWide]; h = [rep pixelsHigh]; colors = [rep samplesPerPixel]; if (w <= 0 || h <= 0) { *cid = NULL; return; } #if HAVE_XCURSOR // FIXME: Standardize getStandardBitmap() so it always returns // alpha, and document the format. if (colors != 4) { *cid = NULL; return; } { XcursorImage *xcursorImage; xcursorImage = XcursorImageCreate(w, h); xcursorImage->xhot = hotp.x; xcursorImage->yhot = hotp.y; // Copy the data from the image rep to the Xcursor structure swapColors((unsigned char *)xcursorImage->pixels, rep); cursor = XcursorImageLoadCursor(dpy, xcursorImage); XcursorImageDestroy(xcursorImage); } #else // !HAVE_XCURSOR { Pixmap source, mask; unsigned int maxw, maxh; XColor fg, bg; const unsigned char *data = [rep bitmapData]; /* FIXME: Handle this better or return an error? */ XQueryBestCursor(dpy, ROOT, w, h, &maxw, &maxh); if ((unsigned int)w > maxw) w = maxw; if ((unsigned int)h > maxh) h = maxh; source = xgps_cursor_image(dpy, ROOT, data, w, h, colors, &fg, &bg); mask = alphaMaskForImage(dpy, ROOT, data, w, h, colors, ALPHA_THRESHOLD); bg = [self xColorFromColor: bg]; fg = [self xColorFromColor: fg]; cursor = XCreatePixmapCursor(dpy, source, mask, &fg, &bg, (int)hotp.x, (int)hotp.y); XFreePixmap(dpy, source); XFreePixmap(dpy, mask); } #endif if (cid) *cid = (void *)cursor; } - (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid { XColor xf, xb; Cursor cursor; cursor = (Cursor)cid; if (cursor == None) { NSLog(@"Invalidparam: Invalid cursor"); return; } fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace]; bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace]; if (fg == nil || bg == nil) { return; } xf.red = 65535 * [fg redComponent]; xf.green = 65535 * [fg greenComponent]; xf.blue = 65535 * [fg blueComponent]; xb.red = 65535 * [bg redComponent]; xb.green = 65535 * [bg greenComponent]; xb.blue = 65535 * [bg blueComponent]; xf = [self xColorFromColor: xf]; xb = [self xColorFromColor: xb]; XRecolorCursor(dpy, cursor, &xf, &xb); } - (void) setcursor: (void*) cid { Cursor cursor; cursor = (Cursor)cid; if (cursor == None) { NSLog(@"Invalidparam: Invalid cursor"); return; } [self _DPSsetcursor: cursor : YES]; } - (void) freecursor: (void*) cid { Cursor cursor; cursor = (Cursor)cid; if (cursor == None) { NSLog(@"Invalidparam: Invalid cursor"); return; } XFreeCursor(dpy, cursor); } /******************************************************************************* * Screens, monitors *******************************************************************************/ static NSWindowDepth _computeDepth(int class, int bpp) { int spp = 0; int bitValue = 0; int bps = 0; NSWindowDepth depth = 0; switch (class) { case GrayScale: case StaticGray: bitValue = _GSGrayBitValue; spp = 1; break; case PseudoColor: case StaticColor: bitValue = _GSCustomBitValue; spp = 1; break; case DirectColor: case TrueColor: bitValue = _GSRGBBitValue; spp = 3; break; default: NSLog(@"Unknown visual class %d in computeDepth", class); return 0; break; } bps = (bpp/spp); depth = (bitValue | bps); return depth; } static NSSize _screenSize(Display *dpy, int screen) { int x, y; unsigned int width, height, border_width, depth; Window root_window; NSSize scrSize; XGetGeometry(dpy, RootWindow(dpy, screen), &root_window, &x, &y, &width, &height, &border_width, &depth); scrSize = NSMakeSize(width, height); if (scrSize.height == 0) scrSize.height = DisplayHeight(dpy, screen); if (scrSize.width == 0) scrSize.width = DisplayWidth(dpy, screen); return scrSize; } /* This method assumes that we deal with one X11 screen - `defScreen`. Basically it means that we have DISPLAY variable set to `:0.0`. Where both digits have artbitrary values, but it defines once on every application run. AppKit and X11 use the same term "screen" with different meaning: AppKit Screen - single monitor/display device. X11 Screen - it's a plane where X Server can draw on. XRandR - Xorg extension that helps to manipulate monitor layout providing X11 Screen. We map XRandR monitors (outputs) to NSScreen. */ - (NSArray *)screenList { xScreenSize = _screenSize(dpy, defScreen); monitorsCount = 0; if (monitors != NULL) { NSZoneFree([self zone], monitors); monitors = NULL; } #ifdef HAVE_XRANDR Window root = [self xDisplayRootWindow]; XRRScreenResources *screen_res = XRRGetScreenResources(dpy, root); if (screen_res != NULL) { monitorsCount = screen_res->noutput; if (monitorsCount != 0) { int i; int mi; NSMutableArray *tmpScreens = [NSMutableArray arrayWithCapacity: monitorsCount]; RROutput primary_output = XRRGetOutputPrimary(dpy, root); monitors = NSZoneMalloc([self zone], monitorsCount * sizeof(MonitorDevice)); for (i = 0, mi = 0; i < screen_res->noutput; i++) { XRROutputInfo *output_info; output_info = XRRGetOutputInfo(dpy, screen_res, screen_res->outputs[i]); if (output_info->crtc) { XRRCrtcInfo *crtc_info; crtc_info = XRRGetCrtcInfo(dpy, screen_res, output_info->crtc); monitors[mi].screen_id = defScreen; monitors[mi].depth = [self windowDepthForScreen: mi]; monitors[mi].resolution = [self resolutionForScreen: defScreen]; /* Transform coordinates from Xlib (flipped) to OpenStep (unflippped). Windows and screens should have the same coordinate system. */ monitors[mi].frame = NSMakeRect(crtc_info->x, xScreenSize.height - crtc_info->height - crtc_info->y, crtc_info->width, crtc_info->height); /* Add monitor ID (index in monitors array). Put primary monitor ID at index 0 since NSScreen get this as main screen if application has no key window. */ if (screen_res->outputs[i] == primary_output) { [tmpScreens insertObject: [NSNumber numberWithInt: mi] atIndex: 0]; } else { [tmpScreens addObject: [NSNumber numberWithInt: mi]]; } XRRFreeCrtcInfo(crtc_info); mi++; } XRRFreeOutputInfo(output_info); } monitorsCount = mi; if (monitorsCount != 0) { XRRFreeScreenResources(screen_res); return [NSArray arrayWithArray: tmpScreens]; } else { NSZoneFree([self zone], monitors); monitors = NULL; } } XRRFreeScreenResources(screen_res); } #endif /* It is assumed that there is always only one screen per application. We only need to know its number and it was saved in _initXContext as `defScreen`. */ monitorsCount = 1; monitors = NSZoneMalloc([self zone], sizeof(MonitorDevice)); monitors[0].screen_id = defScreen; monitors[0].depth = [self windowDepthForScreen: 0]; monitors[0].resolution = [self resolutionForScreen: defScreen]; monitors[0].frame = NSMakeRect(0, 0, xScreenSize.width, xScreenSize.height); return [NSArray arrayWithObject: [NSNumber numberWithInt: defScreen]]; } // `screen` is a monitor index not X11 screen - (NSWindowDepth) windowDepthForScreen: (int)screen { Screen *x_screen; int class = 0, bpp = 0; if (screen < 0 || screen >= monitorsCount) { return 0; } x_screen = XScreenOfDisplay(dpy, monitors[screen].screen_id); if (x_screen == NULL) { return 0; } bpp = x_screen->root_depth; class = x_screen->root_visual->class; return _computeDepth(class, bpp); } // `screen` is a monitor index not X11 screen - (const NSWindowDepth *) availableDepthsForScreen: (int)screen { Screen *x_screen; int class = 0; int index = 0; int ndepths = 0; NSZone *defaultZone = NSDefaultMallocZone(); NSWindowDepth *depths = 0; if (dpy == NULL || screen < 0 || screen >= monitorsCount) { return NULL; } x_screen = XScreenOfDisplay(dpy, monitors[screen].screen_id); if (x_screen == NULL) { return NULL; } // Allocate the memory for the array and fill it in. ndepths = x_screen->ndepths; class = x_screen->root_visual->class; depths = NSZoneMalloc(defaultZone, sizeof(NSWindowDepth)*(ndepths + 1)); for (index = 0; index < ndepths; index++) { int depth = x_screen->depths[index].depth; depths[index] = _computeDepth(class, depth); } depths[index] = 0; // terminate with a zero. return depths; } // `screen_num` is a Xlib screen number. - (NSSize) resolutionForScreen: (int)screen_num { // NOTE: // -gui now trusts the return value of resolutionForScreen:, // so if it is not {72, 72} then the entire UI will be scaled. // // I commented out the implementation below because it may not // be safe to use the DPI value we get from the X server. // (i.e. I don't know if it will be a "fake" DPI like 72 or 96, // or a real measurement reported from the monitor's firmware // (possibly incorrect?)) // More research needs to be done. return NSMakeSize(72, 72); /* int res_x, res_y; if (screen < 0 || screen_num >= ScreenCount(dpy)) { NSLog(@"Invalidparam: no screen %d", screen); return NSMakeSize(0,0); } // This does not take virtual displays into account!! res_x = DisplayWidth(dpy, screen) / (DisplayWidthMM(dpy, screen) / 25.4); res_y = DisplayHeight(dpy, screen) / (DisplayHeightMM(dpy, screen) / 25.4); return NSMakeSize(res_x, res_y); */ } // `screen` is a monitor index not X11 screen - (NSRect) boundsForScreen: (int)screen { NSRect boundsRect = NSZeroRect; if (screen < 0 || screen >= monitorsCount) { NSLog(@"Invalidparam: no screen %d", screen); return NSZeroRect; } if (monitors != NULL) { boundsRect = monitors[screen].frame; } return boundsRect; } - (NSImage *) iconTileImage { Window win; Window *pwin; int count; unsigned char *tile; NSImage *iconTileImage; NSBitmapImageRep *imageRep; unsigned int width, height; if (((generic.wm & XGWM_WINDOWMAKER) == 0) || generic.flags.useWindowMakerIcons == NO) return [super iconTileImage]; win = DefaultRootWindow(dpy); pwin = (Window *)PropGetCheckProperty(dpy, win, generic._WINDOWMAKER_NOTICEBOARD_ATOM, XA_WINDOW, 32, -1, &count); if (pwin == NULL) return [super iconTileImage]; tile = PropGetCheckProperty(dpy, *pwin, generic._WINDOWMAKER_ICON_TILE_ATOM, generic._RGBA_IMAGE_ATOM, 8, -1, &count); XFree(pwin); if (tile == NULL || count < 4) return [super iconTileImage]; width = (tile[0] << 8) + tile[1]; height = (tile[2] << 8) + tile[3]; if (count > 4 + width * height * 4) return [super iconTileImage]; iconTileImage = [[NSImage alloc] init]; imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL pixelsWide: width pixelsHigh: height bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSDeviceRGBColorSpace bytesPerRow: width * 4 bitsPerPixel: 32]; memcpy([imageRep bitmapData], &tile[4], width * height * 4); XFree(tile); [iconTileImage addRepresentation:imageRep]; RELEASE(imageRep); return AUTORELEASE(iconTileImage); } - (NSSize) iconSize { XIconSize *xiconsize; int count_return; int status; NSSize iconSize; status = XGetIconSizes(dpy, DefaultRootWindow(dpy), &xiconsize, &count_return); if (status) { if ((generic.wm & XGWM_WINDOWMAKER) != 0) { /* must add 4 pixels for the border which windowmaker leaves out but gnustep draws over. */ iconSize = NSMakeSize(xiconsize[0].max_width + 4, xiconsize[0].max_height + 4); } else { iconSize = NSMakeSize(xiconsize[0].max_width, xiconsize[0].max_height); } XFree(xiconsize); return iconSize; } return [super iconSize]; } - (unsigned int) numberOfDesktops: (int)screen { int c; unsigned int *num; unsigned int number = 0; num = (unsigned int*)PropGetCheckProperty(dpy, RootWindow(dpy, screen), generic._NET_NUMBER_OF_DESKTOPS_ATOM, XA_CARDINAL, 32, 1, &c); if (num) { number = *num; XFree(num); } return number; } - (NSArray *) namesOfDesktops: (int)screen { int c; char *names; names = (char *)PropGetCheckProperty(dpy, RootWindow(dpy, screen), generic._NET_DESKTOP_NAMES_ATOM, generic.UTF8_STRING_ATOM, 0, 0, &c); if (names) { NSMutableArray *array = [[NSMutableArray alloc] init]; char *p = names; while (p < names + c - 1) { [array addObject: [NSString stringWithUTF8String: p]]; p += strlen(p) + 1; } XFree(names); return AUTORELEASE(array); } return nil; } - (unsigned int) desktopNumberForScreen: (int)screen { int c; unsigned int *num; unsigned int number = 0; num = (unsigned int*)PropGetCheckProperty(dpy, RootWindow(dpy, screen), generic._NET_CURRENT_DESKTOP_ATOM, XA_CARDINAL, 32, 1, &c); if (num) { number = *num; XFree(num); } return number; } - (void) setDesktopNumber: (unsigned int)workspace forScreen: (int)screen { Window root = RootWindow(dpy, screen); [self _sendRoot: root type: generic._NET_CURRENT_DESKTOP_ATOM window: root data0: workspace data1: [self lastTime] data2: 0 data3: 0]; } - (unsigned int) desktopNumberForWindow: (int)win { gswindow_device_t *window; int c; unsigned int *num; unsigned int number = 0; window = WINDOW_WITH_TAG(win); if (!window) return 0; num = (unsigned int*)PropGetCheckProperty(dpy, window->ident, generic._NET_WM_DESKTOP_ATOM, XA_CARDINAL, 32, 1, &c); if (num) { number = *num; XFree(num); } return number; } - (void) setDesktopNumber: (unsigned int)workspace forWindow: (int)win { gswindow_device_t *window; window = WINDOW_WITH_TAG(win); if (!window) return; [self _sendRoot: window->root type: generic._NET_WM_DESKTOP_ATOM window: window->ident data0: workspace data1: 1 data2: 0 data3: 0]; } - (void) setShadow: (BOOL)hasShadow : (int)win { gswindow_device_t *window; unsigned long shadow; window = WINDOW_WITH_TAG(win); if (!window) return; if (hasShadow) { // FIXME: What size? shadow = (unsigned int)(0.1 * 0xffffffff); XChangeProperty(window->display, window->ident, generic._NET_WM_WINDOW_SHADOW_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&shadow, 1L); if (window->parent != window->root) { XChangeProperty(window->display, window->parent, generic._NET_WM_WINDOW_SHADOW_ATOM, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&shadow, 1); } } else { XDeleteProperty(window->display, window->ident, generic._NET_WM_WINDOW_SHADOW_ATOM); if (window->parent != window->root) { XDeleteProperty(window->display, window->parent, generic._NET_WM_WINDOW_SHADOW_ATOM); } } } - (BOOL) hasShadow: (int)win { gswindow_device_t *window; int c; unsigned int *num; BOOL hasShadow = NO; window = WINDOW_WITH_TAG(win); if (!window) return hasShadow; num = (unsigned int*)PropGetCheckProperty(dpy, window->ident, generic._NET_WM_WINDOW_SHADOW_ATOM, XA_CARDINAL, 32, 1, &c); if (num) { if (*num) hasShadow = YES; XFree(num); } return hasShadow; } /* * Check whether the window is miniaturized according to the ICCCM window * state property. */ - (int) _wm_state: (Window)win { long *data; long state; data = (long *)PropGetCheckProperty(dpy, win, generic.WM_STATE_ATOM, generic.WM_STATE_ATOM, 32, -1, NULL); if (data) { state = *data; XFree(data); } else state = WithdrawnState; return state; } /* * Check whether the EWMH window state includes the _NET_WM_STATE_HIDDEN * state. On EWMH, a window is iconified if it is iconic state and the * _NET_WM_STATE_HIDDEN is present. */ - (BOOL) _ewmh_isHidden: (Window)win { Atom *data; int count; int i; data = (Atom *)PropGetCheckProperty(dpy, win, generic._NET_WM_STATE_ATOM, XA_ATOM, 32, -1, &count); if (!data) // if we don't have any information, default to "No" return NO; for (i = 0; i < count; i++) { if (data[i] == generic._NET_WM_STATE_HIDDEN_ATOM) { XFree(data); return YES; } } XFree(data); return NO; } - (void) setParentWindow: (int)parentWin forChildWindow: (int)childWin { gswindow_device_t *cwindow; gswindow_device_t *pwindow; Window p; cwindow = WINDOW_WITH_TAG(childWin); if (!cwindow) return; pwindow = WINDOW_WITH_TAG(parentWin); if (!pwindow) p = None; else p = pwindow->ident; XSetTransientForHint(dpy, cwindow->ident, p); } - (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win { #if HAVE_XFIXES gswindow_device_t *window; XserverRegion region; int error; int xFixesEventBase; if (!XFixesQueryExtension(dpy, &xFixesEventBase, &error)) { return; } window = WINDOW_WITH_TAG(win); if (!window) { return; } if (ignoreMouse) { region = XFixesCreateRegion(dpy, NULL, 0); } else { region = None; } XFixesSetWindowShapeRegion(dpy, window->ident, ShapeInput, 0, 0, region); if (region != None) { XFixesDestroyRegion(dpy, region); } #endif } @end gnustep-back-0.29.0/Source/x11/XIMInputServer.m000066400000000000000000000415711404163720200210670ustar00rootroot00000000000000/* XIMInputServer - XIM Keyboard input handling Copyright (C) 2002 Free Software Foundation, Inc. Author: Christian Gillot Date: Nov 2001 Author: Adam Fedor Date: Jan 2002 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include #include "x11/XGInputServer.h" #include #define NoneStyle (XIMPreeditNone | XIMStatusNone) #define RootWindowStyle (XIMPreeditNothing | XIMStatusNothing) #define OffTheSpotStyle (XIMPreeditArea | XIMStatusArea) #define OverTheSpotStyle (XIMPreeditPosition | XIMStatusArea) #define OnTheSpotStyle (XIMPreeditCallbacks| XIMStatusCallbacks) @interface XIMInputServer (XIMPrivate) - (BOOL) ximInit: (Display *)dpy; - (void) ximClose; - (int) ximStyleInit; - (XIC) ximCreateIC: (Window)w; - (unsigned long) ximXicGetMask: (XIC)xic; @end #define BUF_LEN 255 @implementation XIMInputServer - (id) initWithDelegate: (id)aDelegate name: (NSString *)name { Display *dpy = [XGServer xDisplay]; return [self initWithDelegate: aDelegate display: dpy name: name]; } - (id) initWithDelegate: (id)aDelegate display: (Display *)dpy name: (NSString *)name { char *locale; delegate = aDelegate; ASSIGN(server_name, name); locale = setlocale(LC_CTYPE, ""); if (XSupportsLocale() != True) { NSLog(@"Xlib does not support locale setting %s", locale); /* FIXME: Should we reset the locale or just hope that X can deal with it? */ } #ifdef USE_XIM if ([self ximInit: dpy] == NO) { NSLog(@"Unable to initialize XIM, using standard keyboard events"); } #endif return self; } - (void) dealloc { DESTROY(server_name); [self ximClose]; [super dealloc]; } /* ---------------------------------------------------------------------- XInputFiltering protocol methods */ - (BOOL) filterEvent: (XEvent *)event { if (XFilterEvent(event, None)) { NSDebugLLog(@"NSKeyEvent", @"Event filtered by XIM\n"); return YES; } return NO; } - (NSString *) lookupStringForEvent: (XKeyEvent *)event window: (gswindow_device_t *)windev keysym: (KeySym *)keysymptr { int count = 0; NSString *keys = nil; KeySym keysym = 0; char buf[BUF_LEN]; /* Process characters */ /* N.B. The Xutf8LookupString manpage says this macro will be defined in the X headers if that function is available. */ #if defined(X_HAVE_UTF8_STRING) if (windev->ic && event->type == KeyPress) { Status status = 0; count = Xutf8LookupString(windev->ic, event, buf, BUF_LEN, &keysym, &status); if (status==XBufferOverflow) NSDebugLLog(@"NSKeyEvent",@"XmbLookupString buffer overflow\n"); if (count) { keys = [[[NSString alloc] initWithBytes: buf length: count encoding: NSUTF8StringEncoding] autorelease]; } if (status == XLookupKeySym || status == XLookupBoth) { if (keysymptr) *keysymptr = keysym; } } else #endif { /* Always returns a Latin-1 string according to the manpage */ count = XLookupString (event, buf, BUF_LEN, &keysym, NULL); if (count) { keys = [[[NSString alloc] initWithBytes: buf length: count encoding: NSISOLatin1StringEncoding] autorelease]; } if (keysymptr) *keysymptr = keysym; } return keys; } /* ---------------------------------------------------------------------- NSInputServiceProvider protocol methods */ - (void) activeConversationChanged: (id)sender toNewConversation: (long)newConversation { NSWindow *window; gswindow_device_t *windev; [super activeConversationChanged: sender toNewConversation: newConversation]; if ([sender respondsToSelector: @selector(window)] == NO) { [NSException raise: NSInvalidArgumentException format: @"NSTextInput sender does not respond to window"]; } window = [sender window]; windev = [XGServer _windowWithTag: [window windowNumber]]; if (windev == NULL) { [NSException raise: NSInvalidArgumentException format: @"NSTextInput sender has invalid window"]; } [self ximFocusICWindow: windev]; } - (void) activeConversationWillChange: (id)sender fromOldConversation: (long)oldConversation { [super activeConversationWillChange: sender fromOldConversation: oldConversation]; } /* ---------------------------------------------------------------------- XIM private methods */ - (BOOL) ximInit: (Display *)dpy { XClassHint class_hints; if (!XSetLocaleModifiers ("")) NSDebugLLog(@"XIM", @"can not set locale modifiers\n"); /* FIXME: Get these */ class_hints.res_name = class_hints.res_class = NULL; xim = XOpenIM(dpy, NULL, class_hints.res_name, class_hints.res_class); if (xim == NULL) { NSDebugLLog(@"XIM", @"Can't open XIM.\n"); return NO; } if (![self ximStyleInit]) { [self ximClose]; return NO; } NSDebugLLog(@"XIM", @"Initialized XIM\n"); return YES; } static XIMStyle betterStyle(XIMStyle a, XIMStyle b, XIMStyle xim_requested_style) { if (a == xim_requested_style) return a; if (b == xim_requested_style) return b; // N.B. We don't support OnTheSpotStyle so it is omitted here if (a == OverTheSpotStyle) return a; if (b == OverTheSpotStyle) return b; if (a == OffTheSpotStyle) return a; if (b == OffTheSpotStyle) return b; if (a == RootWindowStyle) return a; if (b == RootWindowStyle) return b; if (a == NoneStyle) return a; if (b == NoneStyle) return b; return 0; } - (int) ximStyleInit { NSUserDefaults *uds; NSString *request; XIMStyle xim_requested_style; XIMStyles *styles; char *failed_arg; int i; uds = [NSUserDefaults standardUserDefaults]; if ((request = [uds stringForKey: @"GSXIMInputMethodStyle"]) == nil) { xim_requested_style = RootWindowStyle; } else if ([request isEqual: @"RootWindow"]) { xim_requested_style = RootWindowStyle; } else if ([request isEqual: @"OffTheSpot"]) { xim_requested_style = OffTheSpotStyle; } else if ([request isEqual: @"OverTheSpot"]) { xim_requested_style = OverTheSpotStyle; } else if ([request isEqual: @"OnTheSpot"]) { xim_requested_style = OnTheSpotStyle; } else { NSLog(@"XIM: Unknown style '%@'.\n" @"Fallback to RootWindow style.", request); xim_requested_style = RootWindowStyle; } failed_arg = XGetIMValues(xim, XNQueryInputStyle, &styles, NULL); if (failed_arg != NULL) { NSDebugLLog(@"XIM", @"Can't getting the following IM value :%s", failed_arg); return 0; } for (i = 0; i < styles->count_styles; i++) { xim_style = betterStyle(xim_style, styles->supported_styles[i], xim_requested_style); } XFree(styles); if (xim_style == 0) { NSLog(@"XIM: no supported styles found"); return 0; } return 1; } - (void) ximClose { int i; for (i=0;iic == NULL) { windev->ic = [self ximCreateIC: windev->ident]; if (windev->ic == NULL) { [self ximClose]; } } #endif /* Now set focus to this window */ if (windev->ic) { NSDebugLLog(@"XIM", @"XSetICFocus to window %lu", windev->ident); XSetICFocus(windev->ic); } } - (XIC) ximCreateIC: (Window)w { XIC xic = NULL; if (xim_style == RootWindowStyle || xim_style == NoneStyle) { xic = XCreateIC(xim, XNInputStyle, xim_style, XNClientWindow, w, NULL); } else if (xim_style == OffTheSpotStyle || xim_style == OverTheSpotStyle) { Display *dpy = [XGServer xDisplay]; XFontSet font_set; char **missing_charset; int num_missing_charset; int dummy = 0; XVaNestedList preedit_args = NULL; XVaNestedList status_args = NULL; XRectangle status_area; XRectangle preedit_area; XPoint preedit_spot; NSString *ns_font_size; int font_size; char base_font_name[64]; // // Create a FontSet // // N.B. Because some input methods fail to provide a default font set, // we have to do it by ourselves. ns_font_size = [self fontSize: &font_size]; sprintf(base_font_name, "*medium-r-normal--%s*", [ns_font_size cString]); font_set = XCreateFontSet(dpy, base_font_name, &missing_charset, &num_missing_charset, NULL); if (!font_set) { goto finish; } if (missing_charset) { int i; NSLog(@"XIM: missing charset: "); for (i = 0; i < num_missing_charset; ++i) NSLog(@"%s", missing_charset[i]); XFreeStringList(missing_charset); } // // Create XIC. // // At least, XNFontSet and XNPreeditSpotLocation must be specified // at initialization time. // status_area.width = font_size * 2; status_area.height = font_size + 2; status_area.x = 0; status_area.y = 0; status_args = XVaCreateNestedList(dummy, XNArea, &status_area, XNFontSet, font_set, NULL); preedit_area.width = 120; preedit_area.height = status_area.height; preedit_area.x = 0; preedit_area.y = 0; preedit_spot.x = 0; preedit_spot.y = 0; preedit_args = XVaCreateNestedList(dummy, XNArea, &preedit_area, XNSpotLocation, &preedit_spot, XNFontSet, font_set, NULL); xic = XCreateIC(xim, XNInputStyle, xim_style, XNClientWindow, w, XNPreeditAttributes, preedit_args, XNStatusAttributes, status_args, NULL); if (preedit_args) { XFree(preedit_args); preedit_args = NULL; } if (status_args) { XFree(status_args); status_args = NULL; } if (font_set) XFreeFontSet(dpy, font_set); } else if (xim_style == OnTheSpotStyle) { NSLog(@"XIM: GNUstep doesn't support 'OnTheSpot'.\n" @"Fallback to RootWindow style."); xim_style = RootWindowStyle; xic = XCreateIC(xim, XNInputStyle, xim_style, XNClientWindow, w, NULL); } finish: if (xic == NULL) NSDebugLLog(@"XIM", @"Can't create the input context.\n"); xics = realloc(xics, sizeof(XIC) * (num_xics + 1)); xics[num_xics++] = xic; return xic; } - (unsigned long) ximXicGetMask: (XIC)xic { unsigned long xic_xmask = 0; if (XGetICValues(xic,XNFilterEvents,&xic_xmask,NULL)!=NULL) NSDebugLLog(@"XIM", @"Can't get the event mask for that input context"); return xic_xmask; } - (void) ximCloseIC: (XIC)xic { int i; for (i = 0; i < num_xics; i++) { if (xics[i] == xic) break; } if (i == num_xics) { NSLog(@"internal error in ximCloseIC: can't find XIC in list"); abort(); } for (i++; i < num_xics; i++) xics[i - 1] = xics[i]; num_xics--; XDestroyIC(xic); } @end @implementation XIMInputServer (InputMethod) - (NSString *) inputMethodStyle { if (num_xics > 0) { if (xim_style == RootWindowStyle) return @"RootWindow"; else if (xim_style == OffTheSpotStyle) return @"OffTheSpot"; else if (xim_style == OverTheSpotStyle) return @"OverTheSpot"; else if (xim_style == OnTheSpotStyle) return @"OnTheSpot"; } return nil; } - (NSString *) fontSize: (int *)size { NSString *str; str = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSFontSize"]; if (!str) str = @"12"; *size = (int)strtol([str cString], NULL, 10); return str; } - (BOOL) clientWindowRect: (NSRect *)rect { Window win; Window dummy; Display *dpy; int abs_x, abs_y; int x, y; unsigned int w, h; unsigned int bw, d; if (num_xics <= 0 || !rect) return NO; *rect = NSMakeRect(0, 0, 0, 0); if (XGetICValues(xics[num_xics - 1], XNClientWindow, &win, NULL)) return NO; dpy = [XGServer xDisplay]; if (XTranslateCoordinates(dpy, win, DefaultRootWindow(dpy), 0, 0, &abs_x, &abs_y, &dummy) == 0) return NO; XGetGeometry(dpy, win, &dummy, &x, &y, &w, &h, &bw, &d); // X Window Coordinates to GNUstep Coordinates x = abs_x; y = XDisplayHeight(dpy, 0) - (abs_y + h); *rect = NSMakeRect((float)x, (float)y, (float)w, (float)h); return YES; } - (BOOL) statusArea: (NSRect *)rect { if (num_xics > 0 && (xim_style & XIMStatusArea)) { XRectangle area; int dummy = 0; XVaNestedList arglist = NULL; if (!(arglist = XVaCreateNestedList(dummy, XNArea, &area, NULL))) { return NO; } XGetICValues(xics[num_xics - 1], XNStatusAttributes, arglist, NULL); rect->origin.x = area.x; rect->origin.y = area.y; rect->size.width = area.width; rect->size.height = area.height; if (arglist) { XFree(arglist); arglist = NULL; } return YES; } return NO; } - (BOOL) preeditArea: (NSRect *)rect { if (num_xics > 0 && ((xim_style & XIMPreeditArea) || (xim_style & XIMPreeditPosition))) { XRectangle area; int dummy = 0; XVaNestedList arglist = NULL; if (!(arglist = XVaCreateNestedList(dummy, XNArea, &area, NULL))) { return NO; } XGetICValues(xics[num_xics - 1], XNPreeditAttributes, arglist, NULL); rect->origin.x = area.x; rect->origin.y = area.y; rect->size.width = area.width; rect->size.height = area.height; if (arglist) { XFree(arglist); arglist = NULL; } return YES; } return NO; } - (BOOL) preeditSpot: (NSPoint *)p { if (num_xics > 0 && (xim_style & XIMPreeditPosition)) { XPoint spot; int dummy = 0; XVaNestedList arglist = NULL; if (!(arglist = XVaCreateNestedList(dummy, XNSpotLocation, &spot, NULL))) { return NO; } XGetICValues(xics[num_xics - 1], XNPreeditAttributes, arglist, NULL); p->x = spot.x; p->y = spot.y; if (arglist) { XFree(arglist); arglist = NULL; } return YES; } return NO; } - (BOOL) setStatusArea: (NSRect *)rect { if (num_xics > 0 && (xim_style & XIMStatusArea)) { XRectangle area; int dummy = 0; XVaNestedList arglist = NULL; area.x = rect->origin.x; area.y = rect->origin.y; area.width = rect->size.width; area.height = rect->size.height; if (!(arglist = XVaCreateNestedList(dummy, XNArea, &area, NULL))) { return NO; } XSetICValues(xics[num_xics - 1], XNStatusAttributes, arglist, NULL); if (arglist) { XFree(arglist); arglist = NULL; } return YES; } return NO; } - (BOOL) setPreeditArea: (NSRect *)rect { if (num_xics > 0 && ((xim_style & XIMPreeditArea) || (xim_style & XIMPreeditPosition))) { XRectangle area; int dummy = 0; XVaNestedList arglist = NULL; area.x = rect->origin.x; area.y = rect->origin.y; area.width = rect->size.width; area.height = rect->size.height; if (!(arglist = XVaCreateNestedList(dummy, XNArea, &area, NULL))) { return NO; } XSetICValues(xics[num_xics - 1], XNPreeditAttributes, arglist, NULL); if (arglist) { XFree(arglist); arglist = NULL; } return YES; } return NO; } - (BOOL) setPreeditSpot: (NSPoint *)p { if (num_xics > 0 && (xim_style & XIMPreeditPosition)) { XPoint spot; int dummy = 0; XVaNestedList arglist = NULL; spot.x = p->x; spot.y = p->y; if (!(arglist = XVaCreateNestedList(dummy, XNSpotLocation, &spot, NULL))) { return NO; } XSetICValues(xics[num_xics - 1], XNPreeditAttributes, arglist, NULL); if (arglist) { XFree(arglist); arglist = NULL; } return YES; } return NO; } @end // XIMInputServer (InputMethod) gnustep-back-0.29.0/Source/x11/XWindowBuffer.m000066400000000000000000000516471404163720200207610ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Author: Alexander Malmberg This file is part of GNUstep. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "x11/XGServer.h" #include "x11/XGServerWindow.h" #include "x11/XWindowBuffer.h" #include #include #include #ifdef HAVE_XSHAPE #include #endif static XWindowBuffer **window_buffers; static int num_window_buffers; static int use_shape_hack = 0; /* this is an ugly hack : ) */ #ifdef XSHM static int did_test_xshm = 0; static int use_xshm = 1; static Bool use_xshm_pixmaps = 0; static int num_xshm_test_errors = 0; static int test_xshm_error_handler(Display *d, XErrorEvent *ev) { num_xshm_test_errors++; return 0; } static void test_xshm(Display *display, Visual *visual, int drawing_depth) { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; did_test_xshm = 1; if ([ud objectForKey: @"XWindowBufferUseXShm"]) use_xshm = [ud boolForKey: @"XWindowBufferUseXShm"]; /* If the user doesn't want XShm, there's no point in doing any further testing. */ if (!use_xshm) return; /* This seems to return success if the X server understands the XShm protocol, regardless of whether XShm can actually be used or not... */ { int major, minor; if (!XShmQueryExtension(display) || !XShmQueryVersion(display, &major, &minor, &use_xshm_pixmaps)) { NSLog(@"XShm not supported by X server."); NSLog(@"Falling back to normal XImage (will be slower)."); use_xshm = 0; return; } } /* ... so we check that it actually works here. To do this, we need to set up our own error handler (because the xlib calls never fail, they just cause error events to be sent to us), explicitly synchronize (or we wouldn't get to handle, and thus detect, the errors until much later), and try actually creating a XShm image. Yuck. */ { XImage *ximage; XShmSegmentInfo shminfo; int (*old_error_handler)(); old_error_handler = XSetErrorHandler(test_xshm_error_handler); ximage = XShmCreateImage(display, visual, drawing_depth, ZPixmap, NULL, &shminfo, 1, 1); XSync(display, False); if (!ximage || num_xshm_test_errors) { NSLog(@"XShm not supported, XShmCreateImage failed."); goto no_xshm; } shminfo.shmid = shmget(IPC_PRIVATE, 64, /* We don't have exact bytes per row values here, but this should be safe, and we'll probably get a full page anyway. (And if it turns out not to be enough, the X server will notice and give us errors, causing us to think that XShm isn't supported.) */ IPC_CREAT | 0700); if (shminfo.shmid == -1 || num_xshm_test_errors) { NSLog(@"XShm not supported, shmget() failed: %m."); XDestroyImage(ximage); goto no_xshm; } shminfo.shmaddr = shmat(shminfo.shmid, 0, 0); if ((intptr_t)shminfo.shmaddr == -1 || num_xshm_test_errors) { NSLog(@"XShm not supported, shmat() failed: %m."); XDestroyImage(ximage); shmctl(shminfo.shmid, IPC_RMID, 0); goto no_xshm; } shminfo.readOnly = 0; if (!XShmAttach(display, &shminfo)) num_xshm_test_errors++; XSync(display, False); if (num_xshm_test_errors) { NSLog(@"XShm not supported, XShmAttach() failed."); XDestroyImage(ximage); shmdt(shminfo.shmaddr); shmctl(shminfo.shmid, IPC_RMID, 0); goto no_xshm; } XShmDetach(display, &shminfo); XDestroyImage(ximage); shmdt(shminfo.shmaddr); /* Most of the time, all the above calls will return success despite actually failing. To catch all errors generated by the calls before returning, we synchronize here. */ XSync(display, False); shmctl(shminfo.shmid, IPC_RMID, 0); if (num_xshm_test_errors) { NSLog(@"XShm not supported."); no_xshm: NSLog(@"Falling back to normal XImage (will be slower)."); use_xshm = 0; } XSetErrorHandler(old_error_handler); } } #endif @implementation XWindowBuffer + (void) initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; use_shape_hack = [ud boolForKey: @"XWindowBuffer-shape-hack"]; } + windowBufferForWindow: (gswindow_device_t *)awindow depthInfo: (struct XWindowBuffer_depth_info_s *)aDI { int i; XWindowBuffer *wi; int drawing_depth; Visual *visual; for (i = 0; i < num_window_buffers; i++) { if (window_buffers[i]->window == awindow) break; } if (i == num_window_buffers) { wi = [[XWindowBuffer alloc] init]; wi->window = awindow; window_buffers = realloc(window_buffers, sizeof(XWindowBuffer *) * (num_window_buffers + 1)); if (!window_buffers) { NSLog(@"Out of memory (failed to allocate %lu bytes)", (unsigned long)sizeof(XWindowBuffer *) * (num_window_buffers + 1)); exit(1); } window_buffers[num_window_buffers++] = wi; } else { wi = window_buffers[i]; wi = RETAIN(wi); } wi->DI = *aDI; wi->gc = awindow->gc; wi->drawable = awindow->ident; wi->display = awindow->display; wi->window->gdriverProtocol = GDriverHandlesExpose | GDriverHandlesBacking; wi->window->gdriver = wi; #if 0 drawing_depth = aDI->drawing_depth; visual = DefaultVisual(wi->display, DefaultScreen(wi->display)); #else // Better to get the used visual from the XGServer. visual = [(XGServer*)GSCurrentServer() screenVisual]; drawing_depth = [(XGServer*)GSCurrentServer() screenDepth]; #endif /* TODO: resolve properly. -x11 is creating buffers before I have a chance to tell it not to, so I'm freeing them here to reduce memory consumption (and prevent leaks, though that should be fixed now) */ if (awindow->buffer) { XFreePixmap (awindow->display, awindow->buffer); awindow->buffer = 0; } if (awindow->alpha_buffer) { XFreePixmap (awindow->display, awindow->alpha_buffer); awindow->alpha_buffer = 0; } /* create the image if necessary */ if (!wi->ximage || wi->sx != awindow->xframe.size.width || wi->sy != awindow->xframe.size.height) { /* printf("%@ updating image for %p (%gx%g)\n", wi, wi->window, wi->window->xframe.size.width, wi->window->xframe.size.height);*/ if (wi->ximage) { #ifdef XSHM if (wi->use_shm) { XShmDetach(wi->display, &wi->shminfo); XDestroyImage(wi->ximage); shmdt(wi->shminfo.shmaddr); } else #endif XDestroyImage(wi->ximage); } if (wi->pixmap) { XFreePixmap(wi->display,wi->pixmap); XSetWindowBackground(wi->display,wi->window->ident,None); wi->pixmap=0; } wi->has_alpha = 0; if (wi->alpha) { free(wi->alpha); wi->alpha = NULL; } wi->pending_put = wi->pending_event = 0; wi->ximage = NULL; /* TODO: only use shared memory for 'real' on-screen windows. how can we tell? don't create shared buffer until first expose? */ /* The primary problems seems to be the system limit on the _number_ of shared memory segments, not their total size, so we only create shared buffers for reasonably large buffers and assume that the small ones are just caches of images and will never be displayed, anyway (and if they are displayed, it won't cost much, since they're small). */ if (wi->window->xframe.size.width * wi->window->xframe.size.height < 4096) goto no_xshm; #ifdef XSHM if (!did_test_xshm) test_xshm(wi->display, visual, drawing_depth); if (!use_xshm) goto no_xshm; /* Use XShm if possible, else fall back to normal XImage: s */ wi->use_shm = 1; wi->ximage = XShmCreateImage(wi->display, visual, drawing_depth, ZPixmap, NULL, &wi->shminfo, wi->window->xframe.size.width, wi->window->xframe.size.height); if (!wi->ximage) { NSLog(@"Warning: XShmCreateImage failed!"); NSLog(@"Falling back to normal XImage (will be slower)."); goto no_xshm; } wi->shminfo.shmid = shmget(IPC_PRIVATE, wi->ximage->bytes_per_line * wi->ximage->height, IPC_CREAT | 0700); if (wi->shminfo.shmid == -1) { NSLog(@"Warning: shmget() failed: %m."); NSLog(@"Falling back to normal XImage (will be slower)."); XDestroyImage(wi->ximage); goto no_xshm; } wi->shminfo.shmaddr = wi->ximage->data = shmat(wi->shminfo.shmid, 0, 0); if ((intptr_t)wi->shminfo.shmaddr == -1) { NSLog(@"Warning: shmat() failed: %m."); NSLog(@"Falling back to normal XImage (will be slower)."); XDestroyImage(wi->ximage); shmctl(wi->shminfo.shmid, IPC_RMID, 0); goto no_xshm; } wi->shminfo.readOnly = 0; if (!XShmAttach(wi->display, &wi->shminfo)) { NSLog(@"Warning: XShmAttach() failed."); NSLog(@"Falling back to normal XImage (will be slower)."); XDestroyImage(wi->ximage); shmdt(wi->shminfo.shmaddr); shmctl(wi->shminfo.shmid, IPC_RMID, 0); goto no_xshm; } if (use_xshm_pixmaps) { /* We try to create a shared pixmap using the same buffer, and set it as the background of the window. This allows X to handle expose events all by itself, which avoids white flashing when things are dragged across a window. */ /* TODO: we still get and handle expose events, although we don't need to. */ wi->pixmap = XShmCreatePixmap(wi->display, wi->drawable, wi->ximage->data, &wi->shminfo, wi->window->xframe.size.width, wi->window->xframe.size.height, drawing_depth); if (wi->pixmap) /* TODO: this doesn't work */ { XSetWindowBackgroundPixmap(wi->display, wi->window->ident, wi->pixmap); } } /* On some systems (eg. freebsd), X can't attach to the shared segment if it's marked for destruction, so we make sure it's attached before marking it. */ XSync(wi->display, False); /* Mark the segment as destroyed now. Since we're attached, it won't actually be destroyed, but if we crashed before doing this, it wouldn't be destroyed despite nobody being attached anymore. */ shmctl(wi->shminfo.shmid, IPC_RMID, 0); #endif if (!wi->ximage) { no_xshm: wi->use_shm = 0; wi->ximage = XCreateImage(wi->display, visual, drawing_depth, ZPixmap, 0, NULL, wi->window->xframe.size.width, wi->window->xframe.size.height, 8, 0); /* Normally, the data of an XImage is saved with the X server's byte order. However, some backends (notably cairo) use the native byte order of the client for the backend image, hence we must set the image's byte order here. Without this, GNUstep applications would display wrong colors on an X server that is running on a machine with a different byte order than the client (bug #28590). */ wi->ximage->byte_order = wi->DI.byte_order; wi->ximage->data = malloc(wi->ximage->height * wi->ximage->bytes_per_line); if (!wi->ximage->data) { XDestroyImage(wi->ximage); wi->ximage = NULL; } /*TODO? wi->ximage = XGetImage(wi->display, wi->drawable, 0, 0, wi->window->xframe.size.width, wi->window->xframe.size.height, -1, ZPixmap);*/ } } if (wi->ximage) { wi->sx = wi->ximage->width; wi->sy = wi->ximage->height; wi->data = (unsigned char *)wi->ximage->data; wi->bytes_per_line = wi->ximage->bytes_per_line; wi->bits_per_pixel = wi->ximage->bits_per_pixel; wi->bytes_per_pixel = wi->bits_per_pixel / 8; // NSLog(@"%@ ximage=%p data=%p\n", wi->ximage, wi->data); } else { NSLog(@"Warning: failed to create image for window!"); wi->data = NULL; } return AUTORELEASE(wi); } extern int XShmGetEventBase(Display *d); - (void) _gotShmCompletion { #ifdef XSHM if (!use_shm) return; pending_event = 0; if (pending_put) { pending_put = 0; if (pending_rect.x + pending_rect.w > window->xframe.size.width) { pending_rect.w = window->xframe.size.width - pending_rect.x; if (pending_rect.w <= 0) return; } if (pending_rect.y + pending_rect.h > window->xframe.size.height) { pending_rect.h = window->xframe.size.height - pending_rect.y; if (pending_rect.h <= 0) return; } if (!XShmPutImage(display, drawable, gc, ximage, pending_rect.x, pending_rect.y, pending_rect.x, pending_rect.y, pending_rect.w, pending_rect.h, 1)) { NSLog(@"XShmPutImage failed?"); } else { pending_event = 1; } } // XFlush(window->display); #endif } - (void) _exposeRect: (NSRect)rect { /* TODO: Somehow, we can get negative coordinates in the rectangle. So far I've tracked them back to [NSWindow flushWindow]. Should probably figure out where they're coming from originally, and see if they really should be negative. (Seems to happen when a window is created or resized, so possibly something is refreshing while coordinates are still invalid. Also, just about every resize of a window causes a few calls here with rects in the new size before we are updated. For now, we just intersect with our known size to avoid problems with X. And, to avoid problems with clever optimizations and float vs. double accuracy, we do the test using int: s. */ int x, y, w, h; x = floor(rect.origin.x); y = floor(rect.origin.y); w = ceil(rect.size.width + rect.origin.x - x); h = ceil(rect.size.height + rect.origin.y - y); if (x < 0) { w += x; x = 0; } if (y < 0) { h += y; y = 0; } if (x + w > sx) { w = sx - x; } if (y + h > sy) { h = sy - y; } if (w <= 0 || h <= 0) return; #ifdef XSHM if (use_shm) { #ifdef HAVE_XSHAPE /* HACK: lets try to use shaped windows to get some use out of destination alpha */ if (has_alpha && use_shape_hack) { static int warn = 0; Pixmap p; int dsize = ((sx + 7) / 8) * sy; unsigned char *buf = malloc(dsize); unsigned char *dst; int bofs; unsigned char *a; int as; int i, x; if (!warn) NSLog(@"Warning: activating shaped windows"); warn = 1; memset(buf, 0xff, dsize); #define CUTOFF 128 if (DI.inline_alpha) { a = data + DI.inline_alpha_ofs; as = DI.bytes_per_pixel; } else { a = alpha; as = 1; } for (bofs = 0, i = sx * sy, x = sx, dst = buf; i; i--, a += as) { if (*a < CUTOFF) { *dst = *dst & ~(1 << bofs); } bofs++; if (bofs == 8) { dst++; bofs = 0; } x--; if (!x) { if (bofs) { bofs = 0; dst++; } x = sx; } } #undef CUTOFF //NSLog(@"check shape"); if (old_shape_size == dsize && !memcmp(old_shape, buf, dsize)) { free(buf); // NSLog(@" same shape"); } else { // NSLog(@" updating"); p = XCreatePixmapFromBitmapData(display, window->ident, (char *)buf, sx, sy, 1, 0, 1); free(old_shape); old_shape = buf; old_shape_size = dsize; XShapeCombineMask(display, window->ident, ShapeBounding, 0, 0, p, ShapeSet); XFreePixmap(display, p); } } #endif // HAVE_XSHAPE if (pending_event) { if (!pending_put) { pending_put = 1; pending_rect.x = x; pending_rect.y = y; pending_rect.w = w; pending_rect.h = h; } else { if (x < pending_rect.x) { pending_rect.w += pending_rect.x - x; pending_rect.x = x; } if (x + w > pending_rect.x + pending_rect.w) { pending_rect.w = x + w - pending_rect.x; } if (y < pending_rect.y) { pending_rect.h += pending_rect.y - y; pending_rect.y = y; } if (y + h > pending_rect.y + pending_rect.h) { pending_rect.h = y + h - pending_rect.y; } } } else { pending_put = 0; if (!XShmPutImage(display, drawable, gc, ximage, x, y, x, y, w, h, 1)) { NSLog(@"XShmPutImage failed?"); } else { pending_event = 1; } } /* Performance hack. Check right away for ShmCompletion events. */ { XEvent e; while (XCheckTypedEvent(window->display, XShmGetEventBase(window->display) + ShmCompletion, &e)) { [[self class] _gotShmCompletion: ((XShmCompletionEvent *)&e)->drawable]; } } } else #endif if (ximage) { XPutImage(display, drawable, gc, ximage, x, y, x, y, w, h); } } - (void) needsAlpha { if (has_alpha) return; if (!data) return; // NSLog(@"needs alpha for %p: %ix%i", self, sx, sy); if (DI.inline_alpha) { int i; unsigned char *s; alpha = NULL; has_alpha = 1; /* fill the alpha channel */ for (i = 0, s = data + DI.inline_alpha_ofs; i < sx * sy; i++, s += DI.bytes_per_pixel) *s = 0xff; return; } alpha = malloc(sx * sy); if (!alpha) { NSLog(@"Warning! Failed to allocate alpha buffer for window!"); return; } // NSLog(@"got buffer at %p", alpha); has_alpha = 1; memset(alpha, 0xff, sx * sy); } - (void) dealloc { int i; for (i = 0; i < num_window_buffers; i++) if (window_buffers[i] == self) break; if (i < num_window_buffers) { num_window_buffers--; for (; i < num_window_buffers; i++) window_buffers[i] = window_buffers[i + 1]; } if (ximage) { if (pixmap) { XFreePixmap(display,pixmap); pixmap=0; } #ifdef XSHM if (use_shm) { XShmDetach(display, &shminfo); XDestroyImage(ximage); shmdt(shminfo.shmaddr); } else #endif XDestroyImage(ximage); } if (alpha) free(alpha); [super dealloc]; } + (void) _gotShmCompletion: (Drawable)d { int i; for (i = 0; i < num_window_buffers; i++) { if (window_buffers[i]->drawable == d) { [window_buffers[i] _gotShmCompletion]; return; } } } @end gnustep-back-0.29.0/Source/x11/context.c000066400000000000000000000534111404163720200176710ustar00rootroot00000000000000/* context.c - X context management * * Raster graphics library * * Copyright (c) 1997-2002 Alfredo K. Kojima * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #include #include #include "wrasterP.h" #ifdef HAVE_HERMES #include #endif #include "x11/StdCmap.h" #include "x11/wraster.h" #ifdef XRENDER #include #endif extern void _wraster_change_filter(int type); static Bool bestContext(Display *dpy, int screen_number, RContext *context); static RContextAttributes DEFAULT_CONTEXT_ATTRIBS = { RC_UseSharedMemory|RC_RenderMode|RC_ColorsPerChannel, /* flags */ RDitheredRendering, /* render_mode */ 4, /* colors_per_channel */ 0, 0, 0, 0, True, /* use_shared_memory */ RMitchellFilter, RUseStdColormap }; char** RSupportedFileFormats(void) { static char *tmp[2]; tmp[0] = NULL; return tmp; } /* * * Colormap allocation for PseudoColor visuals: * * * switch standardColormap: * none: * allocate colors according to colors_per_channel * * best/default: * if there's a std colormap defined then use it * * else * create a std colormap and set it */ /* *---------------------------------------------------------------------- * allocateStandardPseudoColor * Creates the internal colormap for PseudoColor, setting the * color values according to the supplied standard colormap. * * Returns: - * * Side effects: - * * Notes: - *---------------------------------------------------------------------- */ static Bool allocateStandardPseudoColor(RContext *ctx, XStandardColormap *stdcmap) { int i; ctx->ncolors = stdcmap->red_max * stdcmap->red_mult + stdcmap->green_max * stdcmap->green_mult + stdcmap->blue_max * stdcmap->blue_mult + 1; if (ctx->ncolors <= 1) { RErrorCode = RERR_INTERNAL; puts("wraster: bad standard colormap"); return False; } ctx->colors = malloc(sizeof(XColor)*ctx->ncolors); if (!ctx->colors) { RErrorCode = RERR_NOMEMORY; return False; } ctx->pixels = malloc(sizeof(unsigned long)*ctx->ncolors); if (!ctx->pixels) { free(ctx->colors); ctx->colors = NULL; RErrorCode = RERR_NOMEMORY; return False; } #define calc(max,mult) (((i / stdcmap->mult) % \ (stdcmap->max + 1)) * 65535) / stdcmap->max for (i = 0; i < ctx->ncolors; i++) { ctx->colors[i].pixel = i + stdcmap->base_pixel; ctx->colors[i].red = calc(red_max, red_mult); ctx->colors[i].green = calc(green_max, green_mult); ctx->colors[i].blue = calc(blue_max, blue_mult); ctx->pixels[i] = ctx->colors[i].pixel; } #undef calc return True; } static Bool setupStandardColormap(RContext *ctx, Atom property) { if (!XmuLookupStandardColormap(ctx->dpy, ctx->screen_number, ctx->visual->visualid, ctx->depth, property, True, True)) { RErrorCode = RERR_STDCMAPFAIL; return False; } return True; } static Bool allocatePseudoColor(RContext *ctx) { XColor *colors; XColor avcolors[256]; int avncolors; int i, ncolors, r, g, b; int retries; int cpc = ctx->attribs->colors_per_channel; ncolors = cpc * cpc * cpc; if (ncolors > (1<depth)) { /* reduce colormap size */ cpc = ctx->attribs->colors_per_channel = 1<<((int)ctx->depth/3); ncolors = cpc * cpc * cpc; } assert(cpc >= 2 && ncolors <= (1<depth)); colors = malloc(sizeof(XColor)*ncolors); if (!colors) { RErrorCode = RERR_NOMEMORY; return False; } ctx->pixels = malloc(sizeof(unsigned long)*ncolors); if (!ctx->pixels) { free(colors); RErrorCode = RERR_NOMEMORY; return False; } i=0; if ((ctx->attribs->flags & RC_GammaCorrection) && ctx->attribs->rgamma > 0 && ctx->attribs->ggamma > 0 && ctx->attribs->bgamma > 0) { double rg, gg, bg; double tmp; /* do gamma correction */ rg = 1.0/ctx->attribs->rgamma; gg = 1.0/ctx->attribs->ggamma; bg = 1.0/ctx->attribs->bgamma; for (r=0; rdpy, ctx->cmap, &(colors[i]))) { colors[i].flags = 0; /* failed */ } else { colors[i].flags = DoRed|DoGreen|DoBlue; } } /* try to allocate close values for the colors that couldn't * be allocated before */ avncolors = (1<depth>256 ? 256 : 1<depth); for (i=0; idpy, ctx->cmap, avcolors, avncolors); for (i=0; i>8; g = (colors[i].green - avcolors[i].green)>>8; b = (colors[i].blue - avcolors[i].blue)>>8; diff = r*r + g*g + b*b; if (diffdpy, ctx->cmap, &colors[i])) { colors[i].flags = DoRed|DoGreen|DoBlue; break; /* succeeded, don't need to retry */ } #ifdef DEBUG printf("close color allocation failed. Retrying...\n"); #endif } } } ctx->colors = colors; ctx->ncolors = ncolors; /* fill the pixels shortcut array */ for (i = 0; i < ncolors; i++) { ctx->pixels[i] = ctx->colors[i].pixel; } return True; } static XColor* allocateGrayScale(RContext *ctx) { XColor *colors; XColor avcolors[256]; int avncolors; int i, ncolors, r, g, b; int retries; int cpc = ctx->attribs->colors_per_channel; ncolors = cpc * cpc * cpc; if (ctx->vclass == StaticGray) { /* we might as well use all grays */ ncolors = 1<depth; } else { if ( ncolors > (1<depth) ) { /* reduce colormap size */ cpc = ctx->attribs->colors_per_channel = 1<<((int)ctx->depth/3); ncolors = cpc * cpc * cpc; } assert(cpc >= 2 && ncolors <= (1<depth)); } if (ncolors>=256 && ctx->vclass==StaticGray) { /* don't need dithering for 256 levels of gray in StaticGray visual */ ctx->attribs->render_mode = RBestMatchRendering; } colors = malloc(sizeof(XColor)*ncolors); if (!colors) { RErrorCode = RERR_NOMEMORY; return False; } for (i=0; idpy, ctx->cmap, &(colors[i]))) { colors[i].flags = 0; /* failed */ #ifdef DEBUG printf("failed:%x,%x,%x\n",colors[i].red,colors[i].green,colors[i].blue); #endif } else { colors[i].flags = DoRed|DoGreen|DoBlue; #ifdef DEBUG printf("success:%x,%x,%x\n",colors[i].red,colors[i].green,colors[i].blue); #endif } } /* try to allocate close values for the colors that couldn't * be allocated before */ avncolors = (1<depth>256 ? 256 : 1<depth); for (i=0; idpy, ctx->cmap, avcolors, avncolors); for (i=0; i>8; g = (colors[i].green - avcolors[i].green)>>8; b = (colors[i].blue - avcolors[i].blue)>>8; diff = r*r + g*g + b*b; if (diff %x,%x,%x\n",colors[i].red,colors[i].green,colors[i].blue,avcolors[closest].red,avcolors[closest].green,avcolors[closest].blue); #endif colors[i].red = avcolors[closest].red; colors[i].green = avcolors[closest].green; colors[i].blue = avcolors[closest].blue; if (XAllocColor(ctx->dpy, ctx->cmap, &colors[i])) { colors[i].flags = DoRed|DoGreen|DoBlue; break; /* succeeded, don't need to retry */ } #ifdef DEBUG printf("close color allocation failed. Retrying...\n"); #endif } } } return colors; } static Bool setupPseudoColorColormap(RContext *context) { Atom property = 0; if (context->attribs->standard_colormap_mode == RCreateStdColormap) { property = XInternAtom(context->dpy, "RGB_DEFAULT_MAP", False); if (!setupStandardColormap(context, property)) { return False; } } if (context->attribs->standard_colormap_mode != RIgnoreStdColormap) { XStandardColormap *maps; int count, i; if (!property) { property = XInternAtom(context->dpy, "RGB_BEST_MAP", False); if (!XGetRGBColormaps(context->dpy, DefaultRootWindow(context->dpy), &maps, &count, property)) { maps = NULL; } if (!maps) { property = XInternAtom(context->dpy, "RGB_DEFAULT_MAP", False); if (!XGetRGBColormaps(context->dpy, DefaultRootWindow(context->dpy), &maps, &count, property)) { maps = NULL; } } } else { if (!XGetRGBColormaps(context->dpy, DefaultRootWindow(context->dpy), &maps, &count, property)) { maps = NULL; } } if (maps) { int theMap = -1; for (i = 0; i < count; i++) { if (maps[i].visualid == context->visual->visualid) { theMap = i; break; } } if (theMap < 0) { puts("wrlib: no std cmap found"); } if (theMap >= 0 && allocateStandardPseudoColor(context, &maps[theMap])) { context->std_rgb_map = XAllocStandardColormap(); *context->std_rgb_map = maps[theMap]; context->cmap = context->std_rgb_map->colormap; XFree(maps); return True; } XFree(maps); } } context->attribs->standard_colormap_mode = RIgnoreStdColormap; /* RIgnoreStdColormap and fallback */ return allocatePseudoColor(context); } static char* mygetenv(char *var, int scr) { char *p; char varname[64]; sprintf(varname, "%s%i", var, scr); p = getenv(varname); if (!p) { p = getenv(var); } return p; } static void gatherconfig(RContext *context, int screen_n) { char *ptr; ptr = mygetenv("WRASTER_GAMMA", screen_n); if (ptr) { float g1,g2,g3; if (sscanf(ptr, "%f/%f/%f", &g1, &g2, &g3)!=3 || g1<=0.0 || g2<=0.0 || g3<=0.0) { printf("wrlib: invalid value(s) for gamma correction \"%s\"\n", ptr); } else { context->attribs->flags |= RC_GammaCorrection; context->attribs->rgamma = g1; context->attribs->ggamma = g2; context->attribs->bgamma = g3; } } ptr = mygetenv("WRASTER_COLOR_RESOLUTION", screen_n); if (ptr) { int i; if (sscanf(ptr, "%d", &i)!=1 || i<2 || i>6) { printf("wrlib: invalid value for color resolution \"%s\"\n",ptr); } else { context->attribs->flags |= RC_ColorsPerChannel; context->attribs->colors_per_channel = i; } } ptr = mygetenv("WRASTER_OPTIMIZE_FOR_SPEED", screen_n); if (ptr) { context->flags.optimize_for_speed = 1; } else { context->flags.optimize_for_speed = 0; } } static void getColormap(RContext *context, int screen_number) { Colormap cmap = None; XStandardColormap *cmaps; int ncmaps, i; if (XGetRGBColormaps(context->dpy, RootWindow(context->dpy, screen_number), &cmaps, &ncmaps, XA_RGB_DEFAULT_MAP)) { for (i=0; ivisual->visualid) { cmap = cmaps[i].colormap; break; } } XFree(cmaps); } if (cmap == None) { XColor color; cmap = XCreateColormap(context->dpy, RootWindow(context->dpy, screen_number), context->visual, AllocNone); color.red = color.green = color.blue = 0; XAllocColor(context->dpy, cmap, &color); context->black = color.pixel; color.red = color.green = color.blue = 0xffff; XAllocColor(context->dpy, cmap, &color); context->white = color.pixel; } context->cmap = cmap; } static int count_offset(unsigned long mask) { int i; i=0; while ((mask & 1)==0) { i++; mask = mask >> 1; } return i; } RContext* RCreateContext(Display *dpy, int screen_number, RContextAttributes *attribs) { RContext *context; XGCValues gcv; context = malloc(sizeof(RContext)); if (!context) { RErrorCode = RERR_NOMEMORY; return NULL; } memset(context, 0, sizeof(RContext)); context->dpy = dpy; context->screen_number = screen_number; context->attribs = malloc(sizeof(RContextAttributes)); if (!context->attribs) { free(context); RErrorCode = RERR_NOMEMORY; return NULL; } if (!attribs) *context->attribs = DEFAULT_CONTEXT_ATTRIBS; else *context->attribs = *attribs; if (!(context->attribs->flags & RC_StandardColormap)) { context->attribs->standard_colormap_mode = RUseStdColormap; } if (!(context->attribs->flags & RC_ScalingFilter)) { context->attribs->flags |= RC_ScalingFilter; context->attribs->scaling_filter = RMitchellFilter; } /* get configuration from environment variables */ gatherconfig(context, screen_number); #ifndef BENCH _wraster_change_filter(context->attribs->scaling_filter); #endif if ((context->attribs->flags & RC_VisualID)) { XVisualInfo *vinfo, templ; int nret; templ.screen = screen_number; templ.visualid = context->attribs->visualid; vinfo = XGetVisualInfo(context->dpy, VisualIDMask|VisualScreenMask, &templ, &nret); if (!vinfo || nret==0) { free(context); RErrorCode = RERR_BADVISUALID; return NULL; } if (vinfo[0].visual == DefaultVisual(dpy, screen_number)) { context->attribs->flags |= RC_DefaultVisual; } else { XSetWindowAttributes attr; unsigned long mask; context->visual = vinfo[0].visual; context->depth = vinfo[0].depth; context->vclass = vinfo[0].class; getColormap(context, screen_number); attr.colormap = context->cmap; attr.override_redirect = True; attr.border_pixel = 0; attr.background_pixel = 0; mask = CWBorderPixel|CWColormap|CWOverrideRedirect|CWBackPixel; context->drawable = XCreateWindow(dpy, RootWindow(dpy, screen_number), 1, 1, 1, 1, 0, context->depth, CopyFromParent, context->visual, mask, &attr); /* XSetWindowColormap(dpy, context->drawable, attr.colormap);*/ } XFree(vinfo); } /* use default */ if (!context->visual) { if ((context->attribs->flags & RC_DefaultVisual) || !bestContext(dpy, screen_number, context)) { context->visual = DefaultVisual(dpy, screen_number); context->depth = DefaultDepth(dpy, screen_number); context->cmap = DefaultColormap(dpy, screen_number); context->drawable = RootWindow(dpy, screen_number); context->black = BlackPixel(dpy, screen_number); context->white = WhitePixel(dpy, screen_number); context->vclass = context->visual->class; } } gcv.function = GXcopy; gcv.graphics_exposures = False; context->copy_gc = XCreateGC(dpy, context->drawable, GCFunction |GCGraphicsExposures, &gcv); #ifdef HAVE_HERMES context->hermes_data = malloc(sizeof(RHermesData)); if (!context->hermes_data) { RErrorCode = RERR_NOMEMORY; free(context); return NULL; } Hermes_Init(); context->hermes_data->palette = Hermes_PaletteInstance(); { unsigned long flags = 0; if (context->attribs->render_mode == RDitheredRendering) { flags |= HERMES_CONVERT_DITHER; } context->hermes_data->converter = Hermes_ConverterInstance(flags); } #endif if (context->vclass == PseudoColor || context->vclass == StaticColor) { if (!setupPseudoColorColormap(context)) { free(context); return NULL; } #ifdef HAVE_HERMES { int32 palette[256]; int i; for (i = 0; i < context->ncolors; i++) { palette[i] = ((context->colors[i].red >> 8) << 16) || ((context->colors[i].green >> 8) << 8) || ((context->colors[i].blue >> 8)); } Hermes_PaletteSet(context->hermes_data->palette, palette); } #endif } else if (context->vclass == GrayScale || context->vclass == StaticGray) { context->colors = allocateGrayScale(context); if (!context->colors) { free(context); return NULL; } #ifdef HAVE_HERMES { int32 palette[256]; int i; for (i = 0; i < context->ncolors; i++) { palette[i] = ((context->colors[i].red >> 8) << 16) || ((context->colors[i].green >> 8) << 8) || ((context->colors[i].blue >> 8)); } Hermes_PaletteSet(context->hermes_data->palette, palette); } #endif } else if (context->vclass == TrueColor) { /* calc offsets to create a TrueColor pixel */ context->red_offset = count_offset(context->visual->red_mask); context->green_offset = count_offset(context->visual->green_mask); context->blue_offset = count_offset(context->visual->blue_mask); /* disable dithering on 24 bits visuals */ if (context->depth >= 24) context->attribs->render_mode = RBestMatchRendering; } #ifdef HAVE_HERMES #endif /* check avaiability of MIT-SHM */ #ifdef XSHM if (!(context->attribs->flags & RC_UseSharedMemory)) { context->attribs->flags |= RC_UseSharedMemory; context->attribs->use_shared_memory = True; } if (context->attribs->use_shared_memory) { int major, minor; Bool sharedPixmaps; context->flags.use_shared_pixmap = 0; if (!XShmQueryVersion(context->dpy, &major, &minor, &sharedPixmaps)) { context->attribs->use_shared_memory = False; } else { if (XShmPixmapFormat(context->dpy)==ZPixmap) context->flags.use_shared_pixmap = sharedPixmaps; } } #endif return context; } static Bool bestContext(Display *dpy, int screen_number, RContext *context) { XVisualInfo *vinfo=NULL, rvinfo; int best = -1, numvis, i; long flags; XSetWindowAttributes attr; rvinfo.class = TrueColor; rvinfo.screen = screen_number; #ifdef XRENDER rvinfo.depth = 32; flags = VisualClassMask | VisualScreenMask | VisualDepthMask; vinfo = XGetVisualInfo(dpy, flags, &rvinfo, &numvis); if (vinfo) { for (i=numvis-1, best = -1; i>=0; i--) { XRenderPictFormat* pictFormat = XRenderFindVisualFormat (dpy, vinfo[i].visual); if (NULL != pictFormat && (pictFormat->type == PictTypeDirect) && (pictFormat->direct.alphaMask)) { best = i; } } } #endif if (best == -1) { flags = VisualClassMask | VisualScreenMask; vinfo = XGetVisualInfo(dpy, flags, &rvinfo, &numvis); if (vinfo) { /* look for a TrueColor, 24-bit or more (pref 24) */ for (i=numvis-1, best = -1; i>=0; i--) { if (vinfo[i].depth == 24) best = i; else if (vinfo[i].depth>24 && best<0) best = i; } } } #if 0 if (best == -1) { /* look for a DirectColor, 24-bit or more (pref 24) */ rvinfo.class = DirectColor; if (vinfo) XFree((char *) vinfo); vinfo = XGetVisualInfo(dpy, flags, &rvinfo, &numvis); if (vinfo) { for (i=0, best = -1; i24 && best<0) best = i; } } } #endif if (best > -1) { context->visual = vinfo[best].visual; context->depth = vinfo[best].depth; context->vclass = vinfo[best].class; getColormap(context, screen_number); attr.colormap = context->cmap; attr.override_redirect = True; attr.border_pixel = 0; context->drawable = XCreateWindow(dpy, RootWindow(dpy, screen_number), 1, 1, 1, 1, 0, context->depth, CopyFromParent, context->visual, CWBorderPixel|CWColormap|CWOverrideRedirect, &attr); /* XSetWindowColormap(dpy, context->drawable, context->cmap);*/ } if (vinfo) XFree((char *) vinfo); if (best < 0) return False; else return True; } gnustep-back-0.29.0/Source/x11/convert.c000066400000000000000000000705761404163720200177000ustar00rootroot00000000000000/* convert.c - convert RImage to Pixmap * * Raster graphics library * * Copyright (c) 1997-2002 Alfredo K. Kojima * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Problems: * 1. Using Grayscale visual with Dithering crashes wmaker * 2. Ghost dock/appicon is wrong in Pseudocolor, Staticgray, Grayscale */ #include #include #include #include #include #include #include #ifdef BENCH #include "bench.h" #endif #include "wrasterP.h" #ifdef XSHM extern Pixmap R_CreateXImageMappedPixmap(RContext *context, RXImage *ximage); #endif #define HAS_ALPHA(I) ((I)->format == RRGBAFormat) typedef struct RConversionTable { unsigned short table[256]; unsigned short index; struct RConversionTable *next; } RConversionTable; typedef struct RStdConversionTable { unsigned int table[256]; unsigned short mult; unsigned short max; struct RStdConversionTable *next; } RStdConversionTable; static RConversionTable *conversionTable = NULL; static RStdConversionTable *stdConversionTable = NULL; static unsigned short* computeTable(unsigned short mask) { RConversionTable *tmp = conversionTable; int i; while (tmp) { if (tmp->index == mask) break; tmp = tmp->next; } if (tmp) return tmp->table; tmp = (RConversionTable *)malloc(sizeof(RConversionTable)); if (tmp == NULL) return NULL; for (i=0;i<256;i++) tmp->table[i] = (i*mask + 0x7f)/0xff; tmp->index = mask; tmp->next = conversionTable; conversionTable = tmp; return tmp->table; } static unsigned int* computeStdTable(unsigned int mult, unsigned int max) { RStdConversionTable *tmp = stdConversionTable; unsigned int i; while (tmp) { if (tmp->mult == mult && tmp->max == max) break; tmp = tmp->next; } if (tmp) return tmp->table; tmp = (RStdConversionTable *)malloc(sizeof(RStdConversionTable)); if (tmp == NULL) return NULL; for (i=0; i<256; i++) { tmp->table[i] = (i*max)/0xff * mult; } tmp->mult = mult; tmp->max = max; tmp->next = stdConversionTable; stdConversionTable = tmp; return tmp->table; } /***************************************************************************/ static void convertTrueColor_generic(RXImage *ximg, RImage *image, signed char *err, signed char *nerr, const unsigned short *rtable, const unsigned short *gtable, const unsigned short *btable, const int dr, const int dg, const int db, const unsigned short roffs, const unsigned short goffs, const unsigned short boffs) { signed char *terr; int x, y, r, g, b; int pixel; int rer, ger, ber; unsigned char *ptr = image->data; int channels = (image->format == RRGBAFormat ? 4 : 3); /* convert and dither the image to XImage */ for (y=0; yheight; y++) { nerr[0] = 0; nerr[1] = 0; nerr[2] = 0; for (x=0; xwidth; x++, ptr+=channels) { /* reduce pixel */ pixel = *ptr + err[x]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; r = rtable[pixel]; /* calc error */ rer = pixel - r*dr; /* reduce pixel */ pixel = *(ptr+1) + err[x+1]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; g = gtable[pixel]; /* calc error */ ger = pixel - g*dg; /* reduce pixel */ pixel = *(ptr+2) + err[x+2]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; b = btable[pixel]; /* calc error */ ber = pixel - b*db; pixel = (r<image, x, y, pixel); /* distribute error */ r = (rer*3)/8; g = (ger*3)/8; b = (ber*3)/8; /* x+1, y */ err[x+3*1]+=r; err[x+1+3*1]+=g; err[x+2+3*1]+=b; /* x, y+1 */ nerr[x]+=r; nerr[x+1]+=g; nerr[x+2]+=b; /* x+1, y+1 */ nerr[x+3*1]=rer-2*r; nerr[x+1+3*1]=ger-2*g; nerr[x+2+3*1]=ber-2*b; } /* skip to next line */ terr = err; err = nerr; nerr = terr; } /* redither the 1st line to distribute error better */ ptr=image->data; y=0; nerr[0] = 0; nerr[1] = 0; nerr[2] = 0; for (x=0; xwidth; x++, ptr+=channels) { /* reduce pixel */ pixel = *ptr + err[x]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; r = rtable[pixel]; /* calc error */ rer = pixel - r*dr; /* reduce pixel */ pixel = *(ptr+1) + err[x+1]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; g = gtable[pixel]; /* calc error */ ger = pixel - g*dg; /* reduce pixel */ pixel = *(ptr+2) + err[x+2]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; b = btable[pixel]; /* calc error */ ber = pixel - b*db; pixel = (r<image, x, y, pixel); /* distribute error */ r = (rer*3)/8; g = (ger*3)/8; b = (ber*3)/8; /* x+1, y */ err[x+3*1]+=r; err[x+1+3*1]+=g; err[x+2+3*1]+=b; /* x, y+1 */ nerr[x]+=r; nerr[x+1]+=g; nerr[x+2]+=b; /* x+1, y+1 */ nerr[x+3*1]=rer-2*r; nerr[x+1+3*1]=ger-2*g; nerr[x+2+3*1]=ber-2*b; } } static RXImage* image2TrueColor(RContext *ctx, RImage *image) { RXImage *ximg; unsigned short rmask, gmask, bmask; unsigned short roffs, goffs, boffs; unsigned short *rtable, *gtable, *btable; int channels = (image->format == RRGBAFormat ? 4 : 3); ximg = RCreateXImage(ctx, ctx->depth, image->width, image->height); if (!ximg) { return NULL; } roffs = ctx->red_offset; goffs = ctx->green_offset; boffs = ctx->blue_offset; rmask = ctx->visual->red_mask >> roffs; gmask = ctx->visual->green_mask >> goffs; bmask = ctx->visual->blue_mask >> boffs; rtable = computeTable(rmask); gtable = computeTable(gmask); btable = computeTable(bmask); if (rtable==NULL || gtable==NULL || btable==NULL) { RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } #ifdef BENCH cycle_bench(1); #endif if (ctx->attribs->render_mode==RBestMatchRendering) { int ofs, r, g, b; int x, y; unsigned long pixel; unsigned char *ptr = image->data; /* fake match */ #ifdef WR_DEBUG puts("true color match"); #endif if (rmask==0xff && gmask==0xff && bmask==0xff) { for (y=0; y < image->height; y++) { for (x=0; x < image->width; x++, ptr+=channels) { /* reduce pixel */ pixel = (*(ptr)<image, x, y, pixel); } } } else { for (y=0, ofs=0; y < image->height; y++) { for (x=0; x < image->width; x++, ofs+=channels-3) { /* reduce pixel */ r = rtable[ptr[ofs++]]; g = gtable[ptr[ofs++]]; b = btable[ptr[ofs++]]; pixel = (r<image, x, y, pixel); } } } } else { /* dither */ const int dr=0xff/rmask; const int dg=0xff/gmask; const int db=0xff/bmask; #ifdef WR_DEBUG puts("true color dither"); #endif { signed char *err; signed char *nerr; int ch = (image->format == RRGBAFormat ? 4 : 3); err = malloc(ch*(image->width+2)); nerr = malloc(ch*(image->width+2)); if (!err || !nerr) { if (nerr) free(nerr); if (err) free(err); RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } memset(err, 0, ch*(image->width+2)); memset(nerr, 0, ch*(image->width+2)); convertTrueColor_generic(ximg, image, err, nerr, rtable, gtable, btable, dr, dg, db, roffs, goffs, boffs); free(err); free(nerr); } } #ifdef BENCH cycle_bench(0); #endif return ximg; } /***************************************************************************/ static void convertPseudoColor_to_8(RXImage *ximg, RImage *image, signed char *err, signed char *nerr, const unsigned short *rtable, const unsigned short *gtable, const unsigned short *btable, const int dr, const int dg, const int db, unsigned long *pixels, int cpc) { signed char *terr; int x, y, r, g, b; int pixel; int rer, ger, ber; unsigned char *ptr = image->data; unsigned char *optr = (unsigned char *)ximg->image->data; int channels = (image->format == RRGBAFormat ? 4 : 3); int cpcpc = cpc*cpc; /* convert and dither the image to XImage */ for (y=0; yheight; y++) { nerr[0] = 0; nerr[1] = 0; nerr[2] = 0; for (x=0; xwidth*3; x+=3, ptr+=channels) { /* reduce pixel */ pixel = *ptr + err[x]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; r = rtable[pixel]; /* calc error */ rer = pixel - r*dr; /* reduce pixel */ pixel = *(ptr+1) + err[x+1]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; g = gtable[pixel]; /* calc error */ ger = pixel - g*dg; /* reduce pixel */ pixel = *(ptr+2) + err[x+2]; if (pixel<0) pixel=0; else if (pixel>0xff) pixel=0xff; b = btable[pixel]; /* calc error */ ber = pixel - b*db; *optr++ = pixels[r*cpcpc + g*cpc + b]; /* distribute error */ r = (rer*3)/8; g = (ger*3)/8; b = (ber*3)/8; /* x+1, y */ err[x+3*1]+=r; err[x+1+3*1]+=g; err[x+2+3*1]+=b; /* x, y+1 */ nerr[x]+=r; nerr[x+1]+=g; nerr[x+2]+=b; /* x+1, y+1 */ nerr[x+3*1]=rer-2*r; nerr[x+1+3*1]=ger-2*g; nerr[x+2+3*1]=ber-2*b; } /* skip to next line */ terr = err; err = nerr; nerr = terr; optr += ximg->image->bytes_per_line - image->width; } } static RXImage* image2PseudoColor(RContext *ctx, RImage *image) { RXImage *ximg; register int x, y, r, g, b; unsigned char *ptr; unsigned long pixel; const int cpc=ctx->attribs->colors_per_channel; const unsigned short rmask = cpc-1; /* different sizes could be used */ const unsigned short gmask = rmask; /* for r,g,b */ const unsigned short bmask = rmask; unsigned short *rtable, *gtable, *btable; const int cpccpc = cpc*cpc; int channels = (image->format == RRGBAFormat ? 4 : 3); ximg = RCreateXImage(ctx, ctx->depth, image->width, image->height); if (!ximg) { return NULL; } ptr = image->data; /* Tables are same at the moment because rmask==gmask==bmask. */ rtable = computeTable(rmask); gtable = computeTable(gmask); btable = computeTable(bmask); if (rtable==NULL || gtable==NULL || btable==NULL) { RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } if (ctx->attribs->render_mode == RBestMatchRendering) { /* fake match */ #ifdef WR_DEBUG printf("pseudo color match with %d colors per channel\n", cpc); #endif for (y=0; yheight; y++) { for (x=0; xwidth; x++, ptr+=channels-3) { /* reduce pixel */ r = rtable[*ptr++]; g = gtable[*ptr++]; b = btable[*ptr++]; pixel = r*cpccpc + g*cpc + b; /*data[ofs] = ctx->colors[pixel].pixel;*/ XPutPixel(ximg->image, x, y, ctx->colors[pixel].pixel); } } } else { /* dither */ signed char *err; signed char *nerr; const int dr=0xff/rmask; const int dg=0xff/gmask; const int db=0xff/bmask; #ifdef WR_DEBUG printf("pseudo color dithering with %d colors per channel\n", cpc); #endif err = malloc(4*(image->width+3)); nerr = malloc(4*(image->width+3)); if (!err || !nerr) { if (nerr) free(nerr); if (err) free(err); RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } memset(err, 0, 4*(image->width+3)); memset(nerr, 0, 4*(image->width+3)); convertPseudoColor_to_8(ximg, image, err+4, nerr+4, rtable, gtable, btable, dr, dg, db, ctx->pixels, cpc); free(err); free(nerr); } return ximg; } /* * For standard colormap */ static RXImage* image2StandardPseudoColor(RContext *ctx, RImage *image) { RXImage *ximg; register int x, y, r, g, b; unsigned char *ptr; unsigned long pixel; unsigned char *data; unsigned int *rtable, *gtable, *btable; unsigned int base_pixel = ctx->std_rgb_map->base_pixel; int channels = (image->format == RRGBAFormat ? 4 : 3); ximg = RCreateXImage(ctx, ctx->depth, image->width, image->height); if (!ximg) { return NULL; } ptr = image->data; data = (unsigned char *)ximg->image->data; rtable = computeStdTable(ctx->std_rgb_map->red_mult, ctx->std_rgb_map->red_max); gtable = computeStdTable(ctx->std_rgb_map->green_mult, ctx->std_rgb_map->green_max); btable = computeStdTable(ctx->std_rgb_map->blue_mult, ctx->std_rgb_map->blue_max); if (rtable==NULL || gtable==NULL || btable==NULL) { RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } if (ctx->attribs->render_mode == RBestMatchRendering) { for (y=0; yheight; y++) { for (x=0; xwidth; x++, ptr+=channels) { /* reduce pixel */ pixel = (rtable[*ptr] + gtable[*(ptr+1)] + btable[*(ptr+2)] + base_pixel) & 0xffffffff; XPutPixel(ximg->image, x, y, pixel); } } } else { /* dither */ signed short *err, *nerr; signed short *terr; int rer, ger, ber; int x1, ofs; #ifdef WR_DEBUG printf("pseudo color dithering with %d colors per channel\n", channels); #endif err = (short*)malloc(3*(image->width+2)*sizeof(short)); nerr = (short*)malloc(3*(image->width+2)*sizeof(short)); if (!err || !nerr) { if (err) free(err); if (nerr) free(nerr); RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } for (x=0, x1=0; xwidth*3; x1+=channels-3) { err[x++] = ptr[x1++]; err[x++] = ptr[x1++]; err[x++] = ptr[x1++]; } err[x] = err[x+1] = err[x+2] = 0; /* convert and dither the image to XImage */ for (y=0, ofs=0; yheight; y++) { if (yheight-1) { int x1; for (x=0, x1=(y+1)*image->width*channels; xwidth*3; x1+=channels-3) { nerr[x++] = ptr[x1++]; nerr[x++] = ptr[x1++]; nerr[x++] = ptr[x1++]; } /* last column */ x1-=channels; nerr[x++] = ptr[x1++]; nerr[x++] = ptr[x1++]; nerr[x] = ptr[x1]; } for (x=0; xwidth*3; x+=3, ofs++) { /* reduce pixel */ if (err[x]>0xff) err[x]=0xff; else if (err[x]<0) err[x]=0; if (err[x+1]>0xff) err[x+1]=0xff; else if (err[x+1]<0) err[x+1]=0; if (err[x+2]>0xff) err[x+2]=0xff; else if (err[x+2]<0) err[x+2]=0; r = rtable[err[x]]; g = gtable[err[x+1]]; b = btable[err[x+2]]; pixel = r + g + b; data[ofs] = base_pixel + pixel; /* calc error */ rer = err[x] - (ctx->colors[pixel].red>>8); ger = err[x+1] - (ctx->colors[pixel].green>>8); ber = err[x+2] - (ctx->colors[pixel].blue>>8); /* distribute error */ err[x+3*1]+=(rer*7)/16; err[x+1+3*1]+=(ger*7)/16; err[x+2+3*1]+=(ber*7)/16; nerr[x]+=(rer*5)/16; nerr[x+1]+=(ger*5)/16; nerr[x+2]+=(ber*5)/16; if (x>0) { nerr[x-3*1]+=(rer*3)/16; nerr[x-3*1+1]+=(ger*3)/16; nerr[x-3*1+2]+=(ber*3)/16; } nerr[x+3*1]+=rer/16; nerr[x+1+3*1]+=ger/16; nerr[x+2+3*1]+=ber/16; } /* skip to next line */ terr = err; err = nerr; nerr = terr; ofs += ximg->image->bytes_per_line - image->width; } free(err); free(nerr); } ximg->image->data = (char*)data; return ximg; } static RXImage* image2GrayScale(RContext *ctx, RImage *image) { RXImage *ximg; register int x, y, g; unsigned char *ptr; const int cpc=ctx->attribs->colors_per_channel; unsigned short gmask; unsigned short *table; unsigned char *data; int channels = (image->format == RRGBAFormat ? 4 : 3); ximg = RCreateXImage(ctx, ctx->depth, image->width, image->height); if (!ximg) { return NULL; } ptr = image->data; data = (unsigned char *)ximg->image->data; if (ctx->vclass == StaticGray) gmask = (1<depth) - 1; /* use all grays */ else gmask = cpc*cpc*cpc-1; table = computeTable(gmask); if (table==NULL) { RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } if (ctx->attribs->render_mode == RBestMatchRendering) { /* fake match */ #ifdef WR_DEBUG printf("grayscale match with %d colors per channel\n", cpc); #endif for (y=0; yheight; y++) { for (x=0; xwidth; x++) { /* reduce pixel */ g = table[(*ptr * 30 + *(ptr+1) * 59 + *(ptr+2) * 11)/100]; ptr += channels; /*data[ofs] = ctx->colors[g].pixel;*/ XPutPixel(ximg->image, x, y, ctx->colors[g].pixel); } } } else { /* dither */ short *gerr; short *ngerr; short *terr; int ger; const int dg=0xff/gmask; #ifdef WR_DEBUG printf("grayscale dither with %d colors per channel\n", cpc); #endif gerr = (short*)malloc((image->width+2)*sizeof(short)); ngerr = (short*)malloc((image->width+2)*sizeof(short)); if (!gerr || !ngerr) { if (ngerr) free(ngerr); if (gerr) free(gerr); RErrorCode = RERR_NOMEMORY; RDestroyXImage(ctx, ximg); return NULL; } for (x=0, y=0; xwidth; x++, y+=channels) { gerr[x] = (ptr[y]*30 + ptr[y+1]*59 + ptr[y+2]*11)/100; } gerr[x] = 0; /* convert and dither the image to XImage */ for (y=0; yheight; y++) { if (yheight-1) { int x1; for (x=0, x1=(y+1)*image->width*channels; xwidth; x++, x1+=channels) { ngerr[x] = (ptr[x1]*30 + ptr[x1+1]*59 + ptr[x1+2]*11)/100; } /* last column */ x1-=channels; ngerr[x] = (ptr[x1]*30 + ptr[x1+1]*59 + ptr[x1+2]*11)/100; } for (x=0; xwidth; x++) { /* reduce pixel */ if (gerr[x]>0xff) gerr[x]=0xff; else if (gerr[x]<0) gerr[x]=0; g = table[gerr[x]]; /*data[ofs] = ctx->colors[g].pixel;*/ XPutPixel(ximg->image, x, y, ctx->colors[g].pixel); /* calc error */ ger = gerr[x] - g*dg; /* distribute error */ g = (ger*3)/8; /* x+1, y */ gerr[x+1]+=g; /* x, y+1 */ ngerr[x]+=g; /* x+1, y+1 */ ngerr[x+1]+=ger-2*g; } /* skip to next line */ terr = gerr; gerr = ngerr; ngerr = terr; } free(gerr); free(ngerr); } ximg->image->data = (char*)data; return ximg; } static RXImage* image2Bitmap(RContext *ctx, RImage *image, int threshold) { RXImage *ximg; unsigned char *alpha; int x, y; ximg = RCreateXImage(ctx, 1, image->width, image->height); if (!ximg) { return NULL; } alpha = image->data+3; for (y = 0; y < image->height; y++) { for (x = 0; x < image->width; x++) { XPutPixel(ximg->image, x, y, (*alpha <= threshold ? 0 : 1)); alpha+=4; } } return ximg; } #ifdef HAVE_HERMES static RXImage* hermesConvert(RContext *context, RImage *image) { HermesFormat source; HermesFormat dest; RXImage *ximage; ximage = RCreateXImage(context, context->depth, image->width, image->height); if (!ximage) { return NULL; } /* The masks look weird for images with alpha. but they work this way. * wth does hermes do internally? */ source.bits = (HAS_ALPHA(image) ? 32 : 24); if (ximage->image->byte_order==LSBFirst) { source.r = 0xff0000; source.g = 0x00ff00; source.b = 0x0000ff; } else { if (source.bits == 32) { source.r = 0xff000000; source.g = 0x00ff0000; source.b = 0x0000ff00; } else { source.r = 0xff0000; source.g = 0x00ff00; source.b = 0x0000ff; } } source.a = 0; /* Don't care about alpha */ source.indexed = 0; source.has_colorkey = 0; /* This is a hack and certainly looks weird, but it works :P * it assumes though that green is inbetween red and blue (the mask) */ if (ximage->image->byte_order==LSBFirst) { dest.r = context->visual->blue_mask; dest.g = context->visual->green_mask; dest.b = context->visual->red_mask; } else { dest.r = context->visual->red_mask; dest.g = context->visual->green_mask; dest.b = context->visual->blue_mask; } dest.a = 0; dest.bits = ximage->image->bits_per_pixel; if (context->vclass == TrueColor) dest.indexed = 0; else dest.indexed = 1; dest.has_colorkey = 0; /*printf("source r=0x%x, g=0x%x, b=0x%x, a=0x%x, b=%d, i=%d, c=%d\n", source.r, source.g, source.b, source.a, source.bits, source.indexed, source.has_colorkey); printf("dest r=0x%x, g=0x%x, b=0x%x, a=0x%x, b=%d, i=%d, c=%d\n", dest.r, dest.g, dest.b, dest.a, dest.bits, dest.indexed, dest.has_colorkey); */ Hermes_ConverterRequest(context->hermes_data->converter, &source, &dest); Hermes_ConverterPalette(context->hermes_data->converter, context->hermes_data->palette, 0); Hermes_ConverterCopy(context->hermes_data->converter, image->data, 0, 0, image->width, image->height, image->width * (image->format == RRGBFormat ? 3 : 4), ximage->image->data, 0, 0, image->width, image->height, ximage->image->bytes_per_line); return ximage; } #endif /* HAVE_HERMES */ int RConvertImage(RContext *context, RImage *image, Pixmap *pixmap) { RXImage *ximg=NULL; #ifdef XSHM Pixmap tmp; #endif assert(context!=NULL); assert(image!=NULL); assert(pixmap!=NULL); switch (context->vclass) { case TrueColor: #ifdef HAVE_HERMES if (context->attribs->render_mode == RBestMatchRendering) { ximg = hermesConvert(context, image); } else { ximg = image2TrueColor(context, image); } #else /* !HAVE_HERMES */ ximg = image2TrueColor(context, image); #endif break; case PseudoColor: case StaticColor: /* For StaticColor we can also use hermes, but it doesn't dither */ #ifdef BENCH cycle_bench(1); #endif if (context->attribs->standard_colormap_mode != RIgnoreStdColormap) ximg = image2StandardPseudoColor(context, image); else ximg = image2PseudoColor(context, image); #ifdef BENCH cycle_bench(0); #endif break; case GrayScale: case StaticGray: ximg = image2GrayScale(context, image); break; } if (!ximg) { return False; } *pixmap = XCreatePixmap(context->dpy, context->drawable, image->width, image->height, context->depth); #ifdef XSHM if (context->flags.use_shared_pixmap && ximg->is_shared) tmp = R_CreateXImageMappedPixmap(context, ximg); else tmp = None; if (tmp) { /* * We have to copy the shm Pixmap into a normal Pixmap because * otherwise, we would have to control when Pixmaps are freed so * that we can detach their shm segments. This is a problem if the * program crash, leaving stale shared memory segments in the * system (lots of them). But with some work, we can optimize * things and remove this XCopyArea. This will require * explicitly freeing all pixmaps when exiting or restarting * wmaker. */ XCopyArea(context->dpy, tmp, *pixmap, context->copy_gc, 0, 0, image->width, image->height, 0, 0); XFreePixmap(context->dpy, tmp); } else { RPutXImage(context, *pixmap, context->copy_gc, ximg, 0, 0, 0, 0, image->width, image->height); } #else /* !XSHM */ RPutXImage(context, *pixmap, context->copy_gc, ximg, 0, 0, 0, 0, image->width, image->height); #endif /* !XSHM */ RDestroyXImage(context, ximg); return True; } int RConvertImageMask(RContext *context, RImage *image, Pixmap *pixmap, Pixmap *mask, int threshold) { GC gc; XGCValues gcv; RXImage *ximg=NULL; assert(context!=NULL); assert(image!=NULL); assert(pixmap!=NULL); assert(mask!=NULL); if (!RConvertImage(context, image, pixmap)) return False; if (image->format==RRGBFormat) { *mask = None; return True; } ximg = image2Bitmap(context, image, threshold); if (!ximg) { return False; } *mask = XCreatePixmap(context->dpy, context->drawable, image->width, image->height, 1); gcv.foreground = context->black; gcv.background = context->white; gcv.graphics_exposures = False; gc = XCreateGC(context->dpy, *mask, GCForeground|GCBackground |GCGraphicsExposures, &gcv); RPutXImage(context, *mask, gc, ximg, 0, 0, 0, 0, image->width, image->height); RDestroyXImage(context, ximg); XFreeGC(context->dpy, gc); return True; } Bool RGetClosestXColor(RContext *context, RColor *color, XColor *retColor) { if (context->vclass == TrueColor) { unsigned short rmask, gmask, bmask; unsigned short roffs, goffs, boffs; unsigned short *rtable, *gtable, *btable; roffs = context->red_offset; goffs = context->green_offset; boffs = context->blue_offset; rmask = context->visual->red_mask >> roffs; gmask = context->visual->green_mask >> goffs; bmask = context->visual->blue_mask >> boffs; rtable = computeTable(rmask); gtable = computeTable(gmask); btable = computeTable(bmask); retColor->pixel = (rtable[color->red]<green]<blue]<red = color->red << 8; retColor->green = color->green << 8; retColor->blue = color->blue << 8; retColor->flags = DoRed|DoGreen|DoBlue; } else if (context->vclass == PseudoColor || context->vclass == StaticColor) { if (context->attribs->standard_colormap_mode != RIgnoreStdColormap) { unsigned int *rtable, *gtable, *btable; rtable = computeStdTable(context->std_rgb_map->red_mult, context->std_rgb_map->red_max); gtable = computeStdTable(context->std_rgb_map->green_mult, context->std_rgb_map->green_max); btable = computeStdTable(context->std_rgb_map->blue_mult, context->std_rgb_map->blue_max); if (rtable==NULL || gtable==NULL || btable==NULL) { RErrorCode = RERR_NOMEMORY; return False; } retColor->pixel = (rtable[color->red] + gtable[color->green] + btable[color->blue] + context->std_rgb_map->base_pixel) & 0xffffffff; retColor->red = color->red<<8; retColor->green = color->green<<8; retColor->blue = color->blue<<8; retColor->flags = DoRed|DoGreen|DoBlue; } else { const int cpc=context->attribs->colors_per_channel; const unsigned short rmask = cpc-1; /* different sizes could be used */ const unsigned short gmask = rmask; /* for r,g,b */ const unsigned short bmask = rmask; unsigned short *rtable, *gtable, *btable; const int cpccpc = cpc*cpc; int index; rtable = computeTable(rmask); gtable = computeTable(gmask); btable = computeTable(bmask); if (rtable==NULL || gtable==NULL || btable==NULL) { RErrorCode = RERR_NOMEMORY; return False; } index = rtable[color->red]*cpccpc + gtable[color->green]*cpc + btable[color->blue]; *retColor = context->colors[index]; } } else if (context->vclass == GrayScale || context->vclass == StaticGray) { const int cpc = context->attribs->colors_per_channel; unsigned short gmask; unsigned short *table; int index; if (context->vclass == StaticGray) gmask = (1<depth) - 1; /* use all grays */ else gmask = cpc*cpc*cpc-1; table = computeTable(gmask); if (!table) return False; index = table[(color->red*30 + color->green*59 + color->blue*11)/100]; *retColor = context->colors[index]; } else { RErrorCode = RERR_INTERNAL; return False; } return True; } gnustep-back-0.29.0/Source/x11/raster.c000066400000000000000000000306521404163720200175070ustar00rootroot00000000000000/* raster.c - main and other misc stuff * * Raster graphics library * * Copyright (c) 1997-2002 Alfredo K. Kojima * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include "x11/wraster.h" #include char *WRasterLibVersion="0.9"; int RErrorCode=RERR_NONE; #define HAS_ALPHA(I) ((I)->format == RRGBAFormat) #define MAX_WIDTH 20000 #define MAX_HEIGHT 20000 /* 20000^2*4 < 2G */ RImage* RCreateImage(unsigned width, unsigned height, int alpha) { RImage *image=NULL; assert(width>0 && height>0); /* check for bogus image sizes (and avoid overflow as a bonus) */ if (width > MAX_WIDTH || height > MAX_HEIGHT) { RErrorCode = RERR_NOMEMORY; return NULL; } image = malloc(sizeof(RImage)); if (!image) { RErrorCode = RERR_NOMEMORY; return NULL; } memset(image, 0, sizeof(RImage)); image->width = width; image->height = height; image->format = alpha ? RRGBAFormat : RRGBFormat; image->refCount = 1; /* the +4 is to give extra bytes at the end of the buffer, * so that we can optimize image conversion for MMX(tm).. see convert.c */ image->data = malloc(width * height * (alpha ? 4 : 3) + 4); if (!image->data) { RErrorCode = RERR_NOMEMORY; free(image); image = NULL; } return image; } RImage* RRetainImage(RImage *image) { if (image) image->refCount++; return image; } void RReleaseImage(RImage *image) { assert(image!=NULL); image->refCount--; if (image->refCount < 1) { free(image->data); free(image); } } /* Obsoleted function. Use RReleaseImage() instead. This was kept only to * allow a smoother transition and to avoid breaking existing programs, but * it will be removed in a future release. Right now is just an alias to * RReleaseImage(). Do _NOT_ use RDestroyImage() anymore in your programs. * Being an alias to RReleaseImage() this function no longer actually * destroys the image, unless the image is no longer retained in some other * place. */ void RDestroyImage(RImage *image) { RReleaseImage(image); } RImage* RCloneImage(RImage *image) { RImage *new_image; assert(image!=NULL); new_image = RCreateImage(image->width, image->height, HAS_ALPHA(image)); if (!new_image) return NULL; new_image->background = image->background; memcpy(new_image->data, image->data, image->width*image->height*(HAS_ALPHA(image) ? 4 : 3)); return new_image; } RImage* RGetSubImage(RImage *image, int x, int y, unsigned width, unsigned height) { int i, ofs; RImage *new_image; unsigned total_line_size, line_size; assert(image!=NULL); assert(x>=0 && y>=0); assert(xwidth && yheight); assert(width>0 && height>0); if (x+width > image->width) width = image->width-x; if (y+height > image->height) height = image->height-y; new_image = RCreateImage(width, height, HAS_ALPHA(image)); if (!new_image) return NULL; new_image->background = image->background; total_line_size = image->width * (HAS_ALPHA(image) ? 4 : 3); line_size = width * (HAS_ALPHA(image) ? 4 : 3); ofs = x*(HAS_ALPHA(image) ? 4 : 3) + y*total_line_size;; for (i=0; idata[i*line_size], &image->data[i*total_line_size+ofs], line_size); } return new_image; } /* *---------------------------------------------------------------------- * RCombineImages- * Combines two equal sized images with alpha image. The second * image will be placed on top of the first one. *---------------------------------------------------------------------- */ void RCombineImages(RImage *image, RImage *src) { assert(image->width == src->width); assert(image->height == src->height); if (!HAS_ALPHA(src)) { if (!HAS_ALPHA(image)) { memcpy(image->data, src->data, image->height*image->width*3); } else { int x, y; unsigned char *d, *s; d = image->data; s = src->data; for (y = 0; y < image->height; y++) { for (x = 0; x < image->width; x++) { *d++ = *s++; *d++ = *s++; *d++ = *s++; d++; } } } } else { register int i; unsigned char *d; unsigned char *s; int alpha, calpha; d = image->data; s = src->data; if (!HAS_ALPHA(image)) { for (i=0; iheight*image->width; i++) { alpha = *(s+3); calpha = 255 - alpha; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; d++; s++; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; d++; s++; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; d++; s++; s++; } } else { for (i=0; iheight*image->width; i++) { alpha = *(s+3); calpha = 255 - alpha; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; d++; s++; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; d++; s++; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; d++; s++; *d++ |= *s++; } } } } void RCombineImagesWithOpaqueness(RImage *image, RImage *src, int opaqueness) { register int i; unsigned char *d; unsigned char *s; int c_opaqueness; assert(image->width == src->width); assert(image->height == src->height); d = image->data; s = src->data; c_opaqueness = 255 - opaqueness; #define OP opaqueness #define COP c_opaqueness if (!HAS_ALPHA(src)) { int dalpha = HAS_ALPHA(image); for (i=0; i < image->width*image->height; i++) { *d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256; d++; s++; *d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256; d++; s++; *d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256; d++; s++; if (dalpha) { d++; } } } else { int tmp; if (!HAS_ALPHA(image)) { for (i=0; iwidth*image->height; i++) { tmp = (*(s+3) * opaqueness)/256; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; s++; } } else { for (i=0; iwidth*image->height; i++) { tmp = (*(s+3) * opaqueness)/256; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; *d |= tmp; d++; s++; } } } #undef OP #undef COP } int calculateCombineArea(RImage *des, RImage *src, int *sx, int *sy, unsigned *swidth, unsigned *sheight, int *dx, int *dy) { if (*dx < 0) { *sx = -*dx; *swidth = *swidth + *dx; *dx = 0; } if (*dx + *swidth > des->width) { *swidth = des->width - *dx; } if (*dy < 0) { *sy = -*dy; *sheight = *sheight + *dy; *dy = 0; } if (*dy + *sheight > des->height) { *sheight = des->height - *dy; } if (*sheight > 0 && *swidth > 0) { return True; } else return False; } void RCombineArea(RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy) { int x, y, dwi, swi; unsigned char *d; unsigned char *s; int alpha, calpha; if(!calculateCombineArea(image, src, &sx, &sy, &width, &height, &dx, &dy)) return; if (!HAS_ALPHA(src)) { if (!HAS_ALPHA(image)) { swi = src->width * 3; dwi = image->width * 3; s = src->data + (sy*(int)src->width + sx) * 3; d = image->data + (dy*(int)image->width + dx) * 3; for (y=0; y < height; y++) { memcpy(d, s, width*3); d += dwi; s += swi; } } else { swi = (src->width - width) * 3; dwi = (image->width - width) * 4; s = src->data + (sy*(int)src->width + sx) * 3; d = image->data + (dy*(int)image->width + dx) * 4; for (y=0; y < height; y++) { for (x=0; x < width; x++) { *d++ = *s++; *d++ = *s++; *d++ = *s++; d++; } d += dwi; s += swi; } } } else { int dalpha = HAS_ALPHA(image); swi = (src->width - width) * 4; s = src->data + (sy*(int)src->width + sx) * 4; if (dalpha) { dwi = (image->width - width) * 4; d = image->data + (dy*(int)image->width + dx) * 4; } else { dwi = (image->width - width) * 3; d = image->data + (dy*(int)image->width + dx) * 3; } for (y=0; y < height; y++) { for (x=0; x < width; x++) { alpha = *(s+3); calpha = 255 - alpha; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; s++; d++; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; s++; d++; *d = (((int)*d * calpha) + ((int)*s * alpha))/256; s++; d++; s++; if (dalpha) d++; } d += dwi; s += swi; } } } void RCombineAreaWithOpaqueness(RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy, int opaqueness) { int x, y, dwi, swi; int c_opaqueness; unsigned char *s, *d; int dalpha = HAS_ALPHA(image); int dch = (dalpha ? 4 : 3); if(!calculateCombineArea(image, src, &sx, &sy, &width, &height, &dx, &dy)) return; d = image->data + (dy*image->width + dx) * dch; dwi = (image->width - width)*dch; c_opaqueness = 255 - opaqueness; #define OP opaqueness #define COP c_opaqueness if (!HAS_ALPHA(src)) { s = src->data + (sy*src->width + sx)*3; swi = (src->width - width) * 3; for (y=0; y < height; y++) { for (x=0; x < width; x++) { *d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256; s++; d++; *d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256; s++; d++; *d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256; s++; d++; if (dalpha) d++; } d += dwi; s += swi; } } else { int tmp; s = src->data + (sy*src->width + sx)*4; swi = (src->width - width) * 4; for (y=0; y < height; y++) { for (x=0; x < width; x++) { tmp = (*(s+3) * opaqueness)/256; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; *d = (((int)*d * (255-tmp)) + ((int)*s * tmp))/256; d++; s++; s++; if (dalpha) d++; } d += dwi; s += swi; } } #undef OP #undef COP } void RCombineImageWithColor(RImage *image, RColor *color) { register int i; unsigned char *d; int alpha, nalpha, r, g, b; d = image->data; if (!HAS_ALPHA(image)) { /* Image has no alpha channel, so we consider it to be all 255. * Thus there are no transparent parts to be filled. */ return; } r = color->red; g = color->green; b = color->blue; for (i=0; i < image->width*image->height; i++) { alpha = *(d+3); nalpha = 255 - alpha; *d = (((int)*d * alpha) + (r * nalpha))/256; d++; *d = (((int)*d * alpha) + (g * nalpha))/256; d++; *d = (((int)*d * alpha) + (b * nalpha))/256; d++; d++; } } RImage* RMakeTiledImage(RImage *tile, unsigned width, unsigned height) { int x, y; unsigned w; unsigned long tile_size = tile->width * tile->height; unsigned long tx = 0; RImage *image; unsigned char *s, *d; if (width == tile->width && height == tile->height) image = RCloneImage(tile); else if (width <= tile->width && height <= tile->height) image = RGetSubImage(tile, 0, 0, width, height); else { int has_alpha = HAS_ALPHA(tile); image = RCreateImage(width, height, has_alpha); d = image->data; s = tile->data; for (y = 0; y < height; y++) { for (x = 0; x < width; x += tile->width) { w = (width - x < tile->width) ? width - x : tile->width; if (has_alpha) { w *= 4; memcpy(d, s+tx*4, w); } else { w *= 3; memcpy(d, s+tx*3, w); } d += w; } tx = (tx + tile->width) % tile_size; } } return image; } gnustep-back-0.29.0/Source/x11/scale.c000066400000000000000000000315541404163720200173000ustar00rootroot00000000000000/* scale.c - image scaling * * Raster graphics library * * Copyright (c) 1997-2002 Alfredo K. Kojima * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #ifndef PI #define PI 3.14159265358979323846 #endif #include #include "x11/wraster.h" /* *---------------------------------------------------------------------- * RScaleImage-- * Creates a scaled copy of an image. * * Returns: * The new scaled image. * *---------------------------------------------------------------------- */ #ifndef broken_code RImage* RScaleImage(RImage *image, unsigned new_width, unsigned new_height) { int ox; int px, py; register int x, y, t; int dx, dy; unsigned char *s; unsigned char *d; RImage *img; assert(new_width >= 0 && new_height >= 0); if (new_width == image->width && new_height == image->height) return RCloneImage(image); img = RCreateImage(new_width, new_height, image->format==RRGBAFormat); if (!img) return NULL; /* fixed point math idea taken from Imlib by * Carsten Haitzler (Rasterman) */ dx = (image->width<<16)/new_width; dy = (image->height<<16)/new_height; py = 0; d = img->data; if (image->format == RRGBAFormat) { for (y=0; ywidth*(py>>16); s = image->data+(t<<2); /* image->data+t*4 */ ox = 0; px = 0; for (x=0; x>16; ox += t<<16; s += t<<2; /* t*4 */ } py += dy; } } else { for (y=0; ywidth*(py>>16); s = image->data+(t<<1)+t; /* image->data+t*3 */ ox = 0; px = 0; for (x=0; x>16; ox += t<<16; s += (t<<1)+t; /* t*3 */ } py += dy; } } return img; } #else RImage* RScaleImage(RImage *src, unsigned new_width, unsigned new_height) { int ddy, ee; int h2; int yd; int xd, xs; RImage *dst; int e, xd2; unsigned char *sr, *sg, *sb, *sa; unsigned char *dr, *dg, *db, *da; int ys = 0; dst = RCreateImage(new_width, new_height, src->data[3]!=NULL); ddy = src->height/2; ee = (ddy/2) - dst->height; h2 = new_height/2; xd = dst->width; xs = src->width/2; e = (src->width/2)-xd; xd2 = xd/2; sr = src->data[0]; sg = src->data[1]; sb = src->data[2]; sa = src->data[3]; dr = dst->data[0]; dg = dst->data[1]; db = dst->data[2]; da = dst->data[3]; if (sa == NULL) { for (yd = 0; yd < new_height; yd++) { int x; sr = src->data[0] + ys * src->width; sg = src->data[1] + ys * src->width; sb = src->data[2] + ys * src->width; for (x = 0; x < xd; x++) { *(dr++) = *sr; *(dg++) = *sg; *(db++) = *sb; while (e >= 0) { sr++; sg++; sb++; e -= xd2; } e += xs; } while (ee >= 0) { ys++; ee -= h2; } ee += ddy; } } else { for (yd = 0; yd < new_height; yd++) { int x; sr = src->data[0] + ys * src->width; sg = src->data[1] + ys * src->width; sb = src->data[2] + ys * src->width; sa = src->data[3] + ys * src->width; for (x = 0; x < xd; x++) { *(dr++) = *sr; *(dg++) = *sg; *(db++) = *sb; *(da++) = *sa; while (e >= 0) { sr++; sg++; sb++; sa++; e -= xd2; } e += xs; } while (ee >= 0) { ys++; ee -= h2; } ee += ddy; } } return dst; } #endif /* * Filtered Image Rescaling code copy/pasted from * Graphics Gems III * Public Domain 1991 by Dale Schumacher */ /* * filter function definitions */ #if 0 #define filter_support (1.0) static double filter(t) double t; { /* f(t) = 2|t|^3 - 3|t|^2 + 1, -1 <= t <= 1 */ if(t < 0.0) t = -t; if(t < 1.0) return((2.0 * t - 3.0) * t * t + 1.0); return(0.0); } #endif #define box_support (0.5) static double box_filter(t) double t; { if((t > -0.5) && (t <= 0.5)) return(1.0); return(0.0); } #define triangle_support (1.0) static double triangle_filter(t) double t; { if(t < 0.0) t = -t; if(t < 1.0) return(1.0 - t); return(0.0); } #define bell_support (1.5) static double bell_filter(t) /* box (*) box (*) box */ double t; { if(t < 0) t = -t; if(t < .5) return(.75 - (t * t)); if(t < 1.5) { t = (t - 1.5); return(.5 * (t * t)); } return(0.0); } #define B_spline_support (2.0) static double B_spline_filter(t) /* box (*) box (*) box (*) box */ double t; { double tt; if(t < 0) t = -t; if(t < 1) { tt = t * t; return((.5 * tt * t) - tt + (2.0 / 3.0)); } else if(t < 2) { t = 2 - t; return((1.0 / 6.0) * (t * t * t)); } return(0.0); } static double sinc(x) double x; { x *= PI; if(x != 0) return(sin(x) / x); return(1.0); } #define Lanczos3_support (3.0) static double Lanczos3_filter(t) double t; { if(t < 0) t = -t; if(t < 3.0) return(sinc(t) * sinc(t/3.0)); return(0.0); } #define Mitchell_support (2.0) #define B (1.0 / 3.0) #define C (1.0 / 3.0) static double Mitchell_filter(t) double t; { double tt; tt = t * t; if(t < 0) t = -t; if(t < 1.0) { t = (((12.0 - 9.0 * B - 6.0 * C) * (t * tt)) + ((-18.0 + 12.0 * B + 6.0 * C) * tt) + (6.0 - 2 * B)); return(t / 6.0); } else if(t < 2.0) { t = (((-1.0 * B - 6.0 * C) * (t * tt)) + ((6.0 * B + 30.0 * C) * tt) + ((-12.0 * B - 48.0 * C) * t) + (8.0 * B + 24 * C)); return(t / 6.0); } return(0.0); } static double (*filterf)() = Mitchell_filter; static double fwidth = Mitchell_support; void _wraster_change_filter(int type) { switch (type) { case RBoxFilter: filterf = box_filter; fwidth = box_support; break; case RTriangleFilter: filterf = triangle_filter; fwidth = triangle_support; break; case RBellFilter: filterf = bell_filter; fwidth = bell_support; break; case RBSplineFilter: filterf = B_spline_filter; fwidth = B_spline_support; break; case RLanczos3Filter: filterf = Lanczos3_filter; fwidth = Lanczos3_support; break; default: case RMitchellFilter: filterf = Mitchell_filter; fwidth = Mitchell_support; break; } } /* * image rescaling routine */ typedef struct { int pixel; double weight; } CONTRIB; typedef struct { int n; /* number of contributors */ CONTRIB *p; /* pointer to list of contributions */ } CLIST; CLIST *contrib; /* array of contribution lists */ /* clamp the input to the specified range */ #define CLAMP(v,l,h) ((v)<(l) ? (l) : (v) > (h) ? (h) : v) /* return of calloc is not checked if NULL in the function below! */ RImage* RSmoothScaleImage(RImage *src, unsigned new_width, unsigned new_height) { RImage *tmp; /* intermediate image */ double xscale, yscale; /* zoom scale factors */ int i, j, k; /* loop variables */ int n; /* pixel number */ double center, left, right; /* filter calculation variables */ double width, fscale; /* filter calculation variables */ double rweight, gweight, bweight; RImage *dst; unsigned char *p; unsigned char *sp; int sch = src->format == RRGBAFormat ? 4 : 3; dst = RCreateImage(new_width, new_height, False); /* create intermediate image to hold horizontal zoom */ tmp = RCreateImage(dst->width, src->height, False); xscale = (double)new_width / (double)src->width; yscale = (double)new_height / (double)src->height; /* pre-calculate filter contributions for a row */ contrib = (CLIST *)calloc(new_width, sizeof(CLIST)); if (xscale < 1.0) { width = fwidth / xscale; fscale = 1.0 / xscale; for (i = 0; i < new_width; ++i) { contrib[i].n = 0; contrib[i].p = (CONTRIB *)calloc((int)(width * 2 + 1), sizeof(CONTRIB)); center = (double) i / xscale; left = ceil(center - width); right = floor(center + width); for(j = left; j <= right; ++j) { rweight = center - (double) j; rweight = (*filterf)(rweight / fscale) / fscale; if(j < 0) { n = -j; } else if(j >= src->width) { n = (src->width - j) + src->width - 1; } else { n = j; } k = contrib[i].n++; contrib[i].p[k].pixel = n*sch; contrib[i].p[k].weight = rweight; } } } else { for(i = 0; i < new_width; ++i) { contrib[i].n = 0; contrib[i].p = (CONTRIB *)calloc((int) (fwidth * 2 + 1), sizeof(CONTRIB)); center = (double) i / xscale; left = ceil(center - fwidth); right = floor(center + fwidth); for(j = left; j <= right; ++j) { rweight = center - (double) j; rweight = (*filterf)(rweight); if(j < 0) { n = -j; } else if(j >= src->width) { n = (src->width - j) + src->width - 1; } else { n = j; } k = contrib[i].n++; contrib[i].p[k].pixel = n*sch; contrib[i].p[k].weight = rweight; } } } /* apply filter to zoom horizontally from src to tmp */ p = tmp->data; for(k = 0; k < tmp->height; ++k) { CONTRIB *pp; sp = src->data + src->width*k*sch; for(i = 0; i < tmp->width; ++i) { rweight = gweight = bweight = 0.0; pp = contrib[i].p; for(j = 0; j < contrib[i].n; ++j) { rweight += sp[pp[j].pixel] * pp[j].weight; gweight += sp[pp[j].pixel+1] * pp[j].weight; bweight += sp[pp[j].pixel+2] * pp[j].weight; } *p++ = CLAMP(rweight, 0, 255); *p++ = CLAMP(gweight, 0, 255); *p++ = CLAMP(bweight, 0, 255); } } /* free the memory allocated for horizontal filter weights */ for(i = 0; i < tmp->width; ++i) { free(contrib[i].p); } free(contrib); /* pre-calculate filter contributions for a column */ contrib = (CLIST *)calloc(dst->height, sizeof(CLIST)); if(yscale < 1.0) { width = fwidth / yscale; fscale = 1.0 / yscale; for(i = 0; i < dst->height; ++i) { contrib[i].n = 0; contrib[i].p = (CONTRIB *)calloc((int) (width * 2 + 1), sizeof(CONTRIB)); center = (double) i / yscale; left = ceil(center - width); right = floor(center + width); for(j = left; j <= right; ++j) { rweight = center - (double) j; rweight = (*filterf)(rweight / fscale) / fscale; if(j < 0) { n = -j; } else if(j >= tmp->height) { n = (tmp->height - j) + tmp->height - 1; } else { n = j; } k = contrib[i].n++; contrib[i].p[k].pixel = n*3; contrib[i].p[k].weight = rweight; } } } else { for(i = 0; i < dst->height; ++i) { contrib[i].n = 0; contrib[i].p = (CONTRIB *)calloc((int) (fwidth * 2 + 1), sizeof(CONTRIB)); center = (double) i / yscale; left = ceil(center - fwidth); right = floor(center + fwidth); for(j = left; j <= right; ++j) { rweight = center - (double) j; rweight = (*filterf)(rweight); if(j < 0) { n = -j; } else if(j >= tmp->height) { n = (tmp->height - j) + tmp->height - 1; } else { n = j; } k = contrib[i].n++; contrib[i].p[k].pixel = n*3; contrib[i].p[k].weight = rweight; } } } /* apply filter to zoom vertically from tmp to dst */ sp = malloc(tmp->height*3); for(k = 0; k < new_width; ++k) { CONTRIB *pp; p = dst->data + k*3; /* copy a column into a row */ { int i; unsigned char *p, *d; d = sp; for(i = tmp->height, p = tmp->data + k*3; i-- > 0; p += tmp->width*3) { *d++ = *p; *d++ = *(p+1); *d++ = *(p+2); } } for(i = 0; i < new_height; ++i) { rweight = gweight = bweight = 0.0; pp = contrib[i].p; for(j = 0; j < contrib[i].n; ++j) { rweight += sp[pp[j].pixel] * pp[j].weight; gweight += sp[pp[j].pixel+1] * pp[j].weight; bweight += sp[pp[j].pixel+2] * pp[j].weight; } *p = CLAMP(rweight, 0, 255); *(p+1) = CLAMP(gweight, 0, 255); *(p+2) = CLAMP(bweight, 0, 255); p += new_width*3; } } free(sp); /* free the memory allocated for vertical filter weights */ for(i = 0; i < dst->height; ++i) { free(contrib[i].p); } free(contrib); RReleaseImage(tmp); return dst; } gnustep-back-0.29.0/Source/x11/wrasterP.h000066400000000000000000000020621404163720200200150ustar00rootroot00000000000000/* * Raster graphics library * * Copyright (c) 1997-2002 Alfredo K. Kojima * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef WRASTERP_H_ #define WRASTERP_H_ #include #include "x11/wraster.h" #ifdef HAVE_HERMES # include typedef struct RHermesData { HermesHandle palette; HermesHandle converter; } RHermesData; #endif #endif gnustep-back-0.29.0/Source/x11/xdnd.c000066400000000000000000000252511404163720200171430ustar00rootroot00000000000000/* xdnd.c, xdnd.h - C program library for handling the Xdnd protocol Copyright (C) 1998 Paul Sheer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. http://www.cco.caltech.edu/~jafl/xdnd/ Further info can also be obtained by emailing the author at, psheer@obsidian.co.za Released 1998-08-07 */ #include #include #include #include #include #include #include "x11/xdnd.h" // #define DND_DEBUG #define dnd_version_at_least(a,b) ((a) <= (b)) #ifdef DND_DEBUG #define dnd_debug(a,b...) printf("%s: %d: " a "\n", __FILE__, __LINE__ , ## b) #else #ifdef NeXT_RUNTIME #define dnd_debug // #else /* !NeXT_RUNTIME */ #define dnd_debug(a,b...) #endif /* NeXT_RUNTIME */ #endif void xdnd_reset(DndClass * dnd) { dnd->stage = XDND_DROP_STAGE_IDLE; dnd->dragging_version = 0; dnd->internal_drag = 0; dnd->want_position = 0; dnd->ready_to_drop = 0; dnd->will_accept = 0; dnd->rectangle.x = dnd->rectangle.y = 0; dnd->rectangle.width = dnd->rectangle.height = 0; dnd->dropper_window = 0; dnd->dragger_window = 0; dnd->dragger_typelist = 0; dnd->desired_type = 0; dnd->time = 0; } void xdnd_init(DndClass * dnd, Display * display) { memset (dnd, 0, sizeof (*dnd)); dnd->display = display; dnd->root_window = DefaultRootWindow (display); dnd->version = XDND_VERSION; dnd->XdndAware = XInternAtom (dnd->display, "XdndAware", False); dnd->XdndSelection = XInternAtom (dnd->display, "XdndSelection", False); dnd->XdndEnter = XInternAtom (dnd->display, "XdndEnter", False); dnd->XdndLeave = XInternAtom (dnd->display, "XdndLeave", False); dnd->XdndPosition = XInternAtom (dnd->display, "XdndPosition", False); dnd->XdndDrop = XInternAtom (dnd->display, "XdndDrop", False); dnd->XdndFinished = XInternAtom (dnd->display, "XdndFinished", False); dnd->XdndStatus = XInternAtom (dnd->display, "XdndStatus", False); dnd->XdndActionCopy = XInternAtom (dnd->display, "XdndActionCopy", False); dnd->XdndActionMove = XInternAtom (dnd->display, "XdndActionMove", False); dnd->XdndActionLink = XInternAtom (dnd->display, "XdndActionLink", False); dnd->XdndActionAsk = XInternAtom (dnd->display, "XdndActionAsk", False); dnd->XdndActionPrivate=XInternAtom(dnd->display,"XdndActionPrivate",False); dnd->XdndTypeList = XInternAtom (dnd->display, "XdndTypeList", False); dnd->XdndActionList = XInternAtom (dnd->display, "XdndActionList", False); dnd->XdndActionDescription = XInternAtom(dnd->display, "XdndActionDescription", False); xdnd_reset(dnd); } static int array_length(Atom * a) { // typelist is a null terminated array int n = 0; while (a[n]) n++; return n; } void xdnd_set_dnd_aware (DndClass * dnd, Window window, Atom * typelist) { XChangeProperty (dnd->display, window, dnd->XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char *) &dnd->version, 1); if (typelist) { int n = array_length (typelist); if (n) XChangeProperty (dnd->display, window, dnd->XdndAware, XA_ATOM, 32, PropModeAppend, (unsigned char *) typelist, n); } } int xdnd_is_dnd_aware(DndClass *dnd, Window window, int *version, Atom *typelist) { Atom actual; int format; unsigned long count, remaining; unsigned char *data = 0; Atom *types, *t; int result = 1; *version = 0; XGetWindowProperty (dnd->display, window, dnd->XdndAware, 0, 0x8000000L, False, XA_ATOM, &actual, &format, &count, &remaining, &data); if (actual != XA_ATOM || format != 32 || count == 0 || !data) { dnd_debug("XGetWindowProperty failed in xdnd_is_dnd_aware - XdndAware = %ld", dnd->XdndAware); if (data) XFree(data); return 0; } types = (Atom *) data; *version = dnd->version < types[0] ? dnd->version : types[0]; // minimum dnd_debug ("Using XDND version %d", *version); if (count > 1) { result = 0; for (t = typelist; *t; t++) { unsigned long j; for (j = 1; j < count; j++) { if (types[j] == *t) { result = 1; break; } } if (result) break; } } XFree(data); return result; } void xdnd_send_enter(DndClass *dnd, Window window, Window from, Atom *typelist) { XEvent xevent; int n, i; n = array_length (typelist); memset(&xevent, 0, sizeof (xevent)); xevent.xany.type = ClientMessage; xevent.xany.display = dnd->display; xevent.xclient.window = window; xevent.xclient.message_type = dnd->XdndEnter; xevent.xclient.format = 32; XDND_ENTER_SOURCE_WIN (&xevent) = from; XDND_ENTER_THREE_TYPES_SET (&xevent, n > XDND_THREE); XDND_ENTER_VERSION_SET (&xevent, dnd->version); for (i = 0; i < n && i < XDND_THREE; i++) { XDND_ENTER_TYPE (&xevent, i) = typelist[i]; } XSendEvent (dnd->display, window, 0, 0, &xevent); } void xdnd_send_position(DndClass *dnd, Window window, Window from, Atom action, int x, int y, unsigned long time) { XEvent xevent; memset (&xevent, 0, sizeof (xevent)); xevent.xany.type = ClientMessage; xevent.xany.display = dnd->display; xevent.xclient.window = window; xevent.xclient.message_type = dnd->XdndPosition; xevent.xclient.format = 32; XDND_POSITION_SOURCE_WIN (&xevent) = from; XDND_POSITION_ROOT_SET (&xevent, x, y); if (dnd_version_at_least (dnd->dragging_version, 1)) XDND_POSITION_TIME (&xevent) = time; if (dnd_version_at_least (dnd->dragging_version, 2)) XDND_POSITION_ACTION (&xevent) = action; XSendEvent (dnd->display, window, 0, 0, &xevent); } void xdnd_send_status(DndClass *dnd, Window window, Window from, int will_accept, int want_position, int x, int y, int w, int h, Atom action) { XEvent xevent; memset (&xevent, 0, sizeof (xevent)); xevent.xany.type = ClientMessage; xevent.xany.display = dnd->display; xevent.xclient.window = window; xevent.xclient.message_type = dnd->XdndStatus; xevent.xclient.format = 32; XDND_STATUS_TARGET_WIN (&xevent) = from; XDND_STATUS_WILL_ACCEPT_SET (&xevent, will_accept); if (will_accept) XDND_STATUS_WANT_POSITION_SET (&xevent, want_position); if (want_position) XDND_STATUS_RECT_SET (&xevent, x, y, w, h); if (dnd_version_at_least (dnd->dragging_version, 2)) if (will_accept) XDND_STATUS_ACTION (&xevent) = action; XSendEvent (dnd->display, window, 0, 0, &xevent); } void xdnd_send_leave(DndClass *dnd, Window window, Window from) { XEvent xevent; memset(&xevent, 0, sizeof (xevent)); xevent.xany.type = ClientMessage; xevent.xany.display = dnd->display; xevent.xclient.window = window; xevent.xclient.message_type = dnd->XdndLeave; xevent.xclient.format = 32; XDND_LEAVE_SOURCE_WIN (&xevent) = from; XSendEvent (dnd->display, window, 0, 0, &xevent); } void xdnd_send_drop(DndClass *dnd, Window window, Window from, unsigned long time) { XEvent xevent; memset (&xevent, 0, sizeof (xevent)); xevent.xany.type = ClientMessage; xevent.xany.display = dnd->display; xevent.xclient.window = window; xevent.xclient.message_type = dnd->XdndDrop; xevent.xclient.format = 32; XDND_DROP_SOURCE_WIN (&xevent) = from; if (dnd_version_at_least (dnd->dragging_version, 1)) XDND_DROP_TIME (&xevent) = time; XSendEvent (dnd->display, window, 0, 0, &xevent); } void xdnd_send_finished(DndClass * dnd, Window window, Window from, int error) { XEvent xevent; memset (&xevent, 0, sizeof (xevent)); xevent.xany.type = ClientMessage; xevent.xany.display = dnd->display; xevent.xclient.window = window; xevent.xclient.message_type = dnd->XdndFinished; xevent.xclient.format = 32; XDND_FINISHED_TARGET_WIN (&xevent) = from; XSendEvent (dnd->display, window, 0, 0, &xevent); } int xdnd_convert_selection(DndClass *dnd, Window window, Window requester, Atom type) { if (window != XGetSelectionOwner (dnd->display, dnd->XdndSelection)) { dnd_debug ("xdnd_convert_selection(): XGetSelectionOwner failed"); return 1; } XConvertSelection (dnd->display, dnd->XdndSelection, type, dnd->Xdnd_NON_PROTOCOL_ATOM, requester, CurrentTime); return 0; } int xdnd_set_selection_owner(DndClass * dnd, Window window, Atom type) { if (!XSetSelectionOwner(dnd->display,dnd->XdndSelection,window,CurrentTime)) { dnd_debug ("xdnd_set_selection_owner(): XSetSelectionOwner failed"); return 1; } return 0; } void xdnd_selection_send(DndClass * dnd, XSelectionRequestEvent * request, unsigned char *data, int length) { XEvent xevent; dnd_debug (" requestor = %ld", request->requestor); dnd_debug (" property = %ld", request->property); dnd_debug (" length = %d", length); XChangeProperty (dnd->display, request->requestor, request->property, request->target, 8, PropModeReplace, data, length); xevent.xselection.type = SelectionNotify; xevent.xselection.property = request->property; xevent.xselection.display = request->display; xevent.xselection.requestor = request->requestor; xevent.xselection.selection = request->selection; xevent.xselection.target = request->target; xevent.xselection.time = request->time; XSendEvent (dnd->display, request->requestor, 0, 0, &xevent); } // // Unused // void xdnd_set_type_list(DndClass * dnd, Window window, Atom * typelist) { int n = array_length (typelist); XChangeProperty (dnd->display, window, dnd->XdndTypeList, XA_ATOM, 32, PropModeReplace, (unsigned char *) typelist, n); } /* result must be free'd */ void xdnd_get_type_list(DndClass * dnd, Window window, Atom ** typelist) { Atom type, *a; int format; unsigned long i, count, remaining; unsigned char *data = NULL; *typelist = 0; XGetWindowProperty (dnd->display, window, dnd->XdndTypeList, 0, 0x8000000L, False, XA_ATOM, &type, &format, &count, &remaining, &data); if (type != XA_ATOM || format != 32 || count == 0 || !data) { if (data) XFree (data); dnd_debug ("XGetWindowProperty failed in xdnd_get_type_list - dnd->XdndTypeList = %ld", dnd->XdndTypeList); return; } *typelist = malloc ((count + 1) * sizeof (Atom)); a = (Atom *) data; for (i = 0; i < count; i++) (*typelist)[i] = a[i]; (*typelist)[count] = 0; XFree (data); } gnustep-back-0.29.0/Source/x11/xutil.c000066400000000000000000000151041404163720200173470ustar00rootroot00000000000000/* xutil.c - utility functions for X * * Raster graphics library * * Copyright (c) 1997-2002 Alfredo K. Kojima * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #ifdef XSHM #include #include #endif /* XSHM */ #include "x11/wraster.h" #ifdef XSHM static int shmError; static int (*oldErrorHandler)(); static int errorHandler(Display *dpy, XErrorEvent *err) { shmError=1; if(err->error_code!=BadAccess) (*oldErrorHandler)(dpy, err); return 0; } #endif RXImage* RCreateXImage(RContext *context, int depth, unsigned width, unsigned height) { RXImage *rximg; Visual *visual = context->visual; rximg = malloc(sizeof(RXImage)); if (!rximg) { RErrorCode = RERR_NOMEMORY; return NULL; } #ifndef XSHM rximg->image = XCreateImage(context->dpy, visual, depth, ZPixmap, 0, NULL, width, height, 8, 0); if (!rximg->image) { free(rximg); RErrorCode = RERR_XERROR; return NULL; } rximg->image->data = malloc(rximg->image->bytes_per_line*height); if (!rximg->image->data) { XDestroyImage(rximg->image); free(rximg); RErrorCode = RERR_NOMEMORY; return NULL; } #else /* XSHM */ if (!context->attribs->use_shared_memory) { retry_without_shm: context->attribs->use_shared_memory = 0; rximg->is_shared = 0; rximg->image = XCreateImage(context->dpy, visual, depth, ZPixmap, 0, NULL, width, height, 8, 0); if (!rximg->image) { free(rximg); RErrorCode = RERR_XERROR; return NULL; } rximg->image->data = malloc(rximg->image->bytes_per_line*height); if (!rximg->image->data) { XDestroyImage(rximg->image); free(rximg); RErrorCode = RERR_NOMEMORY; return NULL; } } else { rximg->is_shared = 1; rximg->info.readOnly = False; rximg->image = XShmCreateImage(context->dpy, visual, depth, ZPixmap, NULL, &rximg->info, width, height); rximg->info.shmid = shmget(IPC_PRIVATE, rximg->image->bytes_per_line*height, IPC_CREAT|0777); if (rximg->info.shmid < 0) { context->attribs->use_shared_memory = 0; perror("wrlib: could not allocate shared memory segment"); XDestroyImage(rximg->image); goto retry_without_shm; } rximg->info.shmaddr = shmat(rximg->info.shmid, 0, 0); if (rximg->info.shmaddr == (void*)-1) { context->attribs->use_shared_memory = 0; if (shmctl(rximg->info.shmid, IPC_RMID, 0) < 0) perror("wrlib: shmctl"); perror("wrlib: could not allocate shared memory"); XDestroyImage(rximg->image); goto retry_without_shm; } shmError = 0; XSync(context->dpy, False); oldErrorHandler = XSetErrorHandler(errorHandler); XShmAttach(context->dpy, &rximg->info); XSync(context->dpy, False); XSetErrorHandler(oldErrorHandler); rximg->image->data = rximg->info.shmaddr; /* rximg->image->obdata = &(rximg->info);*/ if (shmError) { context->attribs->use_shared_memory = 0; XDestroyImage(rximg->image); if (shmdt(rximg->info.shmaddr) < 0) perror("wrlib: shmdt"); if (shmctl(rximg->info.shmid, IPC_RMID, 0) < 0) perror("wrlib: shmctl"); /* printf("wrlib:error attaching shared memory segment to XImage\n"); */ goto retry_without_shm; } } #endif /* XSHM */ return rximg; } void RDestroyXImage(RContext *context, RXImage *rximage) { #ifndef XSHM XDestroyImage(rximage->image); #else /* XSHM */ if (rximage->is_shared) { XSync(context->dpy, False); XShmDetach(context->dpy, &rximage->info); XDestroyImage(rximage->image); if (shmdt(rximage->info.shmaddr) < 0) perror("wrlib: shmdt"); if (shmctl(rximage->info.shmid, IPC_RMID, 0) < 0) perror("wrlib: shmctl"); } else { XDestroyImage(rximage->image); } #endif free(rximage); } static unsigned getDepth(Display *dpy, Drawable d) { Window w; int foo; unsigned bar; unsigned depth; XGetGeometry(dpy, d, &w, &foo, &foo, &bar, &bar, &bar, &depth); return depth; } RXImage* RGetXImage(RContext *context, Drawable d, int x, int y, unsigned width, unsigned height) { RXImage *ximg = NULL; #ifdef XSHM if (context->attribs->use_shared_memory && 0) { ximg = RCreateXImage(context, getDepth(context->dpy, d), width, height); if (ximg && !ximg->is_shared) { RDestroyXImage(context, ximg); ximg = NULL; } if (ximg) { XShmGetImage(context->dpy, d, ximg->image, x, y, AllPlanes); } } if (!ximg) { ximg = malloc(sizeof(RXImage)); if (!ximg) { RErrorCode = RERR_NOMEMORY; return NULL; } ximg->is_shared = 0; ximg->image = XGetImage(context->dpy, d, x, y, width, height, AllPlanes, ZPixmap); } return ximg; #else /* !XSHM */ ximg = malloc(sizeof(RXImage)); if (!ximg) { RErrorCode = RERR_NOMEMORY; return NULL; } ximg->image = XGetImage(context->dpy, d, x, y, width, height, AllPlanes, ZPixmap); return ximg; #endif /* !XSHM */ } void RPutXImage(RContext *context, Drawable d, GC gc, RXImage *ximage, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) { #ifndef XSHM XPutImage(context->dpy, d, gc, ximage->image, src_x, src_y, dest_x, dest_y, width, height); #else if (ximage->is_shared) { XShmPutImage(context->dpy, d, gc, ximage->image, src_x, src_y, dest_x, dest_y, width, height, False); } else { XPutImage(context->dpy, d, gc, ximage->image, src_x, src_y, dest_x, dest_y, width, height); } XFlush(context->dpy); #endif /* XSHM */ } #ifdef XSHM Pixmap R_CreateXImageMappedPixmap(RContext *context, RXImage *rximage) { Pixmap pix; pix = XShmCreatePixmap(context->dpy, context->drawable, rximage->image->data, &rximage->info, rximage->image->width, rximage->image->height, rximage->image->depth); return pix; } #endif /* XSHM */ gnustep-back-0.29.0/Source/xdps/000077500000000000000000000000001404163720200164025ustar00rootroot00000000000000gnustep-back-0.29.0/Source/xdps/.cvsignore000066400000000000000000000000171404163720200204000ustar00rootroot00000000000000Resources *obj gnustep-back-0.29.0/Source/xdps/AFMFileFontInfo.h000066400000000000000000000044621404163720200214270ustar00rootroot00000000000000/* AFMFileFontInfo.h Private data of PXKFont class. Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: February 1997 This file is part of the GNUstep GUI X/DPS Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __AFMFileFontInfo_h__ #define __AFMFileFontInfo_h__ #include #include #include "parseAFM.h" typedef struct { NSGlyph glyph; NSSize advancement; } tPairKerningInfo; @interface PXKFontEnumerator : GSFontEnumerator { } @end @interface AFMGlyphInfo : NSObject { NSString* name; NSGlyph code; NSRect bbox; NSSize advancement; int lastKernPair; int numOfPairs; tPairKerningInfo* kerning; } + (AFMGlyphInfo*) glyphFromAFMCharMetricInfo: (AFMCharMetricInfo*)metricInfo; - (AFMGlyphInfo*)mutableCopyWithZone: (NSZone*)zone; - (NSString*) name; - (NSGlyph) code; - (NSRect) boundingRect; - (NSSize) advancement; - (BOOL) isEncoded; - (void) transformUsingMatrix: (const float*)matrix; - (void) incrementNumberOfKernPairs; - (void) addPairKerningForGlyph:(NSGlyph)glyph advancement:(NSSize)advancement; - (NSSize) advancementIfFollowedByGlyph: (NSGlyph)glyph isNominal: (BOOL*)nominal; @end @interface AFMFileFontInfo : GSFontInfo { NSString *afmFileName; NSMapTable *glyphsByName; AFMGlyphInfo *glyphs[256]; } - (AFMFileFontInfo*)mutableCopyWithZone: (NSZone*)zone; - (AFMFileFontInfo*)initUnscaledWithFontName: (NSString*)name; @end #endif /* __AFMFileFontInfo_h__ */ gnustep-back-0.29.0/Source/xdps/AFMFileFontInfo.m000066400000000000000000000544561404163720200214440ustar00rootroot00000000000000/* AFMFileFontInfo.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: February 1997 This file is part of the GNUstep GUI X/DPS Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include "config.h" #include #include #include #include #include #include #include #include #include "xdps/NSDPSContext.h" #include "AFMFileFontInfo.h" #include "general.h" #include "fonts.h" /* This dictionary keeps global font info objects indexed by AFM file names. A global font info instance is the representation of AFM file; all the dimensions are in the 1x1 space not in the 1000x1000 space of the AFM file. Each font object maintains a copy of this instance with all the dimensions scaled to the font size. */ static NSMutableDictionary* globalFontInfoDictionary = nil; static NSMutableDictionary* globalFileDictionary = nil; #ifndef LIB_FOUNDATION_LIBRARY /* Define callbacks for a map table that has cStrings as keys */ /* hpjw from Aho, Sethi & Ullman: Principles of compiler design. */ static unsigned __NSHashCString(void *table, const void *aString) { register const char* p = (char*)aString; register unsigned hash = 0, hash2; register int i, n = strlen((char*)aString); for (i=0; i < n; i++) { hash <<= 4; hash += *p++; if ((hash2 = hash & 0xf0000000)) hash ^= (hash2 >> 24) ^ hash2; } return hash; } static BOOL __NSCompareCString(void *table, const void *anObject1, const void *anObject2) { return strcmp((char*)anObject1, (char*)anObject2) == 0; } static void __NSRetainNothing(void *table, const void *anObject) { } static void __NSReleaseNothing(void *table, void *anObject) { } static NSString* __NSDescribePointers(void *table, const void *anObject) { return [NSString stringWithCString:anObject]; } static const NSMapTableKeyCallBacks NSNonOwnedCStringMapKeyCallBacks = { (unsigned(*)(NSMapTable*, const void*))__NSHashCString, (BOOL(*)(NSMapTable*, const void*, const void*))__NSCompareCString, (void (*)(NSMapTable*, const void* anObject))__NSRetainNothing, (void (*)(NSMapTable*, void* anObject))__NSReleaseNothing, (NSString *(*)(NSMapTable*, const void*))__NSDescribePointers, (const void *)NULL }; #endif /* LIB_FOUNDATION_LIBRARY */ static int afmEnumerator (char* resourceType, char* resourceName, char* resourceFile, char* fontsList) { NSString* afmFileName = [NSString stringWithCString: resourceFile]; [(NSMutableArray*)fontsList addObject: afmFileName]; return 0; } @implementation AFMFileFontInfo + (void)initialize { static BOOL initialized = NO; if (!initialized) { initialized = YES; globalFontInfoDictionary = [NSMutableDictionary new]; globalFileDictionary = [NSMutableDictionary new]; } } - (NSString *) _getFontResource { NSString* fontFile; DPSContext ctxt; char font_file[FILENAME_MAX + 1]; ctxt = [(NSDPSContext *)GSCurrentContext() xDPSContext]; fontFile = nil; PSWGetFontFile(ctxt, [fontName cString], font_file); if (strncmp(font_file, "/Resource", 9) == 0) { char completePath[FILENAME_MAX + 1]; int found; /* We're using GS which returns files differently */ PSWGSFontFile(ctxt, [fontName cString], font_file); PSWCompleteFilename (font_file, &found, completePath); if (found) { fontFile = [NSString stringWithCString: completePath]; fontFile = [[fontFile stringByDeletingPathExtension] stringByAppendingPathExtension:@"afm"]; } } else if (font_file[0] != '/') { /* Can't handle this yet, try the Adobe way... */ NSMutableArray *fontsList = [[NSMutableArray new] autorelease]; NSDebugLLog(@"Fonts", @"Font file resource returned relative-path %s", font_file); EnumeratePSResourceFiles (NULL, NULL, PSResFontAFM, [fontName cString], afmEnumerator, (char*)fontsList); if (![fontsList count]) NSLog (@"WARNING: Font file not found! Check if the PSRESOURCEPATH " @"environment variable points to the right directory. If so then " @"probably you did not build the PS resource database using the " @"`makepsres' utility."); else fontFile = [fontsList objectAtIndex: 0]; } if (fontFile) NSDebugLLog(@"Fonts", @"Found AFM file %@ for font %@", fontFile, fontName); return fontFile; } - _setFontInfo { NSAutoreleasePool* pool; AFMFontInfo* cFontInfo; AFMGlobalFontInfo* gfi; int fontType; FILE* file; int i, code; NSString *sweight; afmFileName = [globalFileDictionary objectForKey: fontName]; if (afmFileName == nil) { afmFileName = [self _getFontResource]; if (afmFileName == nil) { NSLog (@"No AFM file for font %@. Can't get font info", fontName); return nil; } [globalFileDictionary setObject: afmFileName forKey: fontName]; } RETAIN(afmFileName); if (![[NSFileManager defaultManager] isReadableFileAtPath: afmFileName]) { NSLog (@"Cannot read AFM file %@ for font %@", afmFileName, fontName); return nil; } file = fopen ([afmFileName cString], "r"); if (!file) { NSLog (@"Cannot open AFM file %@ for font %@", afmFileName, fontName); return nil; } code = AFMParseFile (file, &cFontInfo, AFM_G | AFM_M | AFM_P); if (code != afm_ok) { switch (code) { case afm_parseError: NSLog (@"parse error in AFM file %@", afmFileName); break; case afm_earlyEOF: NSLog (@"unexpected EOF in AFM file %@", afmFileName); break; case afm_storageProblem: NSLog (@"memory allocation problem while parsing the AFM file %@", afmFileName); break; } fclose (file); return nil; } fclose (file); gfi = cFontInfo->gfi; pool = [NSAutoreleasePool new]; /* * Set the font information in instance variables and in the AFM dictionary. */ fontDictionary = [[NSMutableDictionary alloc] initWithCapacity: 25]; /* The font may actually be a GS alias, so do not set the fontName * field. */ // fontName = [[NSString stringWithCString:gfi->fontName] retain]; [fontDictionary setObject: fontName forKey: NSAFMFontName]; familyName = [[NSString stringWithCString:gfi->familyName] retain]; [fontDictionary setObject: familyName forKey: NSAFMFamilyName]; italicAngle = gfi->italicAngle; [fontDictionary setObject: [NSNumber numberWithFloat:gfi->italicAngle] forKey: NSAFMItalicAngle]; sweight = [NSString stringWithCString:gfi->weight]; [fontDictionary setObject: sweight forKey: NSAFMWeight]; underlinePosition = ((float)gfi->underlinePosition) / 1000; [fontDictionary setObject: [NSNumber numberWithFloat:underlinePosition] forKey: NSAFMUnderlinePosition]; underlineThickness = ((float)gfi->underlineThickness) / 1000; [fontDictionary setObject: [NSNumber numberWithFloat:underlineThickness] forKey: NSAFMUnderlineThickness]; capHeight = ((float)gfi->capHeight) / 1000; [fontDictionary setObject: [NSNumber numberWithFloat:capHeight] forKey: NSAFMCapHeight]; xHeight = ((float)gfi->xHeight) / 1000; [fontDictionary setObject: [NSNumber numberWithFloat:xHeight] forKey: NSAFMXHeight]; descender = ((float)gfi->descender) / 1000; [fontDictionary setObject: [NSNumber numberWithFloat:descender] forKey: NSAFMDescender]; ascender = ((float)gfi->ascender) / 1000; [fontDictionary setObject: [NSNumber numberWithFloat:ascender] forKey: NSAFMAscender]; encodingScheme = [[NSString stringWithCString:gfi->encodingScheme] retain]; [fontDictionary setObject: encodingScheme forKey: NSAFMEncodingScheme]; [fontDictionary setObject: [NSString stringWithCString:gfi->afmVersion] forKey: NSAFMFormatVersion]; [fontDictionary setObject:[NSString stringWithCString:gfi->notice] forKey: NSAFMNotice]; [fontDictionary setObject:[NSString stringWithCString:gfi->version] forKey: NSAFMVersion]; /* Setup bbox as expected by NSFont */ fontBBox.origin.x = ((float)gfi->fontBBox.llx) / 1000; fontBBox.origin.y = ((float)gfi->fontBBox.lly) / 1000; fontBBox.size.width = ((float)(gfi->fontBBox.urx - gfi->fontBBox.llx)) / 1000; fontBBox.size.height = ((float)(gfi->fontBBox.ury - gfi->fontBBox.lly)) / 1000; isFixedPitch = gfi->isFixedPitch; /* Get the font type from the DGS server */ PSWGetFontType ([fontName cString], &fontType); isBaseFont = (fontType != 0); maximumAdvancement.width = FLT_MIN; maximumAdvancement.height = FLT_MIN; minimumAdvancement.width = FLT_MAX; minimumAdvancement.height = FLT_MAX; /* Fill in the glyphs arrays. */ glyphsByName = NSCreateMapTable (NSNonOwnedCStringMapKeyCallBacks, NSObjectMapValueCallBacks, 256); for (i = 0; i < cFontInfo->numOfChars; i++) { AFMCharMetricInfo charMetricInfo = cFontInfo->cmi[i]; AFMGlyphInfo* glyph = [AFMGlyphInfo glyphFromAFMCharMetricInfo:&charMetricInfo]; NSSize glyphAdvancement = [glyph advancement]; NSMapInsert (glyphsByName, [[glyph name] cString], glyph); maximumAdvancement.width = MAX (maximumAdvancement.width, glyphAdvancement.width); maximumAdvancement.height = MAX (maximumAdvancement.height, glyphAdvancement.height); minimumAdvancement.width = MIN (minimumAdvancement.width, glyphAdvancement.width); minimumAdvancement.height = MIN (minimumAdvancement.height, glyphAdvancement.height); if (charMetricInfo.code > 0) { glyphs[charMetricInfo.code] = [glyph retain]; } } /* Set the entries in the kerning array for all the glyphs in the pair kerning array. */ { AFMGlyphInfo* glyph1 = nil; AFMGlyphInfo* glyph2 = nil; const char* previousGlyphName = ""; AFMPairKernData pkd; NSSize advancement; /* First compute the numbers of kern pairs for each glyph. This is used to avoid unnecessary allocations of kern pair arrays in glyph objects. */ for (i = 0; i < cFontInfo->numOfPairs; i++) { pkd = cFontInfo->pkd[i]; /* Check the name of the first glyph. Use a hint here: the kern pairs are grouped on the first glyph. */ if (strcmp (pkd.name1, previousGlyphName)) { previousGlyphName = pkd.name1; glyph1 = NSMapGet (glyphsByName, pkd.name1); } [glyph1 incrementNumberOfKernPairs]; } /* Now set the pair kerns in glyphs. */ for (i = 0; i < cFontInfo->numOfPairs; i++) { pkd = cFontInfo->pkd[i]; if (strcmp (pkd.name1, previousGlyphName)) { previousGlyphName = pkd.name1; glyph1 = NSMapGet (glyphsByName, pkd.name1); } glyph2 = NSMapGet (glyphsByName, pkd.name2); if (!glyph1) { NSLog (@"unknown glyph name %s in AFM file %@", pkd.name1, afmFileName); continue; } if (!glyph2) { NSLog (@"unknown glyph name %s in AFM file %@", pkd.name2, afmFileName); continue; } advancement = NSMakeSize (pkd.xamt, pkd.yamt); [glyph1 addPairKerningForGlyph:[glyph2 code] advancement:advancement]; } } /* Free the cFontInfo structure */ free (gfi->afmVersion); free (gfi->fontName); free (gfi->fullName); free (gfi->familyName); free (gfi->weight); free (gfi->version); free (gfi->notice); free (gfi->encodingScheme); for (i = 0; i < cFontInfo->numOfChars; i++) { AFMCharMetricInfo cmi = cFontInfo->cmi[i]; free (cmi.name); } for (i = 0; i < cFontInfo->numOfPairs; i++) { AFMPairKernData pkd = cFontInfo->pkd[i]; free (pkd.name1); free (pkd.name2); } free (cFontInfo); [pool release]; return self; } - (void) transformUsingMatrix: (const float*)fmatrix { float a = fmatrix[0]; float b = fmatrix[1]; float c = fmatrix[2]; float d = fmatrix[3]; float tx = fmatrix[4]; float ty = fmatrix[5]; float x1, y1, width1, height1; int i; memcpy(matrix, fmatrix, sizeof(matrix)); for (i = 0; i < 256; i++) { [glyphs[i] transformUsingMatrix: fmatrix]; } x1 = fontBBox.origin.x; y1 = fontBBox.origin.y; width1 = fontBBox.size.width; height1 = fontBBox.size.height; fontBBox.origin.x = a * x1 + c * y1 + tx; fontBBox.origin.y = b * x1 + d * y1 + ty; fontBBox.size.width = a * width1 + c * height1; fontBBox.size.height = b * width1 + d * height1; width1 = maximumAdvancement.width; height1 = maximumAdvancement.height; maximumAdvancement.width = a * width1 + c * height1; maximumAdvancement.height = b * width1 + d * height1; width1 = minimumAdvancement.width; height1 = minimumAdvancement.height; minimumAdvancement.width = a * width1 + c * height1; minimumAdvancement.height = b * width1 + d * height1; underlinePosition = a * underlinePosition + tx; underlineThickness = a * underlineThickness + tx; capHeight = a * capHeight + tx; ascender = a * ascender + tx; descender = a * descender + tx; xHeight = a * xHeight + tx; } - (AFMFileFontInfo *) transformedFontInfoForMatrix: (const float *)fmatrix { AFMFileFontInfo *new = [self mutableCopy]; [new transformUsingMatrix: fmatrix]; return AUTORELEASE(new); } - initUnscaledWithFontName: (NSString*)name { AFMFileFontInfo *fontInfo; /* Check whether the font info is cached */ fontInfo = [globalFontInfoDictionary objectForKey: name]; if (fontInfo != nil) { RELEASE(self); // retain to act like we were alloc'd return RETAIN(fontInfo); } /* Tough. Parse the AFM file and create a new font info for the unscaled font. */ [super init]; fontName = RETAIN(name); if ([self _setFontInfo] == nil) { RELEASE(self); return nil; } /* Cache the font info for later use */ [globalFontInfoDictionary setObject: self forKey: fontName]; return self; } - initWithFontName: (NSString*)name matrix: (const float *)fmatrix screenFont: (BOOL)screenFont { AFMFileFontInfo *fontInfo, *baseFontInfo; if (screenFont) { RELEASE(self); return nil; } RELEASE(self); /* Grab an unscaled font info and create a new scaled one. */ baseFontInfo = [[AFMFileFontInfo alloc] initUnscaledWithFontName: name]; if (baseFontInfo == nil) { return nil; } fontInfo = [baseFontInfo transformedFontInfoForMatrix: fmatrix]; RELEASE(baseFontInfo); RETAIN(fontInfo); return fontInfo; } - (void) dealloc { int i; /* Don't free the glyphsByName map table. It is owned by the first font info object that is never freed. */ for (i = 0; i < 256; i++) TEST_RELEASE(glyphs[i]); TEST_RELEASE(afmFileName); [super dealloc]; } - (void)set { if ([[GSCurrentContext() focusView] isFlipped]) { float invmatrix[6]; memcpy(invmatrix, matrix, sizeof(invmatrix)); invmatrix[3] = -invmatrix[3]; PSWSetFont ([fontName cString], invmatrix); } else PSWSetFont ([fontName cString], matrix); } - (NSString*)afmFileContents { return [NSString stringWithContentsOfFile: afmFileName]; } - copyWithZone: (NSZone *)zone { AFMFileFontInfo* new; if (NSShouldRetainWithZone(self, zone)) new = RETAIN(self); else { int i; new = [super copyWithZone: zone]; for (i = 0; i < 256; i++) { new->glyphs[i] = [glyphs[i] copyWithZone: zone]; } new->afmFileName = [afmFileName copyWithZone: zone]; } return new; } - mutableCopyWithZone: (NSZone *)zone { int i; AFMFileFontInfo* new = [super mutableCopyWithZone: zone]; for (i = 0; i < 256; i++) { new->glyphs[i] = [glyphs[i] mutableCopyWithZone: zone]; } new->afmFileName = [afmFileName copyWithZone: zone]; return new; } - (NSSize)advancementForGlyph:(NSGlyph)glyph { return [glyphs[glyph] advancement]; } - (NSRect)boundingRectForGlyph:(NSGlyph)glyph { return [glyphs[glyph] boundingRect]; } - (BOOL)glyphIsEncoded:(NSGlyph)glyph { return [glyphs[glyph] isEncoded]; } - (NSGlyph)glyphWithName:(NSString*)glyphName { AFMGlyphInfo* glyph = NSMapGet (glyphsByName, [glyphName cString]); return glyph ? [glyph code] : -1; } - (NSPoint)positionOfGlyph:(NSGlyph)curGlyph precededByGlyph:(NSGlyph)prevGlyph isNominal:(BOOL*)nominal { NSPoint point; NSSize size; if (curGlyph == NSControlGlyph || prevGlyph == NSControlGlyph || curGlyph < 0 || curGlyph > 255 || prevGlyph < 0 || prevGlyph >255) { if (nominal) *nominal = NO; return NSZeroPoint; } if (curGlyph == NSNullGlyph) { size = [glyphs[prevGlyph] advancement]; point.x = size.width; point.y = size.height; if (nominal) *nominal = NO; return point; } if (glyphs[prevGlyph]) { if (!glyphs[curGlyph]) { point.x = maximumAdvancement.width; point.y = maximumAdvancement.height; if (nominal) *nominal = NO; return point; } size = [glyphs[prevGlyph] advancementIfFollowedByGlyph: [glyphs[curGlyph] code] isNominal:nominal]; point.x = size.width; point.y = size.height; return point; } return NSZeroPoint; } - (float)widthOfString:(NSString*)string { /* TODO: We should really map here the characters from string to series of glyphs. Until then we consider the glyphs to be equivalent with characters. */ int i, length = [string length]; const char* cString = [string cString]; float width = 0; for (i = 0; i < length; i++) { width += [glyphs[(int)cString[i]] advancement].width; } return width; } @end /* AFMFileFontInfo */ @implementation AFMGlyphInfo + (AFMGlyphInfo*)glyphFromAFMCharMetricInfo:(AFMCharMetricInfo*)mi { AFMGlyphInfo* glyph = [[self new] autorelease]; glyph->name = [[NSString stringWithCString:mi->name] retain]; glyph->code = mi->code; /* Setup bbox as defined by NSRect */ glyph->bbox.origin.x = ((float)mi->charBBox.llx) / 1000; glyph->bbox.origin.y = ((float)mi->charBBox.lly) / 1000; glyph->bbox.size.width = ((float)mi->charBBox.urx - mi->charBBox.llx) / 1000; glyph->bbox.size.height = ((float)mi->charBBox.ury - mi->charBBox.lly)/ 1000; glyph->advancement.width = ((float)mi->wx) / 1000; glyph->advancement.height = ((float)mi->wy) / 1000; return glyph; } - (void)transformUsingMatrix:(const float*)matrix; { float a = matrix[0]; float b = matrix[1]; float c = matrix[2]; float d = matrix[3]; float tx = matrix[4]; float ty = matrix[5]; float x1 = bbox.origin.x; float y1 = bbox.origin.y; float width1 = bbox.size.width; float height1 = bbox.size.height; int i; bbox.origin.x = a * x1 + c * y1 + tx; bbox.origin.y = b * x1 + d * y1 + ty; bbox.size.width = a * width1 + c * height1; bbox.size.height = b * width1 + d * height1; x1 = advancement.width; y1 = advancement.height; advancement.width = a * x1 + c * y1 + tx; advancement.height = b * x1 + d * y1 + ty; for (i = 0; i < numOfPairs; i++) { x1 = kerning[i].advancement.width; y1 = kerning[i].advancement.height; kerning[i].advancement.width = a * x1 + c * y1 + tx; kerning[i].advancement.height = b * x1 + d * y1 + ty; } } - (void)incrementNumberOfKernPairs { numOfPairs++; } - (void)addPairKerningForGlyph:(NSGlyph)glyph advancement:(NSSize)_advancement { tPairKerningInfo kernInfo = { glyph, { advancement.width + ((float)_advancement.width) / 1000, advancement.height + ((float)_advancement.height) / 1000 } }; int i; if (kerning == NULL) kerning = malloc (numOfPairs * sizeof (tPairKerningInfo)); /* Insert the glyph in the proper position in the kerning array so this will be sorted ascending after the glyph code. */ for (i = 0; i < lastKernPair; i++) if (kerning[i].glyph > glyph) { /* Make room for a new kerning pair in this position. */ memmove (&kerning[i + 1], &kerning[i], (lastKernPair - i) * sizeof (tPairKerningInfo)); break; } kerning[i] = kernInfo; lastKernPair++; } - (NSSize)advancementIfFollowedByGlyph:(NSGlyph)glyph isNominal:(BOOL*)nominal { /* Search for the glyph using a binary search algorithm */ int lower = 0; int upper = numOfPairs; int midpoint; if (!kerning) { if (nominal) *nominal = NO; return advancement; } while (upper >= lower) { midpoint = (lower + upper) / 2; if (kerning[midpoint].glyph == glyph) { if (nominal) *nominal = YES; return kerning[midpoint].advancement; } else if (kerning[midpoint].glyph > glyph) upper = midpoint - 1; else if (kerning[midpoint].glyph < glyph) lower = midpoint + 1; } /* The glyph was not found in the kernings array. Return the advancement of receiver. */ if (nominal) *nominal = NO; return advancement; } - copyWithZone: (NSZone *)zone { AFMGlyphInfo *copy; if (NSShouldRetainWithZone(self, zone)) copy = RETAIN(self); else { copy = (AFMGlyphInfo*) NSCopyObject (self, 0, zone); copy->name = [name copyWithZone: zone]; if (kerning) { copy->kerning = malloc (numOfPairs * sizeof (tPairKerningInfo)); memcpy (copy->kerning, kerning, numOfPairs * sizeof (tPairKerningInfo)); } } return copy; } - mutableCopyWithZone: (NSZone *)zone { AFMGlyphInfo *copy; copy = (AFMGlyphInfo*) NSCopyObject (self, 0, zone); copy->name = [name copyWithZone: zone]; if (kerning) { copy->kerning = malloc (numOfPairs * sizeof (tPairKerningInfo)); memcpy (copy->kerning, kerning, numOfPairs * sizeof (tPairKerningInfo)); } return copy; } - (void)dealloc { RELEASE(name); if (kerning) free (kerning); [super dealloc]; } - (NSString*)name { return name; } - (NSGlyph)code { return code; } - (NSRect)boundingRect { return bbox; } - (NSSize)advancement { return advancement; } - (BOOL)isEncoded { return YES; } @end /* AFMGlyphInfo */ gnustep-back-0.29.0/Source/xdps/GNUmakefile000066400000000000000000000031011404163720200204470ustar00rootroot00000000000000# # Main makefile for GNUstep Backend xdps # # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make SUBPROJECT_NAME=xdps # The pswrap source files to be compiled xdps_PSWRAP_FILES = \ general.psw \ drawingfuncs.psw \ extensions.psw \ fonts.psw # The C source files to be compiled xdps_C_FILES = \ parseAFM.c # The Objective-C source files to be compiled xdps_OBJC_FILES = \ AFMFileFontInfo.m \ NSDPSContext.m \ NSDPSContextOps.m \ PXKFontManager.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/xdps/GNUmakefile.preamble000066400000000000000000000031261404163720200222440ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler #ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS = -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS = # Additional library directories the linker should search ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/xdps/NSDPSContext.m000066400000000000000000000423001404163720200210130ustar00rootroot00000000000000/* NSDPSContext.m Encapsulation of Display Postscript contexts Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "x11/XGServer.h" #include "xdps/NSDPSContext.h" #define BOOL XWINDOWSBOOL #include #include #undef BOOL #ifdef HAVE_WRASTER_H #include "wraster.h" #else #include "x11/wraster.h" #endif #include "general.h" #include "extensions.h" #include "drawingfuncs.h" #include "AFMFileFontInfo.h" // // DPS exceptions // NSString *DPSPostscriptErrorException = @"DPSPostscriptErrorException"; NSString *DPSNameTooLongException = @"DPSNameTooLongException"; NSString *DPSResultTagCheckException = @"DPSResultTagCheckException"; NSString *DPSResultTypeCheckException = @"DPSResultTypeCheckException"; NSString *DPSInvalidContextException = @"DPSInvalidContextException"; NSString *DPSSelectException = @"DPSSelectException"; NSString *DPSConnectionClosedException = @"DPSConnectionClosedException"; NSString *DPSReadException = @"DPSReadException"; NSString *DPSWriteException = @"DPSWriteException"; NSString *DPSInvalidFDException = @"DPSInvalidFDException"; NSString *DPSInvalidTEException = @"DPSInvalidTEException"; NSString *DPSInvalidPortException = @"DPSInvalidPortException"; NSString *DPSOutOfMemoryException = @"DPSOutOfMemoryException"; NSString *DPSCantConnectException = @"DPSCantConnectException"; #define XDPY (((RContext *)context)->dpy) #define XDRW (((RContext *)context)->drawable) enum { A_COEFF = 0, B_COEFF, C_COEFF, D_COEFF, TX_CONS, TY_CONS }; // // Class variables // static BOOL GNU_CONTEXT_TRACED = NO; static BOOL GNU_CONTEXT_SYNCHRONIZED = NO; static NSDPSContext *context_list = nil; static FILE *gstream = NULL; /* Text handler for text contexts */ static void GNUstepOutputTextProc (DPSContext ctxt, char *buf, long unsigned int count) { /* FIXME: If there's a possibility of having more than one text context we should have some simple hash to determine what stream to write to */ if (gstream) fwrite(buf, 1, count, gstream); else DPSDefaultTextBackstop (ctxt, buf, count); } /* Text handler for screen contexts */ static void GNUstepTextProc (DPSContext ctxt, char *buf, long unsigned int count) { DPSDefaultTextBackstop (ctxt, buf, count); } /* Error handler for all types of contexts */ static void GNUstepErrorProc (DPSContext ctxt, DPSErrorCode errCode, unsigned arg1, unsigned args) { DPSDefaultErrorProc (ctxt, errCode, arg1, arg1); } @interface NSDPSContext (Private) - (void) createDPSContext; - (void) createTextContext; @end @implementation NSDPSContext + (void)initialize { if (self == [NSDPSContext class]) { // Set initial version [self setVersion: 1]; GNU_CONTEXT_TRACED = NO; GNU_CONTEXT_SYNCHRONIZED = NO; } } /* Initialize AppKit backend */ + (void)initializeBackend { NSDebugLog(@"Initializing GNUstep GUI X/DPS Backend.\n"); [NSGraphicsContext setDefaultContextClass: [NSDPSContext class]]; [GSFontEnumerator setDefaultClass: [PXKFontEnumerator class]]; [GSFontInfo setDefaultClass: [AFMFileFontInfo class]]; } + (void) setCurrentContext: (NSGraphicsContext *)aContext { [super setCurrentContext: aContext]; DPSSetContext([(NSDPSContext *)aContext xDPSContext]); } // // Initializing a Context // - init { return [self initWithContextInfo: nil]; } - (id) initWithContextInfo: (NSDictionary *)info { NSString *contextType; [super initWithContextInfo: info]; /* A context is only associated with one server. Do not retain the server, however */ server = GSCurrentServer(); chained_parent = nil; chained_child = nil; contextType = [info objectForKey: NSGraphicsContextRepresentationFormatAttributeName]; if (contextType && [contextType isEqual: NSGraphicsContextPSFormat]) { NSString *path; is_screen_context = NO; error_proc = GNUstepErrorProc; text_proc = GNUstepOutputTextProc; path = [info objectForKey: @"NSOutputFile"]; if (path == nil) { NSLog(@"Warning: No path set for stream context, default temp.ps"); path = @"temp.ps"; } gstream = fopen([path cString], "w"); if (gstream == NULL) { NSLog(@"Error: Could not open output path for stream context"); } } else { is_screen_context = YES; error_proc = GNUstepErrorProc; text_proc = GNUstepTextProc; } /* * Create the context */ if (is_screen_context) { [self createDPSContext]; } else { [self createTextContext]; } if (dps_context == NULL) { [self dealloc]; return nil; } /* Add context to global list of contexts */ next_context = context_list; context_list = self; if (GSDebugSet(@"NSDPSContext") == YES) { NSLog(@"NSDPSContext: Tracing Postscript \n"); [self setOutputTraced: YES]; } return self; } - (void)dealloc { DESTROY(chained_child); DPSDestroySpace(DPSSpaceFromContext(dps_context)); if (is_screen_context == 0) { if (gstream) fclose(gstream); } /* Remove context from global list of contexts */ { NSDPSContext *ctxt = context_list, *previous=nil; while (ctxt) { if (ctxt == self) break; previous = ctxt; ctxt = ctxt->next_context; } if (!ctxt) NSLog(@"Internal Error: Couldn't find context to delete"); else { if (previous) previous->next_context = next_context; else context_list = next_context; } } [super dealloc]; } // // Testing the Drawing Destination // - (BOOL)isDrawingToScreen { return is_screen_context; } - (NSDPSContext *)DPSContext { return self; } - (void)wait { DPSWaitContext (dps_context); } + (void) waitAllContexts { NSDPSContext *ctxt; ctxt = context_list; while (ctxt) { [ctxt wait]; ctxt = ctxt->next_context; } } // // Managing Returned Text and Errors // + (NSString *)stringForDPSError:(const DPSBinObjSeqRec *)error { return nil; } - (DPSErrorProc)errorProc { return error_proc; } - (void)setErrorProc:(DPSErrorProc)proc { error_proc = proc; } - (void)setTextProc:(DPSTextProc)proc { text_proc = proc; } - (DPSTextProc)textProc { return text_proc; } // // Managing Chained Contexts // - (void)setParentContext:(NSDPSContext *)parent { chained_parent = parent; } - (void)chainChildContext:(NSDPSContext *)child { if (child) { chained_child = [child retain]; [child setParentContext: self]; } } - (NSDPSContext *)childContext { return chained_child; } - (NSDPSContext *)parentContext { return chained_parent; } - (void)unchainContext { if (chained_child) { [chained_child setParentContext: nil]; [chained_child release]; chained_child = nil; } } // // Debugging Aids // + (BOOL)areAllContextsOutputTraced { return GNU_CONTEXT_TRACED; } + (BOOL)areAllContextsSynchronized { return GNU_CONTEXT_SYNCHRONIZED; } + (void)setAllContextsOutputTraced:(BOOL)flag { GNU_CONTEXT_TRACED = flag; } + (void)setAllContextsSynchronized:(BOOL)flag { GNU_CONTEXT_SYNCHRONIZED = flag; } - (BOOL)isOutputTraced { return is_output_traced; } - (BOOL)isSynchronized { return is_synchronized; } - (void)setOutputTraced:(BOOL)flag { is_output_traced = flag; XDPSChainTextContext(dps_context, flag); } - (void)setSynchronized:(BOOL)flag { is_synchronized = flag; } @end // // Methods for XWindows implementation // @implementation NSDPSContext (GNUstepXDPS) - (Display*)xDisplay { if (is_screen_context) return [(XGServer *)server xDisplay]; else return NULL; } - (DPSContext)xDPSContext { return dps_context; } - (void)createDPSContext { int x, y, supported; unsigned long valuemask; XGCValues values; // Where should the screen number come from? context = [(XGServer *)server xrContextForScreen: 0]; if (!XDPSExtensionPresent(XDPY)) { #if HAVE_DPS_DPSNXARGS_H /* Make it possible for this client to start a DPS NX agent */ XDPSNXSetClientArg(XDPSNX_AUTO_LAUNCH, (void *)True); #else NSLog (@"DPS extension not in server!"); exit (1); #endif } /* Create a GC for the initial window */ values.foreground = ((RContext *)context)->black; values.background = ((RContext *)context)->white; values.function = GXcopy; values.plane_mask = AllPlanes; values.clip_mask = None; valuemask = (GCFunction | GCPlaneMask | GCClipMask | GCForeground|GCBackground); ((RContext *)context)->copy_gc = XCreateGC(XDPY, XDRW, valuemask, &values); /* Create the context if need be */ if (!dps_context) { /* Pass None as the drawable argument; the program will execute correctly but will not render any text or graphics. */ dps_context = XDPSCreateSimpleContext(XDPY, None, ((RContext *)context)->copy_gc, 0, 0, text_proc, error_proc, NULL); if (dps_context == NULL) { NSLog(@"Could not connect to DPS\n"); NSLog(@"Trying again...\n"); dps_context = XDPSCreateSimpleContext(XDPY, None, ((RContext *)context)->copy_gc, 0, 0, text_proc, error_proc, NULL); if (dps_context == NULL) { NSLog(@"DPS is not available\n"); exit(1); } } // Make it the active context DPSSetContext(dps_context); XDPSRegisterContext(dps_context, NO); // Use pass-through event handling XDPSSetEventDelivery(XDPY, dps_event_pass_through); } PSWinitcontext (XGContextFromGC (((RContext *)context)->copy_gc), XDRW, 0, 0); PSWGetTransform (dps_context, ctm, invctm, &x, &y); PSWinitcontext (XGContextFromGC (((RContext *)context)->copy_gc), None, 0, 0); PSWRevision(&dps_revision); /* Check for operator extensions */ DPSWKnownExtensions(dps_context, &ext_flags); /* Check if composite-related extensions work */ /* FIXME: This crashes DPS on some implementations */ //DPSWWorkingExtensions(dps_context, &supported); supported = 0; if (supported == 0) ext_flags = (ext_flags & ~(COMPOSITE_EXT | ALPHAIMAGE_EXT | COMPOSITERECT_EXT | DISSOLVE_EXT | READIMAGE_EXT | SETALPHA_EXT)); /* FIXME: alphaimage and composite work badly in DGS 5.50. Perhaps when we find a version that works we can put an additional test here. For now, just turn them off. */ ext_flags = (ext_flags & ~(COMPOSITE_EXT | ALPHAIMAGE_EXT | DISSOLVE_EXT)); NSDebugLLog(@"NSDPSContext", @"Using DPS Revision: %d\n", dps_revision); NSDebugLLog(@"NSDPSContext", @"DPS Default Matrix: [%f %f %f %f %f %f]\n", ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); NSDebugLLog(@"NSDPSContext", @"DPS Extensions flags: %d\n", ext_flags); if ([[NSUserDefaults standardUserDefaults] boolForKey: @"DPSDefaultMatrix"] == NO) { NSDebugLog(@"Reseting default matrix\n"); ctm[0] /= fabs(ctm[0]); ctm[3] /= fabs(ctm[3]); PSWSetMatrix(ctm); } } - (void)createTextContext { if (dps_context) return; dps_context = DPSCreateTextContext(text_proc, error_proc); if (dps_context == NULL) { NSLog(@"Could not create DPS text context"); return; } } - (void) flushGraphics { DPSFlushContext(dps_context); XFlush([(XGServer *)server xDisplay]); } - (void) _localTransform: (float *)local_ctm inverse: (float *)local_inv offset: (NSPoint *)offset { int x, y; if (local_ctm == NULL || local_inv == NULL) return; PSWGetTransform (dps_context, local_ctm, local_inv, &x, &y); if (offset) { offset->x = x; offset->y = y; } } - (NSPoint)userPointFromXPoint:(NSPoint)xPoint { float lctm[6], linv[6]; NSPoint offset, userPoint; [self _localTransform: lctm inverse: linv offset: &offset]; //xPoint.x -= offset.x; //xPoint.y -= offset.y; userPoint.x = linv[A_COEFF] * xPoint.x + linv[C_COEFF] * xPoint.y + linv[TX_CONS]; userPoint.y = linv[B_COEFF] * xPoint.x + linv[D_COEFF] * xPoint.y + linv[TY_CONS]; return userPoint; } - (NSPoint)XPointFromUserPoint:(NSPoint)userPoint { float lctm[6], linv[6]; NSPoint offset, xPoint; [self _localTransform: lctm inverse: linv offset: &offset]; xPoint.x = lctm[A_COEFF] * userPoint.x + lctm[C_COEFF] * userPoint.y + lctm[TX_CONS] + offset.x; xPoint.y = lctm[B_COEFF] * userPoint.x + lctm[D_COEFF] * userPoint.y + lctm[TY_CONS] + offset.y; xPoint.x = floor (xPoint.x); xPoint.y = floor (xPoint.y); NSDebugLLog(@"CTM", @"Matrix [%f,%f,%f,%f,%f,%f] (%f,%f)\n", lctm[A_COEFF], lctm[B_COEFF], lctm[C_COEFF], lctm[D_COEFF], lctm[TX_CONS], lctm[TY_CONS], offset.x, offset.y); return xPoint; } - (NSRect)userRectFromXRect:(NSRect)xrect { float lctm[6], linv[6]; float x, y, w, h; [self _localTransform: lctm inverse: linv offset: NULL]; x = linv[A_COEFF] * NSMinX(xrect) + linv[C_COEFF] * NSMinY(xrect) + linv[TX_CONS]; y = linv[B_COEFF] * NSMinX(xrect) + linv[D_COEFF] * NSMinY(xrect) + linv[TY_CONS]; w = linv[A_COEFF] * NSWidth(xrect) + linv[C_COEFF] * NSHeight(xrect); h = linv[B_COEFF] * NSWidth(xrect) + linv[D_COEFF] * NSHeight(xrect); if (h < 0) y -= h; h = fabs(h); if (w < 0) x -= w; w = fabs(w); return NSMakeRect(x, y, w, h); } - (NSRect)XRectFromUserRect:(NSRect)urect { NSPoint offset; float lctm[6], linv[6]; float x, y, w, h; [self _localTransform: lctm inverse: linv offset: &offset]; x = lctm[A_COEFF] * NSMinX(urect) + lctm[C_COEFF] * NSMinY(urect) + lctm[TX_CONS] + offset.x; y = lctm[B_COEFF] * NSMinX(urect) + lctm[D_COEFF] * NSMinY(urect) + lctm[TY_CONS] + offset.y; w = lctm[A_COEFF] * NSWidth(urect) + lctm[C_COEFF] * NSHeight(urect); h = lctm[B_COEFF] * NSWidth(urect) + lctm[D_COEFF] * NSHeight(urect); NSDebugLLog(@"CTM", @"Matrix [%f,%f,%f,%f,%f,%f] (%f,%f)\n", lctm[A_COEFF], lctm[B_COEFF], lctm[C_COEFF], lctm[D_COEFF], lctm[TX_CONS], lctm[TY_CONS], offset.x, offset.y); if (h < 0) y += h; h = fabs(floor(h)); if (w < 0) x += w; w = fabs(floor(w)); x = floor(x); y = floor(y); return NSMakeRect(x, y, w, h); } - (op_extensions_t) operatorExtensions { return ext_flags; } @end @implementation NSDPSContext (NSGraphics) /* Optimized drawing functions */ - (void) NSRectFillList: (const NSRect *)rects : (int) count { int i; float rectvals[count*4]; if (count*4 > 65536) { NSLog(@"DPS Rendering Error: RectFillList with > 16384 rects"); return; } for (i = 0; i < count; i++) { rectvals[i*4 ] = NSMinX(rects[i]); rectvals[i*4 + 1] = NSMinY(rects[i]); rectvals[i*4 + 2] = NSWidth(rects[i]); rectvals[i*4 + 3] = NSHeight(rects[i]); } PSWRectFillList(rectvals, count*4); } - (void) NSRectFillListWithGrays: (const NSRect *)rects : (const float *)grays :(int) count { #if 1 int i; float rectvals[count*5]; if (count*5 > 65536) { NSLog(@"DPS Rendering Error: RectFillListGray with > 13107 rects"); return; } for (i = 0; i < count; i++) { rectvals[i*5 ] = NSMinX(rects[i]); rectvals[i*5 + 1] = NSMinY(rects[i]); rectvals[i*5 + 2] = NSWidth(rects[i]); rectvals[i*5 + 3] = NSHeight(rects[i]); rectvals[i*5 + 4] = grays[i]; } PSWRectFillListGray(rectvals, count*5); #else int i, last_gray, tcount; PSsetgray(grays[0]); last_gray = grays[0]; tcount = 0; for (i = 0; i < count; i++) { if (grays[i] != last_gray) { NSRectFillList(&rects[i-tcount], tcount); tcount = 0; PSsetgray(grays[i]); last_gray = grays[i]; } else tcount++; } #endif } - (void) NSDottedFrameRect: (const NSRect) aRect { PSWDottedFrameRect (aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height); } - (void) NSFrameRect: (const NSRect) aRect { PSWFrameRect (aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height); } - (void) NSFrameRectWithWidth: (const NSRect) aRect : (float) frameWidth { PSWFrameRectWithWidth (aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height, frameWidth); } // // Read the Color at a Screen Position // - (NSColor *) NSReadPixel: (NSPoint) location { return nil; } @end gnustep-back-0.29.0/Source/xdps/NSDPSContextOps.m000066400000000000000000000672771404163720200215210ustar00rootroot00000000000000/* NSDPSContextOps - Translate method calls to PS ops. Copyright (C) 1999 Free Software Foundation, Inc. Written by: Adam Fedor Date: Apr 1999 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #ifdef HAVE_WRASTER_H #include "wraster.h" #else #include "x11/wraster.h" #endif #define BOOL XWINDOWSBOOL #include #include #undef BOOL #include #include #include #include "x11/XGServerWindow.h" #include "xdps/NSDPSContext.h" #include "AppKit/NSFont.h" #include "extensions.h" #include "fonts.h" #include "general.h" #define XDPY (((RContext *)context)->dpy) #define XSCR (((RContext *)context)->screen_number) @interface NSDPSContext(PrivateOps) - (void)DPSundefineuserobject: (int)index; @end @implementation NSDPSContext (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ - (void)DPScurrentblackgeneration { DPScurrentblackgeneration(dps_context); } - (void)DPScurrentcmykcolor: (float *)c : (float *)m : (float *)y : (float *)k { DPScurrentcmykcolor(dps_context, c, m, y, k); } - (void)DPScurrentcolorscreen { DPScurrentcolorscreen(dps_context); } - (void)DPScurrentcolortransfer { DPScurrentcolortransfer(dps_context); } - (void)DPScurrentundercolorremoval { DPScurrentundercolorremoval(dps_context); } - (void)DPSsetblackgeneration { DPSsetblackgeneration(dps_context); } - (void)DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k { DPSsetcmykcolor(dps_context, c, m, y, k); } - (void)DPSsetcolorscreen { DPSsetcolorscreen(dps_context); } - (void)DPSsetcolortransfer { DPSsetcolortransfer(dps_context); } - (void)DPSsetundercolorremoval { DPSsetundercolorremoval(dps_context); } /* ----------------------------------------------------------------------- */ /* Data operations */ /* ----------------------------------------------------------------------- */ - (void)DPSclear { DPSclear(dps_context); } - (void)DPScleartomark { DPScleartomark(dps_context); } - (void)DPScopy: (int)n { DPScopy(dps_context, n); } - (void)DPScount: (int *)n { DPScount(dps_context, n); } - (void)DPScounttomark: (int *)n { DPScounttomark(dps_context, n); } - (void)DPSdup { DPSdup(dps_context); } - (void)DPSexch { DPSexch(dps_context); } - (void)DPSexecstack { DPSexecstack(dps_context); } - (void)DPSget { DPSget(dps_context); } - (void)DPSindex: (int)i { DPSindex(dps_context, i); } - (void)DPSmark { DPSmark(dps_context); } - (void)DPSmatrix { DPSmatrix(dps_context); } - (void)DPSnull { DPSnull(dps_context); } - (void)DPSpop { DPSpop(dps_context); } - (void)DPSput { DPSput(dps_context); } - (void)DPSroll: (int)n : (int)j { DPSroll(dps_context, n, j); } /* ----------------------------------------------------------------------- */ /* Font operations */ /* ----------------------------------------------------------------------- */ - (void)DPSFontDirectory { DPSFontDirectory(dps_context); } - (void)DPSISOLatin1Encoding { DPSISOLatin1Encoding(dps_context); } - (void)DPSSharedFontDirectory { DPSSharedFontDirectory(dps_context); } - (void)DPSStandardEncoding { DPSStandardEncoding(dps_context); } - (void)DPScachestatus: (int *)bsize : (int *)bmax : (int *)msize { //PScachestatus(dps_context); } - (void)DPScurrentcacheparams { DPScurrentcacheparams(dps_context); } - (void)DPScurrentfont { DPScurrentfont(dps_context); } - (void)DPSdefinefont { DPSdefinefont(dps_context); } - (void)DPSfindfont: (const char *)name { DPSfindfont(dps_context, name); } - (void)DPSmakefont { DPSmakefont(dps_context); } - (void)DPSscalefont: (float)size { DPSscalefont(dps_context, size); } - (void)DPSselectfont: (const char *)name : (float)scale { DPSselectfont(dps_context, name, scale); } - (void)DPSsetcachedevice: (float)wx : (float)wy : (float)llx : (float)lly : (float)urx : (float)ury { DPSsetcachedevice(dps_context, wx, wy, llx, lly, urx, ury); } - (void)DPSsetcachelimit: (float)n { DPSsetcachelimit(dps_context, n); } - (void)DPSsetcacheparams { DPSsetcacheparams(dps_context); } - (void)DPSsetcharwidth: (float)wx : (float)wy { DPSsetcharwidth(dps_context, wx, wy); } - (void)DPSsetfont: (int)f { DPSsetfont(dps_context, f); } - (void)DPSundefinefont: (const char *)name { DPSundefinefont(dps_context, name); } - (void) GSSetFont: (NSFont*) font { NSString *fontName = [font fontName]; if ([[self focusView] isFlipped]) { float invmatrix[6]; memcpy(invmatrix, [font matrix], sizeof(invmatrix)); invmatrix[3] = -invmatrix[3]; PSWSetFont ([fontName cString], invmatrix); } else PSWSetFont ([fontName cString], [font matrix]); } /* ----------------------------------------------------------------------- */ /* System operations */ /* ----------------------------------------------------------------------- */ - (void)DPSrestore { DPSrestore(dps_context); } - (void)DPSsave { DPSsave(dps_context); } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - (void)DPSconcat: (const float *)m { DPSconcat(dps_context, m); } - (void)DPScurrentdash { DPScurrentdash(dps_context); } - (void)DPScurrentflat: (float *)flatness { DPScurrentflat(dps_context, flatness); } - (void)DPScurrentgray: (float *)gray { DPScurrentgray(dps_context, gray); } - (void)DPScurrenthalftone { DPScurrenthalftone(dps_context); } - (void)DPScurrenthalftonephase: (float *)x : (float *)y { DPScurrenthalftonephase(dps_context, x, y); } - (void)DPScurrenthsbcolor: (float *)h : (float *)s : (float *)b { DPScurrenthsbcolor(dps_context, h, s, b); } - (void)DPScurrentlinecap: (int *)linecap { DPScurrentlinecap(dps_context, linecap); } - (void)DPScurrentlinejoin: (int *)linejoin { DPScurrentlinejoin(dps_context, linejoin); } - (void)DPScurrentlinewidth: (float *)width { DPScurrentlinewidth(dps_context, width); } - (void)DPScurrentmatrix { DPScurrentmatrix(dps_context); } - (void)DPScurrentmiterlimit: (float *)limit { DPScurrentmiterlimit(dps_context, limit); } - (void)DPScurrentpoint: (float *)x : (float *)y { DPScurrentpoint(dps_context, x, y); } - (void)DPScurrentrgbcolor: (float *)r : (float *)g : (float *)b { DPScurrentrgbcolor(dps_context, r, g, b); } - (void)DPScurrentscreen { DPScurrentscreen(dps_context); } - (void)DPScurrentstrokeadjust: (int *)b { DPScurrentstrokeadjust(dps_context, b); } - (void)DPScurrenttransfer { DPScurrenttransfer(dps_context); } - (void)DPSdefaultmatrix { DPSdefaultmatrix(dps_context); } - (void)DPSgrestore { DPSgrestore(dps_context); } - (void)DPSgrestoreall { DPSgrestoreall(dps_context); } - (void)DPSgsave { DPSgsave(dps_context); } - (void)DPSinitgraphics { DPSinitgraphics(dps_context); } - (void)DPSinitmatrix { DPSinitmatrix(dps_context); /* This works around problems with non-"identity" matrices */ if ([[NSUserDefaults standardUserDefaults] boolForKey: @"DPSDefaultMatrix"] == NO) { float nctm[6]; NSDebugLog(@"Resetting default matrix\n"); nctm[0]=1; nctm[1]=0; nctm[2]=0; nctm[3]=-1; nctm[4]=0; nctm[5]=0; PSWSetMatrix(nctm); } } - (void)DPSrotate: (float)angle { DPSrotate(dps_context, angle); } - (void)DPSscale: (float)x : (float)y { DPSscale(dps_context, x, y); } - (void)DPSsetdash: (const float *)pat : (int)size : (float)offset { DPSsetdash(dps_context, pat, size, offset); } - (void)DPSsetflat: (float)flatness { DPSsetflat(dps_context, flatness); } - (void)DPSsetgray: (float)gray { DPSsetgray(dps_context, gray); } - (void)DPSsetgstate: (int)gst { DPSsetgstate(dps_context, gst); } - (void)DPSsethalftone { DPSsethalftone(dps_context); } - (void)DPSsethalftonephase: (float)x : (float)y { DPSsethalftonephase(dps_context, x, y); } - (void)DPSsethsbcolor: (float)h : (float)s : (float)b { DPSsethsbcolor(dps_context, h, s, b); } - (void)DPSsetlinecap: (int)linecap { DPSsetlinecap(dps_context, linecap); } - (void)DPSsetlinejoin: (int)linejoin { DPSsetlinejoin(dps_context, linejoin); } - (void)DPSsetlinewidth: (float)width { DPSsetlinewidth(dps_context, width); } - (void)DPSsetmatrix { DPSsetmatrix(dps_context); } - (void)DPSsetmiterlimit: (float)limit { DPSsetmiterlimit(dps_context, limit); } - (void)DPSsetrgbcolor: (float)r : (float)g : (float)b { DPSsetrgbcolor(dps_context, r, g, b); } - (void)DPSsetscreen { DPSsetscreen(dps_context); } - (void)DPSsetstrokeadjust: (int)b { DPSsetstrokeadjust(dps_context, b); } - (void)DPSsettransfer { DPSsettransfer(dps_context); } - (void)DPStranslate: (float)x : (float)y { DPStranslate(dps_context, x, y); } /* Should work the same as 'unique_index exch defineuserobject' */ - (int) GSDefineGState { return PSDefineAsUserObj(); } - (void) GSUndefineGState: (int)gst { [self DPSundefineuserobject: gst]; } /* Should work the same as 'currentgstate pop' */ - (void) GSReplaceGState: (int)gst { [self DPScurrentgstate: gst]; [self DPSpop]; } /* ----------------------------------------------------------------------- */ /* I/O operations */ /* ----------------------------------------------------------------------- */ - (void)DPSflush { DPSflush(dps_context); } /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ - (void)DPSconcatmatrix { DPSconcatmatrix(dps_context); } - (void)DPSdtransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { DPSdtransform(dps_context, x1, y1, x2, y2); } - (void)DPSidentmatrix { DPSidentmatrix(dps_context); } - (void)DPSidtransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { DPSidtransform(dps_context, x1, y1, x2, y2); } - (void)DPSinvertmatrix { DPSinvertmatrix(dps_context); } - (void)DPSitransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { DPSitransform(dps_context, x1, y1, x2, y2); } - (void)DPStransform: (float)x1 : (float)y1 : (float *)x2 : (float *)y2 { DPStransform(dps_context, x1, y1, x2, y2); } /* ----------------------------------------------------------------------- */ /* Opstack operations */ /* ----------------------------------------------------------------------- */ - (void)DPSdefineuserobject { DPSdefineuserobject(dps_context); } - (void)DPSexecuserobject: (int)index { DPSexecuserobject(dps_context, index); } - (void)DPSundefineuserobject: (int)index { DPSundefineuserobject(dps_context, index); } - (void)DPSgetboolean: (int *)it { DPSgetboolean(dps_context, it); } - (void)DPSgetchararray: (int)size : (char *)s { DPSgetchararray(dps_context, size, s); } - (void)DPSgetfloat: (float *)it { DPSgetfloat(dps_context, it); } - (void)DPSgetfloatarray: (int)size : (float *)a { DPSgetfloatarray(dps_context, size, a); } - (void)DPSgetint: (int *)it { DPSgetint(dps_context, it); } - (void)DPSgetintarray: (int)size : (int *)a { DPSgetintarray(dps_context, size, a); } - (void)DPSgetstring: (char *)s { DPSgetstring(dps_context, s); } - (void)DPSsendboolean: (int)it { DPSsendboolean(dps_context, it); } - (void)DPSsendchararray: (const char *)s : (int)size { DPSsendchararray(dps_context, s, size); } - (void)DPSsendfloat: (float)it { DPSsendfloat(dps_context, it); } - (void)DPSsendfloatarray: (const float *)a : (int)size { DPSsendfloatarray(dps_context, a, size); } - (void)DPSsendint: (int)it { DPSsendint(dps_context, it); } - (void)DPSsendintarray: (const int *)a : (int)size { DPSsendintarray(dps_context, a, size); } - (void)DPSsendstring: (const char *)s { DPSsendstring(dps_context, s); } /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ - (void)DPSashow: (float)x : (float)y : (const char *)s { DPSashow(dps_context, x, y, s); } - (void)DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char *)s { DPSawidthshow(dps_context, cx, cy, c, ax, ay, s); } - (void)DPScopypage { DPScopypage(dps_context); } - (void)DPSeofill { DPSeofill(dps_context); } - (void)DPSerasepage { DPSerasepage(dps_context); } - (void)DPSfill { DPSfill(dps_context); } - (void)DPSimage { DPSimage(dps_context); } - (void)DPSimagemask { DPSimagemask(dps_context); } - (void)DPScolorimage { DPScolorimage(dps_context); } - (void)DPSalphaimage { if (ext_flags & ALPHAIMAGE_EXT) PSWalphaimage(); else NSDebugLLog(@"NSDPSContext", @"DPS does not support alphaimage op\n"); } - (void)DPSkshow: (const char *)s { DPSkshow(dps_context, s); } - (void)DPSrectfill: (float)x : (float)y : (float)w : (float)h { DPSrectfill(dps_context, x, y, w, h); } - (void)DPSrectstroke: (float)x : (float)y : (float)w : (float)h { DPSrectstroke(dps_context, x, y, w, h); } - (void)DPSshow: (const char *)s { DPSshow(dps_context, s); } - (void)DPSshowpage { DPSshowpage(dps_context); } - (void)DPSstroke { DPSstroke(dps_context); } - (void)DPSstrokepath { DPSstrokepath(dps_context); } - (void)DPSueofill: (const char *)nums : (int)n : (const char *)ops : (int)l { DPSueofill(dps_context, nums, n, ops, l); } - (void)DPSufill: (const char *)nums : (int)n : (const char *)ops : (int)l { DPSufill(dps_context, nums, n, ops, l); } - (void)DPSustroke: (const char *)nums : (int)n : (const char *)ops : (int)l { DPSustroke(dps_context, nums, n, ops, l); } - (void)DPSustrokepath: (const char *)nums : (int)n : (const char *)ops : (int)l { DPSustrokepath(dps_context, nums, n, ops, l); } - (void)DPSwidthshow: (float)x : (float)y : (int)c : (const char *)s { DPSwidthshow(dps_context, x, y, c, s); } - (void)DPSxshow: (const char *)s : (const float *)numarray : (int)size { DPSxshow(dps_context, s, numarray, size); } - (void)DPSxyshow: (const char *)s : (const float *)numarray : (int)size { DPSxyshow(dps_context, s, numarray, size); } - (void)DPSyshow: (const char *)s : (const float *)numarray : (int)size { DPSyshow(dps_context, s, numarray, size); } /* ----------------------------------------------------------------------- */ /* Path operations */ /* ----------------------------------------------------------------------- */ - (void)DPSarc: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 { DPSarc(dps_context, x, y, r, angle1, angle2); } - (void)DPSarcn: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 { DPSarcn(dps_context, x, y, r, angle1, angle2); } - (void)DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r { DPSarct(dps_context, x1, y1, x2, y2, r); } - (void)DPSarcto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r : (float *)xt1 : (float *)yt1 : (float *)xt2 : (float *)yt2 { DPSarcto(dps_context, x1, y1, x2, y2, r, xt1, yt1, xt2, yt2); } - (void)DPScharpath: (const char *)s : (int)b { DPScharpath(dps_context, s, b); } - (void)DPSclip { DPSclip(dps_context); } - (void)DPSclippath { DPSclippath(dps_context); } - (void)DPSclosepath { DPSclosepath(dps_context); } - (void)DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 { DPScurveto(dps_context, x1, y1, x2, y2, x3, y3); } - (void)DPSeoclip { DPSeoclip(dps_context); } - (void)DPSeoviewclip { DPSeoviewclip(dps_context); } - (void)DPSflattenpath { DPSflattenpath(dps_context); } - (void)DPSinitclip { DPSinitclip(dps_context); } - (void)DPSinitviewclip { DPSinitviewclip(dps_context); } - (void)DPSlineto: (float)x : (float)y { DPSlineto(dps_context, x, y); } - (void)DPSmoveto: (float)x : (float)y { DPSmoveto(dps_context, x, y); } - (void)DPSnewpath { DPSnewpath(dps_context); } - (void)DPSpathbbox: (float *)llx : (float *)lly : (float *)urx : (float *)ury { DPSpathbbox(dps_context, llx, lly, urx, ury); } - (void)DPSpathforall { DPSpathforall(dps_context); } - (void)DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 { DPSrcurveto(dps_context, x1, y1, x2, y2, x3, y3); } - (void)DPSrectclip: (float)x : (float)y : (float)w : (float)h { DPSrectclip(dps_context, x, y, w, h); } - (void)DPSrectviewclip: (float)x : (float)y : (float)w : (float)h { DPSrectviewclip(dps_context, x, y, w, h); } - (void)DPSreversepath { DPSreversepath(dps_context); } - (void)DPSrlineto: (float)x : (float)y { DPSrlineto(dps_context, x, y); } - (void)DPSrmoveto: (float)x : (float)y { DPSrmoveto(dps_context, x, y); } - (void)DPSsetbbox: (float)llx : (float)lly : (float)urx : (float)ury { DPSsetbbox(dps_context, llx, lly, urx, ury); } - (void)DPSsetucacheparams { DPSsetucacheparams(dps_context); } - (void)DPSuappend: (const char *)nums : (int)n : (char *)ops : (int)l { DPSuappend(dps_context, nums, n, ops, l); } - (void)DPSucache { DPSucache(dps_context); } - (void)DPSucachestatus { DPSucachestatus(dps_context); } - (void)DPSupath: (int)b { DPSupath(dps_context, b); } - (void)DPSviewclip { DPSviewclip(dps_context); } - (void)DPSviewclippath { DPSviewclippath(dps_context); } /* ----------------------------------------------------------------------- */ /* X operations */ /* ----------------------------------------------------------------------- */ - (void)DPScurrentdrawingfunction: (int *)function { DPScurrentXdrawingfunction(dps_context, function); } - (void)DPScurrentgcdrawable: (void **)gc : (void **)draw : (int *)x : (int *)y { /* FIXME: This really can't work since this returns an XGContext not a GC */ DPScurrentXgcdrawable(dps_context, gc, (int *)draw, x, y); } - (void)DPScurrentgcdrawablecolor: (void **)gc : (void **)draw : (int *)x : (int *)y : (int *)colorInfo { /* FIXME: This really can't work since this returns an XGContext not a GC */ DPScurrentXgcdrawablecolor(dps_context, gc, (int *)draw, x, y, colorInfo); } - (void)DPScurrentoffset: (int *)x : (int *)y { DPScurrentXoffset(dps_context, x, y); } - (void)DPSsetdrawingfunction: (int)function { DPSsetXdrawingfunction(dps_context, function); } - (void)DPSsetoffset: (short int)x : (short int)y { DPSsetXoffset(dps_context, x, y); } - (void)DPSsetXrgbactual: (double)r : (double)g : (double)b : (int *)success { DPSsetXrgbactual(dps_context, r, g, b, success); } - (void)DPSsetgcdrawable: (void *)gc : (void *)draw : (int)x : (int)y { DPSsetXgcdrawable(dps_context, XGContextFromGC(gc), (int)draw, x, y); } - (void)DPSsetgcdrawablecolor: (void *)gc : (void *)draw : (int)x : (int)y : (const int *)colorInfo { DPSsetXgcdrawablecolor(dps_context, XGContextFromGC(gc), (int)draw, x, y, colorInfo); } /*-------------------------------------------------------------------------*/ /* Graphics Extension Ops */ /*-------------------------------------------------------------------------*/ - (void) _copyBits: (int) srcGstate : (NSRect) srcRect : (NSPoint) destPoint { XRectangle dst; XRectangle src; Drawable source, draw; NSWindow *window; gswindow_device_t *windev; window = [[self focusView] window]; if ([window gState] == 0) return; windev = [XGServer _windowWithTag: [window windowNumber]]; draw = (windev->buffer) ? windev->buffer : windev->ident; if (draw == 0) return; NSDebugLLog (@"CTM", @"Frame %@\n", NSStringFromRect(windev->xframe)); source = 0; if (srcGstate != 0) { int gc, x, y; PSgsave(); PSsetgstate(srcGstate); PScurrentXgcdrawable(&gc, (int *)(&source), &x, &y); if (source == 0) return; if (source == draw) { /* This probably shouldn't happen, It might come from a bug in DGS 0.5.x */ } NSDebugLLog (@"Copy", @"Orig %@\n", NSStringFromRect(srcRect)); srcRect = [self XRectFromUserRect: srcRect]; NSDebugLLog (@"Copy", @"XCoor %@\n", NSStringFromRect(srcRect)); PSgrestore(); } else { source = draw; srcRect = [self XRectFromUserRect: srcRect]; } NSDebugLLog (@"Copy", @"ODest %@\n", NSStringFromPoint(destPoint)); destPoint = [self XPointFromUserPoint: destPoint]; /* FIXME: Why is this needed? */ if (![[self focusView] isFlipped]) destPoint.y -= NSHeight(srcRect); NSDebugLLog (@"Copy", @"XDest %@\n", NSStringFromPoint(destPoint)); src.x = NSMinX(srcRect); src.y = NSMinY(srcRect); src.width = NSWidth(srcRect); src.height = NSHeight(srcRect); dst.x = destPoint.x; dst.y = destPoint.y; NSDebugLLog (@"NSWindow", @"Copying bitmap from (%d %d %d %d) to (%d %d)\n", src.x, src.y, src.width, src.height, dst.x, dst.y); [self wait]; XCopyArea([self xDisplay], source, draw, windev->gc, src.x, src.y, src.width, src.height, dst.x, dst.y); } - (void) DPScomposite: (float)x : (float)y : (float)w : (float)h : (int)gstateNum : (float)dx : (float)dy : (int)op { if (ext_flags & COMPOSITE_EXT) PSWcomposite(x, y, w, h, gstateNum, dx, dy, op); else { NSRect s = NSMakeRect(x, y, w, h); NSPoint d = NSMakePoint(dx, dy); NSDebugLLog(@"NSDPSContext", @"DPS does not support composite op\n"); [self wait]; [self _copyBits:gstateNum : s : d]; } } - (void) DPScompositerect: (float)x : (float)y : (float)w : (float)h : (int)op { if (ext_flags & COMPOSITERECT_EXT) PSWcompositerect(x, y, w, h, op); else { /* Try to emulate this */ float gray; XGCValues gcv; NSWindow *window; gswindow_device_t *windev; DPScurrentgray(dps_context, &gray); if (fabs(gray - 0.667) < .002) DPSsetgray(dps_context, 0.333); else DPSsetrgbcolor(dps_context, 0.121, 0.121, 0); switch (op) { case NSCompositeClear: gcv.function = GXclear; break; case NSCompositeCopy: gcv.function = GXcopy; break; case NSCompositeSourceOver: case NSCompositeHighlight: gcv.function = GXcopy; break; case NSCompositeSourceIn: gcv.function = GXcopy; break; case NSCompositeSourceOut: gcv.function = GXcopy; break; case NSCompositeSourceAtop: gcv.function = GXcopy; break; case NSCompositeDestinationOver: gcv.function = GXcopy; break; case NSCompositeDestinationIn: gcv.function = GXcopy; break; case NSCompositeDestinationOut: gcv.function = GXcopy; break; case NSCompositeDestinationAtop: gcv.function = GXcopy; break; case NSCompositeXOR: gcv.function = GXcopy; break; case NSCompositePlusDarker: gcv.function = GXcopy; break; case GSCompositeHighlight: gcv.function = GXxor; break; case NSCompositePlusLighter: gcv.function = GXcopy; break; default: gcv.function = GXcopy; break; } window = [[self focusView] window]; windev = [XGServer _windowWithTag: [window windowNumber]]; [self wait]; XChangeGC(XDPY, windev->gc, GCFunction, &gcv); DPSrectfill(dps_context, x, y, w, h); [window flushWindow]; gcv.function = GXcopy; XChangeGC(XDPY, windev->gc, GCFunction, &gcv); DPSsetgray(dps_context, gray); } } - (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h : (int)gstateNum : (float)dx : (float)dy : (float)delta { if (ext_flags & DISSOLVE_EXT) PSWdissolve(x, y, w, h, gstateNum, dx, dy, delta); else NSDebugLLog(@"NSDPSContext", @"DPS does not support dissolve op\n"); } - (void) DPSreadimage { if (ext_flags & READIMAGE_EXT) PSWreadimage(); else NSDebugLLog(@"NSDPSContext", @"DPS does not support readimage op\n"); } - (void) DPSsetalpha: (float)a { if (ext_flags & SETALPHA_EXT) PSWsetalpha(a); else NSDebugLLog(@"NSDPSContext", @"DPS does not support setalpha op\n"); } - (void) DPScurrentalpha: (float *)alpha { if (ext_flags & SETALPHA_EXT) PSWcurrentalpha(alpha); else NSDebugLLog(@"NSDPSContext", @"DPS does not support currentalpha op\n"); } - (void) DPSflushpage { if (ext_flags & FLUSHPAGE_EXT) PSWflushpage(); } /* ----------------------------------------------------------------------- */ /* Client functions */ /* ----------------------------------------------------------------------- */ - (void) DPSPrintf: (char *)fmt : (va_list)args { int count; char buf[1024]; count = vsnprintf(buf, 1024, fmt, args); DPSWriteData(dps_context, buf, MIN(1024, count)); } - (void) DPSWriteData: (char *)buf : (unsigned int)count { DPSWriteData(dps_context, buf, count); } // // Imaging Functions // - (void) NSDrawBitmap: (NSRect) rect : (int) pixelsWide : (int) pixelsHigh : (int) bitsPerSample : (int) samplesPerPixel : (int) bitsPerPixel : (int) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data { int bytes; int working_alphaimage; // FIXME #if 0 working_alphaimage = [self operatorExtensions] & ALPHAIMAGE_EXT; #else working_alphaimage = NO; #endif /* Save scaling */ PSmatrix(); PScurrentmatrix(); PSmoveto(NSMinX(rect), NSMinY(rect)); PSscale(NSWidth(rect), NSHeight(rect)); if (bitsPerSample == 0) bitsPerSample = 8; bytes = (bitsPerSample * pixelsWide * pixelsHigh + 7) / 8; if (bytes * samplesPerPixel != bytesPerRow * pixelsHigh) { NSLog(@"Image Rendering Error: Dodgy bytesPerRow value %d", bytesPerRow); NSLog(@" pixelsHigh=%d, bytes=%d, samplesPerPixel=%d", bytesPerRow, pixelsHigh, bytes); return; } // send the PostScript code if (hasAlpha && working_alphaimage == YES) { // FIXME NSLog(@"Alphaimage not implemented"); return; } else if (samplesPerPixel > 1) { if (isPlanar || (hasAlpha && (working_alphaimage == NO))) { if (bitsPerSample != 8) { NSLog(@"Image format conversion not supported for bps!=8"); return; } } PSWColorImageHeader(pixelsWide, pixelsHigh, bitsPerSample, hasAlpha?(samplesPerPixel-1):samplesPerPixel); } else PSWImageHeader(pixelsWide, pixelsHigh, bitsPerSample); // The context is now waiting for data on its standard input if (isPlanar || (hasAlpha && (working_alphaimage == NO))) { // We need to do a format conversion. // We do this on the fly, sending data to the context as soon as // it is computed. int i, j, spp, isAlpha, alpha; unsigned char val; isAlpha = hasAlpha && (working_alphaimage == NO); if (isAlpha) spp = samplesPerPixel - 1; else spp = samplesPerPixel; for (j=0; j Date: March 1996 This file is part of the GNUstep GUI X/DPS Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "xdps/NSDPSContext.h" @interface PXKEPSImageRep : NSEPSImageRep { } @end @implementation PXKEPSImageRep - (Class) classForCoder: aCoder { if ([self class] == [PXKEPSImageRep class]) return [super class]; return [self class]; } @end gnustep-back-0.29.0/Source/xdps/PXKFontManager.m000066400000000000000000000047401404163720200213510ustar00rootroot00000000000000/* PXKFontEnumerator.m NSFontManager helper for GNUstep GUI X/DPS Backend Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: February 1997 A completely rewritten version of the original source of Scott Christley. This file is part of the GNUstep GUI X/DPS Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "config.h" #include #include #include #include #include #include #include "xdps/NSDPSContext.h" #include "AFMFileFontInfo.h" #include "general.h" #include "fonts.h" @implementation PXKFontEnumerator /* It would be probably more portable to use the standard PS resource enumerator functions, but the makepsres utility does not understand how DGS organize its resources. So we use the below techniques to identify the font and AFM files. For Adobe DPS implementations I use the PS resources because it's more portable. */ - (void)enumerateFontsAndFamilies { int count, length; DPSContext ctxt; NSArray *fontList; NSMutableData *data; ctxt = [(NSDPSContext *)GSCurrentContext() xDPSContext]; PSWEnumerateFonts(ctxt, "*", &count, &length); NSDebugLLog(@"Fonts", @"FontManager found %d font names\n", count); data = [NSMutableData dataWithLength: count+length]; PSWGetFontList(ctxt, count+length, (char *)[data mutableBytes]); fontList = [[[NSString alloc] initWithData: data encoding: NSASCIIStringEncoding] componentsSeparatedByString: @" "]; allFontNames = RETAIN(fontList); // FIXME Enumeration of font families is missing allFontFamilies = nil; } @end gnustep-back-0.29.0/Source/xdps/drawingfuncs.psw000066400000000000000000000041721404163720200216330ustar00rootroot00000000000000/* drawingfuncs.psw Support functions for the C drawing functions defined in OpenStep. Copyright (C) 1996,2001 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: January 1997 Rewritten: Adam Fedor Date: May 2001 This file is part of the GNUstep GUI X/DPS Library. 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 3 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include defineps PSWFrameRectWithWidth (float x, y, w, h, linewidth) linewidth setlinewidth 0 setgray x y w h rectstroke endps defineps PSWFrameRect (float x, y, w, h) 1 setlinewidth 0 setgray x y w h rectstroke endps defineps PSWDottedFrameRect (float x, y, w, h) 1 setlinewidth [1] 0 setdash 0 setgray x y w h rectstroke endps /* Optimized drawing of a list of rectangles. The list consists of sucessive 4-tuples of rectangle values x, y, w, and h. Note that the number of rectangles cannot exceed 65536/4 = 16384 */ defineps PSWRectFillList (float numstring rectvals[x]; int x) rectvals rectfill endps /* Optimized drawing of a list of rectangles with different gray values. The list consists of sucessive 5-tuples of rectangle values x, y, w, h, and gray. Note that the number of rectangles cannot exceed 65536/5 = 13107 */ defineps PSWRectFillListGray (float rectvals[x]; int x) mark rectvals {counttomark 4 gt {setgray rectfill} if} forall pop endps gnustep-back-0.29.0/Source/xdps/extensions.psw000066400000000000000000000051411404163720200213350ustar00rootroot00000000000000/* general.psw Copyright (C) 2000 Free Software Foundation, Inc. Author: Adam Fedor Date: May 2000 This file is part of the GNUstep GUI X/DPS Library. 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 3 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include defineps DPSWKnownExtensions (DPSContext ctxt | int *extflag) 0 systemdict /alphaimage known {1 add} if systemdict /composite known {2 add} if systemdict /compositerect known {4 add} if systemdict /dissolve known {8 add} if systemdict /readimage known {16 add} if systemdict /setalpha known {32 add} if systemdict /flushpage known {64 add} if extflag endps defineps DPSWWorkingExtensions(DPSContext ctxt | boolean *supported) { 0 0 10 10 null 10 10 2 composite } stopped not supported endps /* Define our own versions of NeXT extension wrappers since they aren't neccesarily in the DPS library */ defineps PSWalphaimage () alphaimage endps defineps PSWcomposite (float x, y, w, h; int gstateNum; float dx, dy; int op) x y w h gstateNum dup 0 eq {null} {execuserobject} ifelse dx dy op composite endps defineps PSWcompositerect (float x, y, w, h; int op) x y w h op compositerect endps defineps PSWdissolve (float x, y, w, h; int gstateNum; float dx, dy, delta) x y w h gstateNum dup 0 eq {null} {execuserobject} ifelse dx dy delta dissolve endps defineps PSWreadimage () readimage endps defineps PSWsetalpha (float alpha) alpha setalpha endps defineps PSWcurrentalpha (| float *alpha) currentalpha alpha endps defineps PSWflushpage () flushpage endps /* Image helper wrappers */ defineps PSWColorImageHeader(int width, height, bps, spp) width height bps [width 0 0 height neg 0 height] currentfile false spp colorimage endps defineps PSWImageHeader(int width, height, bps) width height bps [width 0 0 height neg 0 height] currentfile image endps gnustep-back-0.29.0/Source/xdps/fonts.psw000066400000000000000000000126421404163720200202730ustar00rootroot00000000000000/* fonts.psw Support functions to determine the installed fonts. Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: February 1997 This file is part of the GNUstep GUI X/DPS Library. 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 3 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* These next two procedues are meant to be used together. They find all font names and then fills an array with those names */ defineps PSWEnumerateFonts(DPSContext ctxt; char *pattern | int *count; int *total_length) 0 0 % count total_length (pattern) { dup length string cvs % fonts count total_length newfont 3 1 roll % fonts newfont count total_length exch 1 add exch % fonts newfont newcount total_length 2 index length add % fonts newfont newcount newtotal_length } 256 string /Font resourceforall total_length dup count % fonts count endps defineps PSWGetFontList(DPSContext ctxt; int length | char fontNames[length]) % fonts count { fontNames ( ) fontNames } repeat endps /* The mapping between font names and file name is DPS dependent. On NeXTSTEP for example (and on systems conforming to red book), you can find out the filename where a font is defined like below: /Font /Category findresource begin /Times-Roman 1024 string ResourceFileName end This pushes on the stack %font%Times-Roman. The program should search in the standard places a directory called `Times-Roman.font' to determine the definition of the font. */ defineps PSWGetFontFile(DPSContext ctxt; char *fontn | char *filen) /Font /Category findresource begin /fontn 1024 string ResourceFileName end filen endps /* Procedure for finding font file with GS. */ defineps PSWGSFontFile(DPSContext ctxt; char *fontn | char *filen) userdict /Fontmap get % Get the Fontmap dictionary /fontn get % Lookup the desired font aload pop % Filename is stored in an array dup type (test string) type ne % If fontn was just an alias { % Get the real file name userdict /Fontmap get exch get aload pop } if filen endps /* PSWFontNames() puts on the PS stack a sequence of two elements pairs and returns the number of the total elements. Each pair of elements consists from the name of the font and either the filename where the font is defined or the name of the font whose alias is. To get each pair of elements call the PSWGetNextFont() function. Note: This procedure depends on DGS. The function to be used on a DPS system conforming to red book should use the following statements to find out the font names: /fonts [ (%font%*) {100 string copy} 100 string filenameforall ] def The mapping between font names and file name is DPS dependent. On NeXTSTEP for example (and on systems conforming to red book), you can find out the filename where a font is defined like below: /Font /Category findresource begin /Times-Roman 1024 string ResourceFileName end This pushes on the stack %font%Times-Roman. The program should search in the standard places a directory called `Times-Roman.font' to determine the definition of the font. Maybe we should place in Postscript all the DPS dependencies and present to the program the same interface. */ defineps PSWFontNames (| int* noOfFonts) mark /temp 1024 string def userdict /Fontmap get { /filename exch % In 3.53 the filename was passed as name; in 4.03 it is passed % as an array that contains the file name dup type /arraytype eq {aload pop} if temp cvs dup length string copy def /fontname exch temp cvs dup length string copy def fontname filename } forall counttomark 2 idiv noOfFonts endps defineps PSWGetFontsArray (| char *fontname, *fileOrFont) fileOrFont fontname endps /* PSWCompleteFilename() returns the complete path to the filename passed as argument. The file is searched in the standard DGS places. */ defineps PSWCompleteFilename (char* filename; | boolean *found; char* completePath) (filename) findlibfile {closefile completePath true found} {false found pop} ifelse endps defineps PSWGetFontAndType (| char* fontname; int* fonttype) fontname fonttype endps /* Set the current font */ defineps PSWSetFont (char* font; float fontMatrix[6]) (font) findfont fontMatrix makefont setfont endps /* Get the font type */ defineps PSWGetFontType (char* font; | int* fontType) (font) findfont /FontType get fontType endps gnustep-back-0.29.0/Source/xdps/general.psw000066400000000000000000000033671404163720200205630ustar00rootroot00000000000000/* general.psw Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1997 This file is part of the GNUstep GUI X/DPS Library. 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 3 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Initialize the graphic context */ defineps PSWinitcontext (int gc, drawable, x, y) gc drawable x y setXgcdrawable initmatrix initclip gsave initgraphics currenttransfer grestore settransfer endps defineps PSWGetTransform (DPSContext ctxt | float ctm[6], invctm[6]; int *XOffset, *YOffset) matrix currentmatrix dup ctm matrix invertmatrix invctm currentXoffset YOffset XOffset endps defineps PSWConcatMatrix (float matrix[6]) matrix concat endps defineps PSWSetMatrix (float matrix[6]) matrix setmatrix endps defineps PSWVersion (| char* versionstr) version versionstr endps defineps PSWRevision (| int* revstr) revision revstr endps defineps PSWProduct (| char* productname) product productname endps gnustep-back-0.29.0/Source/xdps/parseAFM.c000066400000000000000000001204471404163720200202140ustar00rootroot00000000000000/* * parseAFM.c,v * * (c) Copyright 1991-1994 Adobe Systems Incorporated. * All rights reserved. * * Permission to use, copy, modify, distribute, and sublicense this software * and its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notices appear in all copies and that * both those copyright notices and this permission notice appear in * supporting documentation and that the name of Adobe Systems Incorporated * not be used in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. No trademark license * to use the Adobe trademarks is hereby granted. If the Adobe trademark * "Display PostScript"(tm) is used to describe this software, its * functionality or for any other purpose, such use shall be limited to a * statement that this software works in conjunction with the Display * PostScript system. Proper trademark attribution to reflect Adobe's * ownership of the trademark shall be given whenever any such reference to * the Display PostScript system is made. * * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE. * * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems * Incorporated which may be registered in certain jurisdictions * * Author: Adobe Systems Incorporated */ #include #include #include #include #include #include #include "parseAFM.h" #define TRUE 1 #define FALSE 0 #define EOL '\n' /* end-of-line indicator */ #define MAX_NAME 4096 /* max length for identifiers */ #define BOOL int #define FLAGS int #define lineterm '\n' /* line terminating character */ #define normalEOF 1 /* return code from parsing routines used only */ /* in this module */ #define Space "space" /* used in string comparison to look for the width */ /* of the space character to init the widths array */ #define False "false" /* used in string comparison to check the value of */ /* boolean keys (e.g. IsFixedPitch) */ #define MATCH(A,B) (strncmp((A),(B), MAX_NAME) == 0) /*************************** GLOBALS ***********************/ static char *ident = NULL; /* storage buffer for keywords */ /* "shorts" for fast case statement * The values of each of these enumerated items correspond to an entry in the * table of strings defined below. Therefore, if you add a new string as * new keyword into the keyStrings table, you must also add a corresponding * parseKey AND it MUST be in the same position! * * IMPORTANT: since the sorting algorithm is a binary search, the strings of * keywords must be placed in lexicographical order, below. [Therefore, the * enumerated items are not necessarily in lexicographical order, depending * on the name chosen. BUT, they must be placed in the same position as the * corresponding key string.] The NOPE shall remain in the last position, * since it does not correspond to any key string, and it is used in the * "recognize" procedure to calculate how many possible keys there are. */ enum parseKey { ASCENDER = 0, CHARBBOX, CODE, COMPCHAR, CAPHEIGHT, COMMENT, DESCENDER, ENCODINGSCHEME, ENDCHARMETRICS, ENDCOMPOSITES, ENDFONTMETRICS, ENDKERNDATA, ENDKERNPAIRS, ENDTRACKKERN, FAMILYNAME, FONTBBOX, FONTNAME, FULLNAME, ISFIXEDPITCH, ITALICANGLE, KERNPAIR, KERNPAIRXAMT, LIGATURE, CHARNAME, NOTICE, COMPCHARPIECE, STARTCHARMETRICS, STARTCOMPOSITES, STARTFONTMETRICS, STARTKERNDATA, STARTKERNPAIRS, STARTTRACKKERN, TRACKKERN, UNDERLINEPOSITION, UNDERLINETHICKNESS, VERSION, XYWIDTH, XWIDTH, WEIGHT, XHEIGHT, NOPE }; /* keywords for the system: * This a table of all of the current strings that are vaild AFM keys. * Each entry can be referenced by the appropriate parseKey value (an * enumerated data type defined above). If you add a new keyword here, * a corresponding parseKey MUST be added to the enumerated data type * defined above, AND it MUST be added in the same position as the * string is in this table. * * IMPORTANT: since the sorting algorithm is a binary search, the keywords * must be placed in lexicographical order. And, NULL should remain at the * end. */ static char *keyStrings[] = { "Ascender", "B", "C", "CC", "CapHeight", "Comment", "Descender", "EncodingScheme", "EndCharMetrics", "EndComposites", "EndFontMetrics", "EndKernData", "EndKernPairs", "EndTrackKern", "FamilyName", "FontBBox", "FontName", "FullName", "IsFixedPitch", "ItalicAngle", "KP", "KPX", "L", "N", "Notice", "PCC", "StartCharMetrics", "StartComposites", "StartFontMetrics", "StartKernData", "StartKernPairs", "StartTrackKern", "TrackKern", "UnderlinePosition", "UnderlineThickness", "Version", "W", "WX", "Weight", "XHeight", NULL }; /*************************** PARSING ROUTINES **************/ /*************************** token *************************/ /* A "AFM File Conventions" tokenizer. That means that it will * return the next token delimited by white space. See also * the `linetoken' routine, which does a similar thing but * reads all tokens until the next end-of-line. */ static char *token(stream) FILE *stream; { int ch, idx; /* skip over white space */ while ((ch = fgetc(stream)) == ' ' || ch == lineterm || ch == '\r' || ch == ',' || ch == '\t' || ch == ';'); idx = 0; while (ch != EOF && ch != ' ' && ch != lineterm && ch != '\r' && ch != '\t' && ch != ':' && ch != ';') { ident[idx++] = ch; ch = fgetc(stream); } /* while */ if (ch == EOF && idx < 1) return ((char *)NULL); if (idx >= 1 && ch != ':' ) ungetc(ch, stream); if (idx < 1 ) ident[idx++] = ch; /* single-character token */ ident[idx] = 0; return(ident); /* returns pointer to the token */ } /* token */ /*************************** linetoken *************************/ /* "linetoken" will get read all tokens until the EOL character from * the given stream. This is used to get any arguments that can be * more than one word (like Comment lines and FullName). */ static char *linetoken(stream) FILE *stream; { int ch, idx; while ((ch = fgetc(stream)) == ' ' || ch == '\t' ); idx = 0; while (ch != EOF && ch != lineterm && ch != '\r') { ident[idx++] = ch; ch = fgetc(stream); } /* while */ ungetc(ch, stream); ident[idx] = 0; return(ident); /* returns pointer to the token */ } /* linetoken */ /*************************** recognize *************************/ /* This function tries to match a string to a known list of * valid AFM entries (check the keyStrings array above). * "ident" contains everything from white space through the * next space, tab, or ":" character. * * The algorithm is a standard Knuth binary search. */ static enum parseKey recognize(ident) register char *ident; { int lower = 0, upper = (int) NOPE, midpoint, cmpvalue; BOOL found = FALSE; while ((upper >= lower) && !found) { midpoint = (lower + upper)/2; if (keyStrings[midpoint] == NULL) break; cmpvalue = strncmp(ident, keyStrings[midpoint], MAX_NAME); if (cmpvalue == 0) found = TRUE; else if (cmpvalue < 0) upper = midpoint - 1; else lower = midpoint + 1; } /* while */ if (found) return (enum parseKey) midpoint; else return NOPE; } /* recognize */ /************************* parseGlobals *****************************/ /* This function is called by "parseFile". It will parse the AFM File * up to the "StartCharMetrics" keyword, which essentially marks the * end of the Global Font Information and the beginning of the character * metrics information. * * If the caller of "parseFile" specified that it wanted the Global * Font Information (as defined by the "AFM File Specification" * document), then that information will be stored in the returned * data structure. * * Any Global Font Information entries that are not found in a * given file, will have the usual default initialization value * for its type (i.e. entries of type int will be 0, etc). * * This function returns an error code specifying whether there was * a premature EOF or a parsing error. This return value is used by * parseFile to determine if there is more file to parse. */ static BOOL parseGlobals(fp, gfi) FILE *fp; register AFMGlobalFontInfo *gfi; { BOOL cont = TRUE, save = (gfi != NULL); int error = afm_ok; register char *keyword; while (cont) { keyword = token(fp); if (keyword == NULL) /* Have reached an early and unexpected EOF. */ /* Set flag and stop parsing */ { error = afm_earlyEOF; break; /* get out of loop */ } if (!save) /* get tokens until the end of the Global Font info section */ /* without saving any of the data */ switch (recognize(keyword)) { case STARTCHARMETRICS: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; default: break; } /* switch */ else /* otherwise parse entire global font info section, */ /* saving the data */ switch(recognize(keyword)) { case STARTFONTMETRICS: keyword = token(fp); gfi->afmVersion = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->afmVersion, keyword); break; case COMMENT: keyword = linetoken(fp); break; case FONTNAME: keyword = token(fp); gfi->fontName = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->fontName, keyword); break; case ENCODINGSCHEME: keyword = token(fp); gfi->encodingScheme = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->encodingScheme, keyword); break; case FULLNAME: keyword = linetoken(fp); gfi->fullName = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->fullName, keyword); break; case FAMILYNAME: keyword = linetoken(fp); gfi->familyName = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->familyName, keyword); break; case WEIGHT: keyword = token(fp); gfi->weight = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->weight, keyword); break; case ITALICANGLE: keyword = token(fp); gfi->italicAngle = atof(keyword); if (errno == ERANGE) error = afm_parseError; break; case ISFIXEDPITCH: keyword = token(fp); if (MATCH(keyword, False)) gfi->isFixedPitch = 0; else gfi->isFixedPitch = 1; break; case UNDERLINEPOSITION: keyword = token(fp); gfi->underlinePosition = atoi(keyword); break; case UNDERLINETHICKNESS: keyword = token(fp); gfi->underlineThickness = atoi(keyword); break; case VERSION: keyword = token(fp); gfi->version = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->version, keyword); break; case NOTICE: keyword = linetoken(fp); gfi->notice = (char *) malloc(strlen(keyword) + 1); strcpy(gfi->notice, keyword); break; case FONTBBOX: keyword = token(fp); gfi->fontBBox.llx = atoi(keyword); keyword = token(fp); gfi->fontBBox.lly = atoi(keyword); keyword = token(fp); gfi->fontBBox.urx = atoi(keyword); keyword = token(fp); gfi->fontBBox.ury = atoi(keyword); break; case CAPHEIGHT: keyword = token(fp); gfi->capHeight = atoi(keyword); break; case XHEIGHT: keyword = token(fp); gfi->xHeight = atoi(keyword); break; case DESCENDER: keyword = token(fp); gfi->descender = atoi(keyword); break; case ASCENDER: keyword = token(fp); gfi->ascender = atoi(keyword); break; case STARTCHARMETRICS: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; case NOPE: default: error = afm_parseError; break; } /* switch */ } /* while */ return(error); } /* parseGlobals */ /************************* parseCharWidths **************************/ /* This function is called by "parseFile". It will parse the AFM File * up to the "EndCharMetrics" keyword. It will save the character * width info (as opposed to all of the character metric information) * if requested by the caller of parseFile. Otherwise, it will just * parse through the section without saving any information. * * If data is to be saved, parseCharWidths is passed in a pointer * to an array of widths that has already been initialized by the * standard value for unmapped character codes. This function parses * the Character Metrics section only storing the width information * for the encoded characters into the array using the character code * as the index into that array. * * This function returns an error code specifying whether there was * a premature EOF or a parsing error. This return value is used by * parseFile to determine if there is more file to parse. */ static int parseCharWidths(fp, cwi) FILE *fp; register float *cwi; { BOOL cont = TRUE, save = (cwi != NULL); int pos = 0, error = afm_ok; register char *keyword; while (cont) { keyword = token(fp); /* Have reached an early and unexpected EOF. */ /* Set flag and stop parsing */ if (keyword == NULL) { error = afm_earlyEOF; break; /* get out of loop */ } if (!save) /* get tokens until the end of the Char Metrics section without */ /* saving any of the data*/ switch (recognize(keyword)) { case ENDCHARMETRICS: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; default: break; } /* switch */ else /* otherwise parse entire char metrics section, saving */ /* only the char x-width info */ switch(recognize(keyword)) { case COMMENT: keyword = linetoken(fp); break; case CODE: keyword = token(fp); pos = atoi(keyword); break; case XYWIDTH: /* PROBLEM: Should be no Y-WIDTH when doing "quick & dirty" */ keyword = token(fp); keyword = token(fp); /* eat values */ error = afm_parseError; break; case XWIDTH: keyword = token(fp); if (pos >= 0) /* ignore unmapped chars */ cwi[pos] = atof(keyword); break; case ENDCHARMETRICS: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; case CHARNAME: /* eat values (so doesn't cause parseError) */ keyword = token(fp); break; case CHARBBOX: keyword = token(fp); keyword = token(fp); keyword = token(fp); keyword = token(fp); break; case LIGATURE: keyword = token(fp); keyword = token(fp); break; case NOPE: default: error = afm_parseError; break; } /* switch */ } /* while */ return(error); } /* parseCharWidths */ /************************* parseCharMetrics ************************/ /* This function is called by parseFile if the caller of parseFile * requested that all character metric information be saved * (as opposed to only the character width information). * * parseCharMetrics is passed in a pointer to an array of records * to hold information on a per character basis. This function * parses the Character Metrics section storing all character * metric information for the ALL characters (mapped and unmapped) * into the array. * * This function returns an error code specifying whether there was * a premature EOF or a parsing error. This return value is used by * parseFile to determine if there is more file to parse. */ static int parseCharMetrics(fp, fi) FILE *fp; register AFMFontInfo *fi; { BOOL cont = TRUE, firstTime = TRUE; int error = afm_ok, count = 0; register AFMCharMetricInfo *temp = fi->cmi; register char *keyword; while (cont) { keyword = token(fp); if (keyword == NULL) { error = afm_earlyEOF; break; /* get out of loop */ } switch(recognize(keyword)) { case COMMENT: keyword = linetoken(fp); break; case CODE: if (count < fi->numOfChars) { if (firstTime) firstTime = FALSE; else temp++; temp->code = atoi(token(fp)); count++; } else { error = afm_parseError; cont = FALSE; } break; case XYWIDTH: temp->wx = atoi(token(fp)); temp->wy = atoi(token(fp)); break; case XWIDTH: temp->wx = atoi(token(fp)); break; case CHARNAME: keyword = token(fp); temp->name = (char *) malloc(strlen(keyword) + 1); strcpy(temp->name, keyword); break; case CHARBBOX: temp->charBBox.llx = atoi(token(fp)); temp->charBBox.lly = atoi(token(fp)); temp->charBBox.urx = atoi(token(fp)); temp->charBBox.ury = atoi(token(fp)); break; case LIGATURE: { AFMLigature **tail = &(temp->ligs); AFMLigature *node = *tail; if (*tail != NULL) { while (node->next != NULL) node = node->next; tail = &(node->next); } *tail = (AFMLigature *) calloc(1, sizeof(AFMLigature)); keyword = token(fp); (*tail)->succ = (char *) malloc(strlen(keyword) + 1); strcpy((*tail)->succ, keyword); keyword = token(fp); (*tail)->lig = (char *) malloc(strlen(keyword) + 1); strcpy((*tail)->lig, keyword); break; } case ENDCHARMETRICS: cont = FALSE;; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; case NOPE: default: error = afm_parseError; break; } /* switch */ } /* while */ if ((error == afm_ok) && (count != fi->numOfChars)) error = afm_parseError; return(error); } /* parseCharMetrics */ /************************* parseTrackKernData ***********************/ /* This function is called by "parseFile". It will parse the AFM File * up to the "EndTrackKern" or "EndKernData" keywords. It will save the * track kerning data if requested by the caller of parseFile. * * parseTrackKernData is passed in a pointer to the FontInfo record. * If data is to be saved, the FontInfo record will already contain * a valid pointer to storage for the track kerning data. * * This function returns an error code specifying whether there was * a premature EOF or a parsing error. This return value is used by * parseFile to determine if there is more file to parse. */ static int parseTrackKernData(fp, fi) FILE *fp; register AFMFontInfo *fi; { BOOL cont = TRUE, save = (fi->tkd != NULL); int pos = 0, error = afm_ok, tcount = 0; register char *keyword; while (cont) { keyword = token(fp); if (keyword == NULL) { error = afm_earlyEOF; break; /* get out of loop */ } if (!save) /* get tokens until the end of the Track Kerning Data */ /* section without saving any of the data */ switch(recognize(keyword)) { case ENDTRACKKERN: case ENDKERNDATA: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; default: break; } /* switch */ else /* otherwise parse entire Track Kerning Data section, */ /* saving the data */ switch(recognize(keyword)) { case COMMENT: keyword = linetoken(fp); break; case TRACKKERN: if (tcount < fi->numOfTracks) { keyword = token(fp); fi->tkd[pos].degree = atoi(keyword); keyword = token(fp); fi->tkd[pos].minPtSize = atof(keyword); if (errno == ERANGE) error = afm_parseError; keyword = token(fp); fi->tkd[pos].minKernAmt = atof(keyword); if (errno == ERANGE) error = afm_parseError; keyword = token(fp); fi->tkd[pos].maxPtSize = atof(keyword); if (errno == ERANGE) error = afm_parseError; keyword = token(fp); fi->tkd[pos++].maxKernAmt = atof(keyword); if (errno == ERANGE) error = afm_parseError; tcount++; } else { error = afm_parseError; cont = FALSE; } break; case ENDTRACKKERN: case ENDKERNDATA: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; case NOPE: default: error = afm_parseError; break; } /* switch */ } /* while */ if (error == afm_ok && tcount != fi->numOfTracks) error = afm_parseError; return(error); } /* parseTrackKernData */ /************************* parsePairKernData ************************/ /* This function is called by "parseFile". It will parse the AFM File * up to the "EndKernPairs" or "EndKernData" keywords. It will save * the pair kerning data if requested by the caller of parseFile. * * parsePairKernData is passed in a pointer to the FontInfo record. * If data is to be saved, the FontInfo record will already contain * a valid pointer to storage for the pair kerning data. * * This function returns an error code specifying whether there was * a premature EOF or a parsing error. This return value is used by * parseFile to determine if there is more file to parse. */ static int parsePairKernData(fp, fi) FILE *fp; register AFMFontInfo *fi; { BOOL cont = TRUE, save = (fi->pkd != NULL); int pos = 0, error = afm_ok, pcount = 0; register char *keyword; while (cont) { keyword = token(fp); if (keyword == NULL) { error = afm_earlyEOF; break; /* get out of loop */ } if (!save) /* get tokens until the end of the Pair Kerning Data */ /* section without saving any of the data */ switch(recognize(keyword)) { case ENDKERNPAIRS: case ENDKERNDATA: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; default: break; } /* switch */ else /* otherwise parse entire Pair Kerning Data section, */ /* saving the data */ switch(recognize(keyword)) { case COMMENT: keyword = linetoken(fp); break; case KERNPAIR: if (pcount < fi->numOfPairs) { keyword = token(fp); fi->pkd[pos].name1 = (char *) malloc(strlen(keyword) + 1); strcpy(fi->pkd[pos].name1, keyword); keyword = token(fp); fi->pkd[pos].name2 = (char *) malloc(strlen(keyword) + 1); strcpy(fi->pkd[pos].name2, keyword); keyword = token(fp); fi->pkd[pos].xamt = atoi(keyword); keyword = token(fp); fi->pkd[pos++].yamt = atoi(keyword); pcount++; } else { error = afm_parseError; cont = FALSE; } break; case KERNPAIRXAMT: if (pcount < fi->numOfPairs) { keyword = token(fp); fi->pkd[pos].name1 = (char *) malloc(strlen(keyword) + 1); strcpy(fi->pkd[pos].name1, keyword); keyword = token(fp); fi->pkd[pos].name2 = (char *) malloc(strlen(keyword) + 1); strcpy(fi->pkd[pos].name2, keyword); keyword = token(fp); fi->pkd[pos++].xamt = atoi(keyword); pcount++; } else { error = afm_parseError; cont = FALSE; } break; case ENDKERNPAIRS: case ENDKERNDATA: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; case NOPE: default: error = afm_parseError; break; } /* switch */ } /* while */ if (error == afm_ok && pcount != fi->numOfPairs) error = afm_parseError; return(error); } /* parsePairKernData */ /************************* parseCompCharData **************************/ /* This function is called by "parseFile". It will parse the AFM File * up to the "EndComposites" keyword. It will save the composite * character data if requested by the caller of parseFile. * * parseCompCharData is passed in a pointer to the FontInfo record, and * a boolean representing if the data should be saved. * * This function will create the appropriate amount of storage for * the composite character data and store a pointer to the storage * in the FontInfo record. * * This function returns an error code specifying whether there was * a premature EOF or a parsing error. This return value is used by * parseFile to determine if there is more file to parse. */ static int parseCompCharData(fp, fi) FILE *fp; register AFMFontInfo *fi; { BOOL cont = TRUE, firstTime = TRUE, save = (fi->ccd != NULL); int pos = 0, j = 0, error = afm_ok, ccount = 0, pcount = 0; register char *keyword; while (cont) { keyword = token(fp); if (keyword == NULL) /* Have reached an early and unexpected EOF. */ /* Set flag and stop parsing */ { error = afm_earlyEOF; break; /* get out of loop */ } if (ccount > fi->numOfComps) { error = afm_parseError; break; /* get out of loop */ } if (!save) /* get tokens until the end of the Composite Character info */ /* section without saving any of the data */ switch(recognize(keyword)) { case ENDCOMPOSITES: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; default: break; } /* switch */ else /* otherwise parse entire Composite Character info section, */ /* saving the data */ switch(recognize(keyword)) { case COMMENT: keyword = linetoken(fp); break; case COMPCHAR: if (ccount < fi->numOfComps) { keyword = token(fp); if (pcount != fi->ccd[pos].numOfPieces) error = afm_parseError; pcount = 0; if (firstTime) firstTime = FALSE; else pos++; fi->ccd[pos].ccName = (char *) malloc(strlen(keyword) + 1); strcpy(fi->ccd[pos].ccName, keyword); keyword = token(fp); fi->ccd[pos].numOfPieces = atoi(keyword); fi->ccd[pos].pieces = (AFMPcc *) calloc(fi->ccd[pos].numOfPieces, sizeof(AFMPcc)); j = 0; ccount++; } else { error = afm_parseError; cont = FALSE; } break; case COMPCHARPIECE: if (pcount < fi->ccd[pos].numOfPieces) { keyword = token(fp); fi->ccd[pos].pieces[j].pccName = (char *) malloc(strlen(keyword) + 1); strcpy(fi->ccd[pos].pieces[j].pccName, keyword); keyword = token(fp); fi->ccd[pos].pieces[j].deltax = atoi(keyword); keyword = token(fp); fi->ccd[pos].pieces[j++].deltay = atoi(keyword); pcount++; } else error = afm_parseError; break; case ENDCOMPOSITES: cont = FALSE; break; case ENDFONTMETRICS: cont = FALSE; error = normalEOF; break; case NOPE: default: error = afm_parseError; break; } /* switch */ } /* while */ if (error == afm_ok && ccount != fi->numOfComps) error = afm_parseError; return(error); } /* parseCompCharData */ /*************************** 'PUBLIC' FUNCTION ********************/ /*************************** parseFile *****************************/ /* parseFile is the only 'public' procedure available. It is called * from an application wishing to get information from an AFM file. * The caller of this function is responsible for locating and opening * an AFM file and handling all errors associated with that task. * * parseFile expects 3 parameters: a vaild file pointer, a pointer * to a (FontInfo *) variable (for which storage will be allocated and * the data requested filled in), and a mask specifying which * data from the AFM File should be saved in the FontInfo structure. * * The file will be parsed and the requested data will be stored in * a record of type FontInfo (refer to ParseAFM.h). * * parseFile returns an error code as defined in parseAFM.h. * * The position of the read/write pointer associated with the file * pointer upon return of this function is undefined. */ extern int AFMParseFile (fp, fi, flags) FILE *fp; AFMFontInfo **fi; FLAGS flags; { int code = afm_ok; /* return code from each of the parsing routines */ int error = afm_ok; /* used as the return code from this function */ register char *keyword; /* used to store a token */ /* storage data for the global variable ident */ ident = (char *) calloc(MAX_NAME, sizeof(char)); if (ident == NULL) {error = afm_storageProblem; return(error);} (*fi) = (AFMFontInfo *) calloc(1, sizeof(AFMFontInfo)); if ((*fi) == NULL) {error = afm_storageProblem; return(error);} if (flags & AFM_G) { (*fi)->gfi = (AFMGlobalFontInfo *) calloc(1, sizeof(AFMGlobalFontInfo)); if ((*fi)->gfi == NULL) {error = afm_storageProblem; return(error);} } /* The AFM File begins with Global Font Information. This section */ /* will be parsed whether or not information should be saved. */ code = parseGlobals(fp, (*fi)->gfi); if (code < 0) error = code; /* The Global Font Information is followed by the Character Metrics */ /* section. Which procedure is used to parse this section depends on */ /* how much information should be saved. If all of the metrics info */ /* is wanted, parseCharMetrics is called. If only the character widths */ /* is wanted, parseCharWidths is called. parseCharWidths will also */ /* be called in the case that no character data is to be saved, just */ /* to parse through the section. */ if ((code != normalEOF) && (code != afm_earlyEOF)) { (*fi)->numOfChars = atoi(token(fp)); if (flags & (AFM_M ^ AFM_W)) { (*fi)->cmi = (AFMCharMetricInfo *) calloc((*fi)->numOfChars, sizeof(AFMCharMetricInfo)); if ((*fi)->cmi == NULL) {error = afm_storageProblem; return(error);} code = parseCharMetrics(fp, *fi); } else { if (flags & AFM_W) { (*fi)->cwi = (float *) calloc(256, sizeof(float)); if ((*fi)->cwi == NULL) { error = afm_storageProblem; return(error); } } /* parse section regardless */ code = parseCharWidths(fp, (*fi)->cwi); } /* else */ } /* if */ if ((error != afm_earlyEOF) && (code < 0)) error = code; /* The remaining sections of the AFM are optional. This code will */ /* look at the next keyword in the file to determine what section */ /* is next, and then allocate the appropriate amount of storage */ /* for the data (if the data is to be saved) and call the */ /* appropriate parsing routine to parse the section. */ while ((code != normalEOF) && (code != afm_earlyEOF)) { keyword = token(fp); if (keyword == NULL) /* Have reached an early and unexpected EOF. */ /* Set flag and stop parsing */ { code = afm_earlyEOF; break; /* get out of loop */ } switch(recognize(keyword)) { case STARTKERNDATA: break; case ENDKERNDATA: break; case STARTTRACKKERN: keyword = token(fp); if (flags & AFM_T) { (*fi)->numOfTracks = atoi(keyword); (*fi)->tkd = (AFMTrackKernData *) calloc((*fi)->numOfTracks, sizeof(AFMTrackKernData)); if ((*fi)->tkd == NULL) { error = afm_storageProblem; return(error); } } /* if */ code = parseTrackKernData(fp, *fi); break; case STARTKERNPAIRS: keyword = token(fp); if (flags & AFM_P) { (*fi)->numOfPairs = atoi(keyword); (*fi)->pkd = (AFMPairKernData *) calloc((*fi)->numOfPairs, sizeof(AFMPairKernData)); if ((*fi)->pkd == NULL) { error = afm_storageProblem; return(error); } } /* if */ code = parsePairKernData(fp, *fi); break; case STARTCOMPOSITES: keyword = token(fp); if (flags & AFM_C) { (*fi)->numOfComps = atoi(keyword); (*fi)->ccd = (AFMCompCharData *) calloc((*fi)->numOfComps, sizeof(AFMCompCharData)); if ((*fi)->ccd == NULL) { error = afm_storageProblem; return(error); } } /* if */ code = parseCompCharData(fp, *fi); break; case ENDFONTMETRICS: code = normalEOF; break; case NOPE: default: code = afm_parseError; break; } /* switch */ if ((error != afm_earlyEOF) && (code < 0)) error = code; } /* while */ if ((error != afm_earlyEOF) && (code < 0)) error = code; if (ident != NULL) { free(ident); ident = NULL; } return(error); } /* parseFile */ gnustep-back-0.29.0/Source/xdps/parseAFM.h000066400000000000000000000303301404163720200202100ustar00rootroot00000000000000/* * parseAFM.h,v * * (c) Copyright 1991-1994 Adobe Systems Incorporated. * All rights reserved. * * Permission to use, copy, modify, distribute, and sublicense this software * and its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notices appear in all copies and that * both those copyright notices and this permission notice appear in * supporting documentation and that the name of Adobe Systems Incorporated * not be used in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. No trademark license * to use the Adobe trademarks is hereby granted. If the Adobe trademark * "Display PostScript"(tm) is used to describe this software, its * functionality or for any other purpose, such use shall be limited to a * statement that this software works in conjunction with the Display * PostScript system. Proper trademark attribution to reflect Adobe's * ownership of the trademark shall be given whenever any such reference to * the Display PostScript system is made. * * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE. * * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems * Incorporated which may be registered in certain jurisdictions * * Author: Adobe Systems Incorporated */ /*************************************************************** ** ** This header file is used in conjuction with the parseAFM.c file. ** Together these files provide the functionality to parse Adobe Font ** Metrics files and store the information in predefined data structures. ** It is intended to work with an application program that needs font metric ** information. The program can be used as is by making a procedure call to ** parse an AFM file and have the data stored, or an application developer ** may wish to customize the code. ** ** This header file defines the data structures used as well as the key ** strings that are currently recognized by this version of the AFM parser. ** This program is based on the document "Adobe Font Metrics Files, ** Specification Version 2.0". ** ** AFM files are separated into distinct sections of different data. Because ** of this, the parseAFM program can parse a specified file to only save ** certain sections of information based on the application's needs. A record ** containing the requested information will be returned to the application. ** ** AFM files are divided into five sections of data: ** 1) The Global Font Information ** 2) The Character Metrics Information ** 3) The Track Kerning Data ** 4) The Pair-Wise Kerning Data ** 5) The Composite Character Data ** ** Basically, the application can request any of these sections independent ** of what other sections are requested. In addition, in recognizing that ** many applications will want ONLY the x-width of characters and not all ** of the other character metrics information, there is a way to receive ** only the width information so as not to pay the storage cost for the ** unwanted data. An application should never request both the ** "quick and dirty" char metrics (widths only) and the Character Metrics ** Information since the Character Metrics Information will contain all ** of the character widths as well. ** ** There is a procedure in parseAFM.c, called parseFile, that can be ** called from any application wishing to get information from the AFM File. ** This procedure expects 3 parameters: a vaild file descriptor, a pointer ** to a (AFMFontInfo *) variable (for which space will be allocated and then ** will be filled in with the data requested), and a mask specifying ** which data from the AFM File should be saved in the AFMFontInfo structure. ** ** The flags that can be used to set the appropriate mask are defined below. ** In addition, several commonly used masks have already been defined. ** ** History: ** original: DSM Thu Oct 20 17:39:59 PDT 1988 ** modified: DSM Mon Jul 3 14:17:50 PDT 1989 ** - added 'storageProblem' return code ** - fixed typos ** **************************************************************/ #include /* ** Flags that can be AND'ed together to specify exactly what ** information from the AFM file should be saved. */ #define AFM_G 0x01 /* 0000 0001 */ /* Global Font Info */ #define AFM_W 0x02 /* 0000 0010 */ /* Character Widths ONLY */ #define AFM_M 0x06 /* 0000 0110 */ /* All Char Metric Info */ #define AFM_P 0x08 /* 0000 1000 */ /* Pair Kerning Info */ #define AFM_T 0x10 /* 0001 0000 */ /* Track Kerning Info */ #define AFM_C 0x20 /* 0010 0000 */ /* Composite Char Info */ /* ** Commonly used flags */ #define AFM_GW (AFM_G | AFM_W) #define AFM_GM (AFM_G | AFM_M) #define AFM_GMP (AFM_G | AFM_M | AFM_P) #define AFM_GMK (AFM_G | AFM_M | AFM_P | AFM_T) #define AFM_ALL (AFM_G | AFM_M | AFM_P | AFM_T | AFM_C) /* ** Possible return codes from the AFMParseFile procedure. ** ** afm_ok means there were no problems parsing the file. ** ** afm_parseError means that there was some kind of parsing error, but the ** parser went on. This could include problems like the count for any given ** section does not add up to how many entries there actually were, or ** there was a key that was not recognized. The return record may contain ** vaild data or it may not. ** ** afm_earlyEOF means that an End of File was encountered before expected. This ** may mean that the AFM file had been truncated, or improperly formed. ** ** afm_storageProblem means that there were problems allocating storage for ** the data structures that would have contained the AFM data. */ #define afm_ok 0 #define afm_parseError -1 #define afm_earlyEOF -2 #define afm_storageProblem -3 /************************* TYPES ********************************/ /* ** Below are all of the data structure definitions. These structures ** try to map as closely as possible to grouping and naming of data ** in the AFM Files. */ /* ** Bounding box definition. Used for the Font BBox as well as the ** Character BBox. */ typedef struct { int llx; /* lower left x-position */ int lly; /* lower left y-position */ int urx; /* upper right x-position */ int ury; /* upper right y-position */ } AFMBBox; /* ** Global Font information. ** The key that each field is associated with is in comments. For an ** explanation about each key and its value please refer to the AFM ** documentation (full title & version given above). */ typedef struct { char *afmVersion; /* key: StartFontMetrics */ char *fontName; /* key: FontName */ char *fullName; /* key: FullName */ char *familyName; /* key: FamilyName */ char *weight; /* key: Weight */ float italicAngle; /* key: ItalicAngle */ int isFixedPitch; /* key: IsFixedPitch */ AFMBBox fontBBox; /* key: FontBBox */ int underlinePosition; /* key: UnderlinePosition */ int underlineThickness; /* key: UnderlineThickness */ char *version; /* key: Version */ char *notice; /* key: Notice */ char *encodingScheme; /* key: EncodingScheme */ int capHeight; /* key: CapHeight */ int xHeight; /* key: XHeight */ int ascender; /* key: Ascender */ int descender; /* key: Descender */ } AFMGlobalFontInfo; /* ** Ligature definition is a linked list since any character can have ** any number of ligatures. */ typedef struct _t_ligature { char *succ, *lig; struct _t_ligature *next; } AFMLigature; /* ** Character Metric Information. This structure is used only if ALL ** character metric information is requested. If only the character ** widths is requested, then only an array of the character x-widths ** is returned. ** ** The key that each field is associated with is in comments. For an ** explanation about each key and its value please refer to the ** Character Metrics section of the AFM documentation (full title ** & version given above). */ typedef struct { int code, /* key: C */ wx, /* key: WX */ wy; /* together wx and wy are associated with key: W */ char *name; /* key: N */ AFMBBox charBBox; /* key: B */ AFMLigature *ligs; /* key: L (linked list; not a fixed number of Ls */ } AFMCharMetricInfo; /* ** Track kerning data structure. ** The fields of this record are the five values associated with every ** TrackKern entry. ** ** For an explanation about each value please refer to the ** Track Kerning section of the AFM documentation (full title ** & version given above). */ typedef struct { int degree; float minPtSize, minKernAmt, maxPtSize, maxKernAmt; } AFMTrackKernData; /* ** Pair Kerning data structure. ** The fields of this record are the four values associated with every ** KP entry. For KPX entries, the yamt will be zero. ** ** For an explanation about each value please refer to the ** Pair Kerning section of the AFM documentation (full title ** & version given above). */ typedef struct { char *name1; char *name2; int xamt, yamt; } AFMPairKernData; /* ** PCC is a piece of a composite character. This is a sub structure of a ** compCharData described below. ** These fields will be filled in with the values from the key PCC. ** ** For an explanation about each key and its value please refer to the ** Composite Character section of the AFM documentation (full title ** & version given above). */ typedef struct { char *pccName; int deltax, deltay; } AFMPcc; /* ** Composite Character Information data structure. ** The fields ccName and numOfPieces are filled with the values associated ** with the key CC. The field pieces points to an array (size = numOfPieces) ** of information about each of the parts of the composite character. That ** array is filled in with the values from the key PCC. ** ** For an explanation about each key and its value please refer to the ** Composite Character section of the AFM documentation (full title ** & version given above). */ typedef struct { char *ccName; int numOfPieces; AFMPcc *pieces; } AFMCompCharData; /* ** AFMFontInfo ** Record type containing pointers to all of the other data ** structures containing information about a font. ** A a record of this type is filled with data by the ** parseFile function. */ typedef struct { AFMGlobalFontInfo *gfi; /* ptr to a GlobalAFMFontInfo record */ float *cwi; /* ptr to 256 element array of char widths */ int numOfChars; /* number of entries in char metrics array */ AFMCharMetricInfo *cmi; /* ptr to char metrics array */ int numOfTracks; /* number to entries in track kerning array */ AFMTrackKernData *tkd; /* ptr to track kerning array */ int numOfPairs; /* number to entries in pair kerning array */ AFMPairKernData *pkd; /* ptr to pair kerning array */ int numOfComps; /* number to entries in comp char array */ AFMCompCharData *ccd; /* ptr to comp char array */ } AFMFontInfo; /************************* PROCEDURES ***************************/ /* ** Call this procedure to do the grunt work of parsing an AFM file. ** ** "fp" should be a valid file pointer to an AFM file. ** ** "fi" is a pointer to a pointer to a AFMFontInfo record sturcture ** (defined above). Storage for the AFMFontInfo structure will be ** allocated in parseFile and the structure will be filled in ** with the requested data from the AFM File. ** ** "flags" is a mask with bits set representing what data should ** be saved. Defined above are valid flags that can be used to set ** the mask, as well as a few commonly used masks. ** ** The possible return codes from AFMParseFile are defined above. */ extern int AFMParseFile ( /* FILE *fp; AFMFontInfo **fi; int flags; */ ); gnustep-back-0.29.0/Source/xlib/000077500000000000000000000000001404163720200163625ustar00rootroot00000000000000gnustep-back-0.29.0/Source/xlib/.cvsignore000066400000000000000000000000171404163720200203600ustar00rootroot00000000000000Resources *obj gnustep-back-0.29.0/Source/xlib/GNUmakefile000066400000000000000000000031541404163720200204370ustar00rootroot00000000000000# # Main makefile for GNUstep Backend xlib # # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make SUBPROJECT_NAME=xlib # The Objective-C source files to be compiled xlib_OBJC_FILES = \ XGBitmap.m \ XGCommonFont.m \ XGFont.m \ XGFontManager.m \ XGContext.m \ XGGState.m \ XGGeometry.m \ XGFontSetFontInfo.m \ linking.m ifeq ($(WITH_XFT),yes) xlib_OBJC_FILES += GSXftFontInfo.m \ ../fontconfig/FCFontInfo.m \ ../fontconfig/FCFontEnumerator.m \ ../fontconfig/FCFaceInfo.m endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble gnustep-back-0.29.0/Source/xlib/GNUmakefile.preamble000066400000000000000000000031261404163720200222240ustar00rootroot00000000000000# # GNUmakefile.preamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Backend. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS) # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler #ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS = -I../../Headers \ -I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS = # Additional library directories the linker should search ADDITIONAL_LIB_DIRS = # # Flags dealing with installing and uninstalling # gnustep-back-0.29.0/Source/xlib/GSXftFontInfo.m000066400000000000000000000320601404163720200211770ustar00rootroot00000000000000/* GSXftFontInfo NSFont helper for GNUstep GUI X/GPS Backend Copyright (C) 1996 Free Software Foundation, Inc. Author: Fred Kiefer Date: July 2001 This file is part of the GNUstep GUI X/GPS Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "xlib/XGContext.h" #include "xlib/XGPrivate.h" #include "xlib/XGGState.h" #include "x11/XGServer.h" #include #include #include #include #include #include // For the encoding functions #include #include #include "xlib/GSXftFontInfo.h" #define id _gs_avoid_id_collision #include #undef id #include #include FT_FREETYPE_H #include FT_GLYPH_H #include FT_OUTLINE_H @implementation GSXftFaceInfo @end @implementation GSXftFontEnumerator + (Class) faceInfoClass { return [GSXftFaceInfo class]; } + (GSXftFaceInfo *) fontWithName: (NSString *) name { return (GSXftFaceInfo *) [super fontWithName: name]; } @end @interface GSXftFontInfo (Private) - (BOOL) setupAttributes; - (XGlyphInfo *)xGlyphInfo: (NSGlyph) glyph; @end @implementation GSXftFontInfo - initWithFontName: (NSString*)name matrix: (const CGFloat*)fmatrix screenFont: (BOOL)screenFont { if (screenFont) { RELEASE(self); return nil; } [super init]; ASSIGN(fontName, name); memcpy(matrix, fmatrix, sizeof(matrix)); if (![self setupAttributes]) { RELEASE(self); return nil; } return self; } - (void) dealloc { if (font_info != NULL) XftFontClose([XGServer xDisplay], (XftFont *)font_info); [super dealloc]; } - (CGFloat) widthOfString: (NSString*)string { XGlyphInfo extents; int len = [string length]; XftChar16 str[len]; [string getCharacters: (unichar*)str]; XftTextExtents16 ([XGServer xDisplay], font_info, str, len, &extents); return extents.width; } - (CGFloat) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len { XGlyphInfo extents; XftChar16 buf[len]; int i; for (i = 0; i < len; i++) { buf[i] = glyphs[i]; } XftTextExtents16 ([XGServer xDisplay], font_info, buf, len, &extents); return extents.width; } - (NSMultibyteGlyphPacking)glyphPacking { return NSTwoByteGlyphPacking; } - (NSSize) advancementForGlyph: (NSGlyph)glyph { if (_cachedSizes) { int entry = glyph % _cacheSize; if (_cachedGlyphs[entry] == glyph) return _cachedSizes[entry]; XGlyphInfo *pc = [self xGlyphInfo: glyph]; if (!pc) return NSMakeSize((float)(font_info)->max_advance_width, 0); _cachedGlyphs[entry] = glyph; _cachedSizes[entry] = NSMakeSize((float)pc->xOff, (float)pc->yOff); return _cachedSizes[entry]; } XGlyphInfo *pc = [self xGlyphInfo: glyph]; // if per_char is NULL assume max bounds if (!pc) return NSMakeSize((float)(font_info)->max_advance_width, 0); return NSMakeSize((float)pc->xOff, (float)pc->yOff); } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { XGlyphInfo *pc = [self xGlyphInfo: glyph]; // if per_char is NULL assume max bounds if (!pc) return NSMakeRect(0.0, 0.0, (float)font_info->max_advance_width, (float)(font_info->ascent + font_info->descent)); return NSMakeRect((float)pc->x, (float)-pc->y, (float)(pc->width), (float)(pc->height)); } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { return XftGlyphExists([XGServer xDisplay], (XftFont *)font_info, glyph); } - (NSGlyph) glyphWithName: (NSString*)glyphName { // FIXME: There is a mismatch between PS names and X names, that we should // try to correct here KeySym k = XStringToKeysym([glyphName cString]); if (k == NoSymbol) return 0; else return (NSGlyph)k; } - (NSPoint) positionOfGlyph: (NSGlyph)curGlyph precededByGlyph: (NSGlyph)prevGlyph isNominal: (BOOL*)nominal { if (nominal) *nominal = YES; if (curGlyph == NSControlGlyph || prevGlyph == NSControlGlyph) return NSZeroPoint; // if (curGlyph == NSNullGlyph) { NSSize advance = [self advancementForGlyph: prevGlyph]; return NSMakePoint(advance.width, advance.height); } } /* - (CGFloat) pointSize { Display *xdpy = [XGServer xDisplay]; return XGFontPointSize(xdpy, font_info); } */ - (void) drawString: (NSString*)string onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp { NSData *d = [string dataUsingEncoding: mostCompatibleStringEncoding allowLossyConversion: YES]; int length = [d length]; const char *cstr = (const char*)[d bytes]; XGGState *state = (XGGState *)[(XGContext *)GSCurrentContext() currentGState]; XftDraw *xftdraw = [state xftDrawForDrawable: draw]; XftColor xftcolor = [state xftColor]; /* do it */ XftDrawString16(xftdraw, &xftcolor, font_info, xp.x, xp.y, (XftChar16*)cstr, length); } - (void) drawGlyphs: (const NSGlyph *) glyphs length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp { XGGState *state = (XGGState *)[(XGContext *)GSCurrentContext() currentGState]; XftDraw *xftdraw = [state xftDrawForDrawable: draw]; XftColor xftcolor = [state xftColor]; XftChar16 buf[len]; int i; for (i = 0; i < len; i++) { buf[i] = glyphs[i]; } /* do it */ XftDrawString16(xftdraw, &xftcolor, font_info, xp.x, xp.y, (XftChar16*)buf, len); } - (void) draw: (const char*) s length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp { int length = strlen(s); XGGState *state = (XGGState *)[(XGContext *)GSCurrentContext() currentGState]; XftDraw *xftdraw = [state xftDrawForDrawable: draw]; XftColor xftcolor = [state xftColor]; #ifdef HAVE_UTF8 /* do it */ if (NSUTF8StringEncoding == mostCompatibleStringEncoding) { XftDrawStringUtf8(xftdraw, &xftcolor, font_info, xp.x, xp.y, (XftChar8 *)s, length); } else #endif { XftDrawString8(xftdraw, &xftcolor, font_info, xp.x, xp.y, (XftChar8*)s, length); } } - (CGFloat) widthOf: (const char*) s length: (int) len { XGlyphInfo extents; #ifdef HAVE_UTF8 if (mostCompatibleStringEncoding == NSUTF8StringEncoding) XftTextExtentsUtf8([XGServer xDisplay], font_info, (XftChar8 *)s, len, &extents); else #endif XftTextExtents8([XGServer xDisplay], font_info, (XftChar8*)s, len, &extents); return extents.width; } - (void) setActiveFor: (Display*) xdpy gc: (GC) xgcntxt { } static int bezierpath_move_to(const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint d; d.x = to->x / 65536.0; d.y = to->y / 65536.0; /* d.x = to->x; d.y = to->y; */ [path closePath]; [path moveToPoint: d]; return 0; } static int bezierpath_line_to(const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint d; d.x = to->x / 65536.0; d.y = to->y / 65536.0; /* d.x = to->x; d.y = to->y; */ [path lineToPoint: d]; return 0; } static int bezierpath_conic_to(const FT_Vector *c1, const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint a, b, c, d; a = [path currentPoint]; d.x = to->x / 65536.0; d.y = to->y / 65536.0; b.x = c1->x / 65536.0; b.y = c1->y / 65536.0; /* d.x = to->x; d.y = to->y; b.x = c1->x; b.y = c1->y; */ c.x = (b.x * 2 + d.x) / 3.0; c.y = (b.y * 2 + d.y) / 3.0; b.x = (b.x * 2 + a.x) / 3.0; b.y = (b.y * 2 + a.y) / 3.0; [path curveToPoint: d controlPoint1: b controlPoint2: c]; return 0; } static int bezierpath_cubic_to(const FT_Vector *c1, const FT_Vector *c2, const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint b, c, d; b.x = c1->x / 65536.0; b.y = c1->y / 65536.0; c.x = c2->x / 65536.0; c.y = c2->y / 65536.0; d.x = to->x / 65536.0; d.y = to->y / 65536.0; /* b.x = c1->x; b.y = c1->y; c.x = c2->x; c.y = c2->y; d.x = to->x; d.y = to->y; */ [path curveToPoint: d controlPoint1: b controlPoint2: c]; return 0; } static FT_Outline_Funcs bezierpath_funcs = { move_to: bezierpath_move_to, line_to: bezierpath_line_to, conic_to: bezierpath_conic_to, cubic_to: bezierpath_cubic_to, shift: 10, // delta: 0, }; - (void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs count: (int)count toBezierPath: (NSBezierPath *)path { int i; FT_Matrix ftmatrix; FT_Vector ftdelta; FT_Face face; FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP; NSPoint p = [path currentPoint]; ftmatrix.xx = 65536; ftmatrix.xy = 0; ftmatrix.yx = 0; ftmatrix.yy = 65536; ftdelta.x = p.x * 64.0; ftdelta.y = p.y * 64.0; face = XftLockFace((XftFont *)font_info); for (i = 0; i < count; i++) { NSGlyph glyph; FT_Glyph gl; FT_OutlineGlyph og; glyph = glyphs[i]; // FIXME: Should do this conversion in the glyph creation! glyph = XftCharIndex([XGServer xDisplay], (XftFont *)font_info, glyph); if (FT_Load_Glyph(face, glyph, load_flags)) continue; if (FT_Get_Glyph(face->glyph, &gl)) continue; if (FT_Glyph_Transform(gl, &ftmatrix, &ftdelta)) { NSLog(@"glyph transformation failed!"); continue; } og = (FT_OutlineGlyph)gl; ftdelta.x += gl->advance.x >> 10; ftdelta.y += gl->advance.y >> 10; FT_Outline_Decompose(&og->outline, &bezierpath_funcs, path); FT_Done_Glyph(gl); } XftUnlockFace((XftFont *)font_info); if (count) { [path moveToPoint: NSMakePoint(ftdelta.x / 64.0, ftdelta.y / 64.0)]; } } @end @implementation GSXftFontInfo (Private) - (BOOL) setupAttributes { Display *xdpy = [XGServer xDisplay]; int defaultScreen = DefaultScreen(xdpy); GSXftFaceInfo *realFont = [GSXftFontEnumerator fontWithName: fontName]; FcPattern *fontPattern; FcPattern *pattern; FcResult fc_result; if (![super setupAttributes]) return NO; if (!realFont) { return NO; } if (!xdpy) return NO; fontPattern = FcPatternDuplicate([realFont matchedPattern]); // the only thing needs customization here is the size // FIXME: It would be correcter to use FC_SIZE as GNUstep should be // using point measurements, but as the rest of the library uses pixel, // we need to stick with that here. FcPatternAddDouble(fontPattern, FC_PIXEL_SIZE, (double)(matrix[0])); // Should do this only when size > 8 FcPatternAddBool(fontPattern, FC_AUTOHINT, FcTrue); pattern = XftFontMatch(xdpy, defaultScreen, fontPattern, &fc_result); // tide up FcPatternDestroy(fontPattern); // Derek Zhou claims that this takes over the ownership of the pattern if ((font_info = XftFontOpenPattern(xdpy, pattern))) { NSDebugLLog(@"NSFont", @"Loaded font: %@", fontName); } else { NSDebugLLog(@"NSFont", @"Cannot load font: %@", fontName); return NO; } // Fill the ivars isBaseFont = NO; ascender = font_info->ascent; descender = -(font_info->descent); capHeight = ascender - descender; // TODO xHeight = capHeight*0.6; //Errr... TODO lineHeight = capHeight; fontBBox = NSMakeRect( (float)(0), (float)(-font_info->descent), (float)(font_info->max_advance_width), (float)(font_info->ascent + font_info->descent)); maximumAdvancement = NSMakeSize(font_info->max_advance_width, 0.0); minimumAdvancement = NSMakeSize(0,0); // printf("h=%g a=%g d=%g max=(%g %g) (%g %g)+(%g %g)\n", // xHeight, ascender, descender, // maximumAdvancement.width, maximumAdvancement.height, // fontBBox.origin.x, fontBBox.origin.y, // fontBBox.size.width, fontBBox.size.height); return YES; } - (XGlyphInfo *)xGlyphInfo: (NSGlyph) glyph { static XGlyphInfo glyphInfo; XftTextExtents32 ([XGServer xDisplay], (XftFont *)font_info, &glyph, 1, &glyphInfo); return &glyphInfo; } @end gnustep-back-0.29.0/Source/xlib/XGBitmap.m000066400000000000000000001065041404163720200202210ustar00rootroot00000000000000/* XGBitmapImageRep.m NSBitmapImageRep for GNUstep GUI X/GPS Backend Copyright (C) 1996-1999 Free Software Foundation, Inc. Author: Adam Fedor Author: Scott Christley Date: Feb 1996 Author: Felipe A. Rodriguez Date: May 1998 Author: Richard Frith-Macdonald Date: Mar 1999 This file is part of the GNUstep GUI X/GPS Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include "gsc/gscolors.h" #include "xlib/XGPrivate.h" /* Macros that make it easier to convert between (r,g,b) <--> pixels. */ #define VARIABLES_DECLARATION \ unsigned char _rshift, _gshift, _bshift, _ashift; \ unsigned int _rmask, _gmask, _bmask, _amask; \ unsigned char _rwidth, _gwidth, _bwidth, _awidth #define InitRGBShiftsAndMasks(rs,rw,gs,gw,bs,bw,as,aw) \ do { \ _rshift = (rs); \ _rmask = (1<<(rw)) -1; \ _rwidth = (rw); \ _gshift = (gs); \ _gmask = (1<<(gw)) -1; \ _gwidth = (gw); \ _bshift = (bs); \ _bmask = (1<<(bw)) -1; \ _bwidth = (bw); \ _amask = (1<<(aw)) -1; \ _ashift = (as); \ _awidth = (aw); \ } while (0) #define PixelToRGB(pixel,r,g,b) \ do { \ (r) = (pixel >> _rshift) & _rmask; \ (g) = (pixel >> _gshift) & _gmask; \ (b) = (pixel >> _bshift) & _bmask; \ } while (0) /* Note that RGBToPixel assumes that the r,g,b values are in the correct domain. If not, the value is nonsense. */ #define RGBToPixel(r,g,b, pixel) \ do { \ pixel = ((r) << _rshift) \ |((g) << _gshift) \ |((b) << _bshift); \ } while (0) #define CLAMP(a) \ do { \ (a) = MAX(0, MIN(255, (a))); \ } while (0) #define CSIZE 16384 #define GS_QUERY_COLOR(color) \ do { \ int centry = color.pixel % CSIZE; \ if (empty[centry] == NO && pixels[centry] == color.pixel) \ { \ color = colors[centry]; \ } \ else \ { \ empty[centry] = NO; \ XQueryColor(context->dpy, context->cmap, &color); \ pixels[centry] = color.pixel; \ colors[centry] = color; \ } \ } while (0) /* Composite source image (pixmap) onto a destination image with alpha. Only works for op=Sover now Assumptions: - all images are valid. - srect is completely contained in the source images - srect put at the origin is contained in the destination image */ int _pixmap_combine_alpha(RContext *context, RXImage *source_im, RXImage *source_alpha, RXImage *dest_im, RXImage *dest_alpha, XRectangle srect, NSCompositingOperation op, XGDrawMechanism drawMechanism, float fraction) { unsigned long pixel; unsigned long oldPixel = 0; fraction = MAX(0.0, MIN(1.0, fraction)); if (drawMechanism == XGDM_FAST15 || drawMechanism == XGDM_FAST16 || drawMechanism == XGDM_FAST32 || drawMechanism == XGDM_FAST32_BGR || drawMechanism == XGDM_FAST8) { VARIABLES_DECLARATION; unsigned row; switch (drawMechanism) { case XGDM_FAST15: InitRGBShiftsAndMasks(10,5,5,5,0,5,0,8); break; case XGDM_FAST16: InitRGBShiftsAndMasks(11,5,5,6,0,5,0,8); break; case XGDM_FAST32: InitRGBShiftsAndMasks(16,8,8,8,0,8,0,8); break; case XGDM_FAST32_BGR: InitRGBShiftsAndMasks(0,8,8,8,16,8,0,8); break; case XGDM_FAST8: InitRGBShiftsAndMasks(5,3,2,3,0,2,0,8); break; default: NSLog(@"Huh? Backend confused about XGDrawMechanism"); //Try something. With a bit of luck we see //which picture goes wrong. InitRGBShiftsAndMasks(11,5,5,6,0,5,0,8); } for (row = 0; row < srect.height; row++) { unsigned col; for (col = 0; col < srect.width; col++) { unsigned sr, sg, sb, sa; // source unsigned dr, dg, db, da; // dest unsigned ialpha; // Get the source pixel information pixel = XGetPixel(source_im->image, srect.x+col, srect.y+row); PixelToRGB(pixel, sr, sg, sb); if (source_alpha) { pixel = XGetPixel(source_alpha->image, srect.x + col, srect.y + row); sa = (pixel >> _ashift) & _amask; } else sa = _amask; if (sa == 0) // dest wouldn't be changed continue; if (fraction < 1.0) sa *= fraction; sr *= sa; sg *= sa; sb *= sa; ialpha = (_amask - sa); // Now get dest pixel pixel = XGetPixel(dest_im->image, col, row); PixelToRGB(pixel, dr, dg, db); dr *= ialpha; dg *= ialpha; db *= ialpha; if (dest_alpha) { pixel = XGetPixel(dest_alpha->image, col, row); da = (pixel >> _ashift) & _amask; } else // no alpha channel, background is opaque da = _amask; dr = (sr + dr) / _amask; dg = (sg + dg) / _amask; db = (sb + db) / _amask; // calc final alpha if (sa == _amask || da == _amask) da = _amask; else da = sa + ((da * ialpha) / _amask); CLAMP(dr); CLAMP(dg); CLAMP(db); CLAMP(da); RGBToPixel(dr, dg, db, pixel); XPutPixel(dest_im->image, col, row, pixel); if (dest_alpha) XPutPixel(dest_alpha->image, col, row, da << _ashift); } } } else { unsigned long pixels[CSIZE]; XColor colors[CSIZE]; BOOL empty[CSIZE]; XColor c2; unsigned row; int cind; for (cind = 0; cind < CSIZE; cind++) { empty[cind] = YES; } /* * This block of code should be totally portable as it uses the * 'official' X mechanism for converting from pixel values to * RGB color values - on the downside, it's very slow. */ pixel = (unsigned long)-1; // Never valid? c2.pixel = pixel; for (row = 0; row < srect.height; row++) { unsigned col; for (col = 0; col < srect.width; col++) { int r, g, b, alpha; XColor pcolor, acolor, c0, c1; pcolor.pixel = XGetPixel(source_im->image, col + srect.x, row + srect.y); GS_QUERY_COLOR(pcolor); r = pcolor.red >> 8; g = pcolor.green >> 8; b = pcolor.blue >> 8; alpha = 255; if (source_alpha) { acolor.pixel = XGetPixel(source_alpha->image, col + srect.x, row + srect.y); GS_QUERY_COLOR(acolor); alpha = acolor.red >> 8; } if (alpha == 0) continue; // background unchanged. if (fraction < 1) alpha *= fraction; if (alpha == 255) { c1 = pcolor; } else { unsigned short ialpha = 255 - alpha; /* * RGB color components in X are 16-bit values - * but our bitmap contains 8-bit values so we must * adjust our values up to 16-bit, which we can do * by increasing their alpha component by 256. */ alpha <<= 8; /* * Get the background pixel and convert to RGB if * we haven't already done the conversion earlier. */ c0.pixel = XGetPixel(dest_im->image, col, row); if (c0.pixel != oldPixel) { oldPixel = c0.pixel; GS_QUERY_COLOR(c0); } // mix in alpha to produce RGB out c1.red = ((c0.red*ialpha) + (r*alpha))/255; c1.green = ((c0.green*ialpha) + (g*alpha))/255; c1.blue = ((c0.blue*ialpha) + (b*alpha))/255; } /* * Convert the X RGB value to a colormap entry if we * don't already have one. Then set the pixel. * NB. We will not necessarily get a * color with exactly the rgb components we gave it, so * we must record those components beforehand. */ if (c2.pixel == (unsigned long)-1 || c2.red != c1.red || c2.green != c1.green || c2.blue != c1.blue) { RColor rc; c2 = c1; rc.red = c1.red >> 8; rc.green = c1.green >> 8; rc.blue = c1.blue >> 8; RGetClosestXColor(context, &rc, &c1); c2.pixel = c1.pixel; } XPutPixel(dest_im->image, col, row, c1.pixel); if (dest_alpha) { RColor rc; XColor da; /* Alpha gets mixed the same as all the other color components */ da.pixel = XGetPixel(dest_alpha->image, col, row); GS_QUERY_COLOR(da); rc.red = acolor.red >> 8; rc.red = rc.red + (da.red >> 8) * (256 - rc.red)/256; rc.green = rc.blue = rc.red; RGetClosestXColor(context, &rc, &da); XPutPixel(dest_alpha->image, col, row, da.pixel); } } } } return 0; } /* * The following structure holds the information necessary for unpacking * a bitmap data object. It holds an index into the raw data, precalculated * spans for magnification and minifaction, plus the buffer which holds * a complete line of colour to be output to the screen in RGBA form. */ struct _bitmap_decompose { unsigned char *plane[5]; unsigned int bit_off[5]; long image_w, image_h, screen_w, screen_h; int bps, spp, bpp, bpr; BOOL has_alpha, is_direct_packed, one_is_black; int cspace, pro_mul; unsigned char *r, *g, *b, *a; int cur_image_row, cur_screen_row; int first_vis_col, last_vis_col; unsigned int *row_starts, *row_ends, *col_starts, *col_ends; unsigned int *r_sum, *g_sum, *b_sum, *a_sum, *pix_count; }; /* * Here we extract a value a given number of bits wide from a bit * offset into a block of memory starting at "base". The bit numbering * is assumed to be such that a bit offset of zero and a width of 4 gives * the upper 4 bits of the first byte, *not* the lower 4 bits. We do allow * the value to cross a byte boundary, though it is unclear as to whether * this is strictly necessary for OpenStep tiffs. */ static int _get_bit_value(unsigned char *base, long msb_off, int bit_width) { long lsb_off, byte1, byte2; int shift, value; /* * Firstly we calculate the position of the msb and lsb in terms * of bit offsets and thus byte offsets. The shift is the number of * spare bits left in the byte containing the lsb */ lsb_off = msb_off + bit_width - 1; byte1 = msb_off / 8; byte2 = lsb_off / 8; shift = 7-(lsb_off % 8); /* * We now get the value from the byte array, possibly using two bytes if * the required set of bits crosses the byte boundary. This is then shifted * down to it's correct position and extraneous bits masked off before * being returned. */ value = base[byte2]; if (byte1 != byte2) value |= base[byte1] << 8; value >>= shift; return value & ((1 << bit_width) - 1); } /* * Extract a single pixel from a row. We are passed addresses for the red, * green, blue and alpha components, along with the column number and all the * necessary information to access the raw data. This function is responsible * for extracting the raw data and converting it to 8 bit RGB for return so * as to present a unified interface to the higher functions. */ static void _get_image_pixel(int col, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a, unsigned char **planes, unsigned int *bit_off, int spp, int bpp, int bps, int pro_mul, int cspace, BOOL has_alpha, BOOL one_is_black) { int p, values[5]; long off = col * bpp; for (p = 0; p < spp; p++) { int raw_value = _get_bit_value(planes[p], off + bit_off[p], bps); values[p] = raw_value * pro_mul; } /* deal with the alpha */ *a = has_alpha ? values[spp-1] : 255; /* handle the colourspace */ switch (cspace) { case rgb_colorspace: *r = values[0]; *g = values[1]; *b = values[2]; break; case cmyk_colorspace: *r = MAX(0, 255 - (values[0] + values[3])); *g = MAX(0, 255 - (values[1] + values[3])); *b = MAX(0, 255 - (values[2] + values[3])); break; case gray_colorspace: *r = *g = *b = (one_is_black ? (255 - values[0]) : values[0]); break; } } /* * Main image decomposing function. This function creates the next row * in the image that needs to be output to the screen. For direct packed * images it simply copies the data directly, for all others it runs through * a set of loops pulling out image values and forming the avregae colour in 8 * it RGB for that particular screen pixel from the underlying image pixels, * no matter what format they are in. */ static void _create_image_row(struct _bitmap_decompose *img) { if (img->cur_screen_row >= img->screen_h) { NSLog(@"Tried to create too many screen rows"); return; } if (img->is_direct_packed) /* do direct copy, only limited formats supported */ { unsigned char *ptr = img->plane[0]; unsigned char *rptr = img->r; unsigned char *gptr = img->g; unsigned char *bptr = img->b; unsigned char *aptr = img->a; BOOL oib = img->one_is_black; BOOL ha = img->has_alpha; BOOL is_grey = (img->cspace == gray_colorspace); int i, fc = img->first_vis_col, lc = img->last_vis_col; /* do the offset from the right */ ptr += fc * ((is_grey ? 1 : 3) + (ha ? 1 : 0)); rptr += fc; gptr += fc; bptr += fc; aptr += fc; for (i = fc;i <= lc; i++) { *rptr = *ptr++; if (is_grey) { if (oib) *rptr = 255 - *rptr; *gptr = *bptr = *rptr; } else { *gptr = *ptr++; *bptr = *ptr++; } *aptr = ha ? *ptr++ : 255; /* opaque default */ rptr++; gptr++; bptr++; aptr++; } img->plane[0] += img->bpr; img->cur_image_row++; } else /* do the full averaging row creation */ { int tr, sc; int s_row = img->row_starts[img->cur_screen_row]; int e_row = img->row_ends[img->cur_screen_row]; BOOL zero_count = YES; /* local copies of stuff we use a lot to avoid indirect */ unsigned char **plane = img->plane; unsigned int *bit_off = img->bit_off; unsigned int *col_starts = img->col_starts; unsigned int *col_ends = img->col_ends; unsigned int *r_sum = img->r_sum; unsigned int *g_sum = img->g_sum; unsigned int *b_sum = img->b_sum; unsigned int *a_sum = img->a_sum; unsigned int *pix_count = img->pix_count; unsigned char *rptr = img->r; unsigned char *gptr = img->g; unsigned char *bptr = img->b; unsigned char *aptr = img->a; int spp = img->spp; int bpp = img->bpp; int bps = img->bps; int bpr = img->bpr; int pro_mul = img->pro_mul; int cspace = img->cspace; BOOL ha = img->has_alpha; BOOL oib = img->one_is_black; int fc = img->first_vis_col, lc = img->last_vis_col; /* loop for each required row */ zero_count = YES; for (tr = s_row; tr <= e_row; tr++) { /* move to the required image row */ while (img->cur_image_row < tr) { int p; for (p = 0; p < spp; p++) plane[p] += bpr; img->cur_image_row++; } /* for each screen pixel */ for (sc = fc; sc <= lc; sc++) { int s_col = col_starts[sc]; int e_col = col_ends[sc]; int tc; if (zero_count) { r_sum[sc] = 0; g_sum[sc] = 0; b_sum[sc] = 0; a_sum[sc] = 0; pix_count[sc] = 0; } /* for each image pixel */ for (tc = s_col; tc <= e_col; tc++) { unsigned char r, g, b, a; _get_image_pixel(tc, &r, &g, &b, &a, plane, bit_off, spp, bpp, bps, pro_mul, cspace, ha, oib); r_sum[sc] += r; g_sum[sc] += g; b_sum[sc] += b; a_sum[sc] += a; pix_count[sc]++; } } zero_count =NO; } /* * Build the line by averaging. As integer divide always * rounds down we can get the effect of adding 0.5 before * trucating by adding the value of the count right shifted * one bit, thus giving us the nearest value and therefore a * better approximation t the colour we hope. */ for (sc = fc; sc <= lc; sc++) { int count = pix_count[sc]; int half = count >> 1; rptr[sc] = (r_sum[sc] + half) / count; gptr[sc] = (g_sum[sc] + half) / count; bptr[sc] = (b_sum[sc] + half) / count; aptr[sc] = (a_sum[sc] + half) / count; } } img->cur_screen_row++; } /* * Set the ranges covered by a pixel within the image. Given the source * number of pixels and the destination number of pixels we calculate which * pixels in the source are more than 50% overlapped by each pixel in the * destination and record the start and end of the range. For mappings where * the source is being magnified this will only be a single pixel, for others * it may be one or more pixels, spaced evenly along the line. These are * the pixels which will then be averaged to make the best guess colour for * the destination pixel. As this is a slow process then a flag is passed in * which will cause the nearest pixel alorithm that is used for magnification * to be applied to minificationas well. The result looks rougher, but is much * faster and proprtional to the size of the output rather than the input * image. */ static void _set_ranges(long src_len, long dst_len, unsigned int *start_ptr, unsigned int *end_ptr, BOOL fast_min) { float dst_f = (float)dst_len; int d; if (fast_min || (src_len <= dst_len)) /* magnifying */ { float src_f = (float)src_len; for (d = 0; d < dst_len; d++) { int middle = (int)((((float)d + 0.5) * src_f) / dst_f); *start_ptr++ = middle; *end_ptr++ = middle; if (middle >= src_len) NSLog(@"Problem with magnification!"); } } else { int start = 0; for (d = 0; d < dst_len; d++) { int end_i = (int)(0.5 + (((d+1) * src_len) / dst_f)); if ((end_i > src_len) || (end_i < 1)) NSLog(@"Problem with minification!"); *start_ptr++ = start; *end_ptr++ = end_i - 1; start = end_i; } } } /* * Combine the image data with the currentonscreen data and push the * result back to the screen. The screen handling code is almost identical * to the original code. The function assumes that the displayable rectangle * is always a subset of the complete screen rectangle which is the area * in pixels that would be covered by the entire image. This is used to * calculate the scaling required. */ int _bitmap_combine_alpha(RContext *context, unsigned char * data_planes[5], int width, int height, int bits_per_sample, int samples_per_pixel, int bits_per_pixel, int bytes_per_row, int colour_space, BOOL one_is_black, BOOL is_planar, BOOL has_alpha, BOOL fast_min, RXImage *dest_im, RXImage *dest_alpha, XRectangle srect, XRectangle drect, NSCompositingOperation op, XGDrawMechanism drawMechanism) { struct _bitmap_decompose img; XColor c0; XColor c1; int col_shift = drect.x - srect.x; int row_shift = drect.y - srect.y; /* Sanity check on colourspace and number of colours */ { int num_of_colours = samples_per_pixel - (has_alpha ? 1 : 0); switch(colour_space) { case hsb_colorspace: NSLog(@"HSB colourspace not supported for images"); return -1; case rgb_colorspace: if (num_of_colours != 3) { NSLog(@"Bad number of colour planes - %d", num_of_colours); NSLog(@"RGB colourspace requires three planes excluding alpha"); return -1; } break; case cmyk_colorspace: if (num_of_colours != 4) { NSLog(@"Bad number of colour planes - %d", num_of_colours); NSLog(@"CMYK colourspace requires four planes excluding alpha"); return -1; } break; case gray_colorspace: if (num_of_colours != 1) { NSLog(@"Bad number of colour planes - %d", num_of_colours); NSLog(@"Gray colourspace requires one plane excluding alpha"); return -1; } break; default: NSLog(@"Unknown colourspace found"); return -1; } } /* bitmap decomposition structure */ img.bps = bits_per_sample; img.bpp = bits_per_pixel; img.spp = samples_per_pixel; img.bpr = bytes_per_row; img.image_w = width; img.image_h = height; img.screen_w = srect.width; img.screen_h = srect.height; img.has_alpha = has_alpha; img.one_is_black = one_is_black; img.cspace = colour_space; img.cur_image_row = 0; img.cur_screen_row = 0; /* * Promotion value, this is what the samples need to * be mutiplied by to get an 8 bit value. This is done * rather than shifting to fill in the lower bits properly. * The values for 6, 5 and 3 bits should be floats by rights, * but the difference is negligble and for speed we want to use * integers. */ switch (bits_per_sample) { case 16: case 8: img.pro_mul = 1; break; case 7: img.pro_mul = 2; break; case 6: img.pro_mul = 4; /* should be 4.05 */ break; case 5: img.pro_mul = 8; /* should be 8.226 */ break; case 4: img.pro_mul = 17; break; case 3: img.pro_mul = 36; /* should be 36.43 */ break; case 2: img.pro_mul = 85; break; case 1: img.pro_mul = 255; break; default: NSLog(@"Bizarre number of bits per sample %d", bits_per_sample); return -1; } /* * Handle planar or meshed data. We hold an array of * base addresses and bit offsets for all formats. * Thus for meshed data the bases are the same with * increasing bit offsets, but for planar data the bases * are those of the planes, with the bit offset always being * zero. */ { int i; /* zero them */ for (i=0;i<5;i++) { img.plane[i] = NULL; img.bit_off[i] = 0; } /* set as appropriate */ if (is_planar) for (i=0;i> (8 - _rwidth)); unsigned short sg = (*gptr++ >> (8 - _gwidth)); unsigned short sb = (*bptr++ >> (8 - _bwidth)); unsigned short sa = (*aptr++ >> (8 - _awidth)); unsigned dr, dg, db, da; // dest if (sa == 0) // dest wouldn't be changed continue; if (sa == _amask) // source only, don't bother with the rest { // Yes, this is duplicated code -- but it's worth it. RGBToPixel(sr, sg, sb, pixel); XPutPixel(dest_im->image, col, row, pixel); if (dest_alpha) XPutPixel(dest_alpha->image, col, row, sa << _ashift); continue; } // get the destination pixel pixel = XGetPixel(dest_im->image, col, row); PixelToRGB(pixel, dr, dg, db); if (dest_alpha) { pixel = XGetPixel(dest_alpha->image, col, row); da = (pixel >> _ashift) & _amask; } else // no alpha channel, background is opaque da = _amask; if (da == 0) { /* * Unscale the colors */ dr = (sr * _amask) / sa; dg = (sg * _amask) / sa; db = (sb * _amask) / sa; da = sa; } else { unsigned ialpha = _amask - sa; dr = (sr * sa + (dr * ialpha)) / _amask; dg = (sg * sa + (dg * ialpha)) / _amask; db = (sb * sa + (db * ialpha)) / _amask; if (da == _amask || da == _amask) da = _amask; else da = sa + ((da * ialpha) / _amask); } CLAMP(dr); CLAMP(dg); CLAMP(db); CLAMP(da); RGBToPixel(dr, dg, db, pixel); XPutPixel(dest_im->image, col, row, pixel); if (dest_alpha) XPutPixel(dest_alpha->image, col, row, da << _ashift); } } } else { XColor c2, a2; RColor rc, rc2; unsigned row, oldAlpha = 65537; unsigned long pixels[CSIZE]; XColor colors[CSIZE]; BOOL empty[CSIZE]; int cind; for (cind = 0; cind < CSIZE; cind++) { empty[cind] = YES; } /* * This block of code should be totally portable as it uses the * 'official' X mechanism for converting from pixel values to * RGB color values - on the downside, it's very slow. */ pixel = (unsigned long)-1; // Never valid? c1.pixel = c2.pixel = a2.pixel = pixel; for (row = 0; row < drect.height; row++) { unsigned col; unsigned char *rptr = img.r + col_shift; unsigned char *gptr = img.g + col_shift; unsigned char *bptr = img.b + col_shift; unsigned char *aptr = img.a + col_shift; _create_image_row(&img); for (col = 0; col < drect.width; col++) { unsigned short r = *rptr++; unsigned short g = *gptr++; unsigned short b = *bptr++; unsigned short alpha = *aptr++;; if (has_alpha) { if (alpha != oldAlpha) { oldAlpha = alpha; rc.red = rc.green = rc.blue = alpha; RGetClosestXColor(context, &rc, &a2); } if (dest_alpha) { XColor da; /* Alpha gets mixed the same as all the other color components */ da.pixel = XGetPixel(dest_alpha->image, col, row); GS_QUERY_COLOR(da); rc.red = alpha + (da.red >> 8) * (256 - alpha)/256; rc.green = rc.blue = rc.red; RGetClosestXColor(context, &rc, &da); XPutPixel(dest_alpha->image, col, row, da.pixel); } if (alpha == 0) continue; // background unchanged. if (alpha == 255) { rc.red = r; rc.green = g; rc.blue = b; } else { unsigned short ialpha = 255 - alpha; /* * RGB color components in X are 16-bit values - * but our bitmap contains 8-bit values so we must * adjust our values up to 16-bit, which we can do * by increasing their alpha component by 256. */ alpha <<= 8; /* * Get the background pixel and convert to RGB if * we haven't already done the conversion earlier. */ c0.pixel = XGetPixel(dest_im->image, col, row); if (c0.pixel != c2.pixel) { c2.pixel = c0.pixel; GS_QUERY_COLOR(c0); } // mix in alpha to produce RGB out rc.red = ((c0.red*ialpha) + (r*alpha))/(255*256); rc.green = ((c0.green*ialpha) + (g*alpha))/(255*256); rc.blue = ((c0.blue*ialpha) + (b*alpha))/(255*256); } } else { /* Not using alpha, but we still have to set it in the pixmap */ if (a2.pixel == pixel) { rc.red = rc.green = rc.blue = 255; RGetClosestXColor(context, &rc, &a2); } if (dest_alpha) XPutPixel(dest_alpha->image, col, row, a2.pixel); rc.red = r; rc.green = g; rc.blue = b; } /* * Convert the X RGB value to a colormap entry if we * don't already have one. Then set the pixel. * NB. We will not necessarily get a * color with exactly the rgb components we gave it, so * we must record those components beforehand. */ if (c1.pixel == pixel || rc.red != rc2.red || rc.green != rc2.green || rc.blue != rc2.blue) { rc2 = rc; RGetClosestXColor(context, &rc, &c1); } XPutPixel(dest_im->image, col, row, c1.pixel); } } } } /* free used memory */ free(img.r); free(img.g); free(img.b); free(img.a); if (!img.is_direct_packed) { free(img.row_starts); free(img.row_ends); free(img.col_starts); free(img.col_ends); free(img.r_sum); free(img.g_sum); free(img.b_sum); free(img.a_sum); free(img.pix_count); } return 0; } NSData * _pixmap_read_alpha(RContext *context, RXImage *source_im, RXImage *source_alpha, XRectangle srect, XGDrawMechanism drawMechanism) { unsigned long pixel; NSMutableData *data; unsigned char *bytes; int spp; spp = (source_alpha) ? 4 : 3; data = [NSMutableData dataWithLength: srect.width*srect.height*spp]; if (data == nil) return nil; bytes = [data mutableBytes]; if (drawMechanism == XGDM_FAST15 || drawMechanism == XGDM_FAST16 || drawMechanism == XGDM_FAST32 || drawMechanism == XGDM_FAST32_BGR || drawMechanism == XGDM_FAST8) { VARIABLES_DECLARATION; unsigned row; switch (drawMechanism) { case XGDM_FAST15: InitRGBShiftsAndMasks(10,5,5,5,0,5,0,8); break; case XGDM_FAST16: InitRGBShiftsAndMasks(11,5,5,6,0,5,0,8); break; case XGDM_FAST32: InitRGBShiftsAndMasks(16,8,8,8,0,8,0,8); break; case XGDM_FAST32_BGR: InitRGBShiftsAndMasks(0,8,8,8,16,8,0,8); break; case XGDM_FAST8: InitRGBShiftsAndMasks(5,3,2,3,0,2,0,8); break; default: NSLog(@"Huh? Backend confused about XGDrawMechanism"); //Try something. With a bit of luck we see //which picture goes wrong. InitRGBShiftsAndMasks(11,5,5,6,0,5,0,8); } for (row = 0; row < srect.height; row++) { unsigned col; for (col = 0; col < srect.width; col++) { unsigned sr, sg, sb, sa; // Get the source pixel information pixel = XGetPixel(source_im->image, col, row); PixelToRGB(pixel, sr, sg, sb); // Expand to 8 bit value sr = (sr << (8-_rwidth)); sg = (sg << (8-_gwidth)); sb = (sb << (8-_bwidth)); if (source_alpha) { pixel = XGetPixel(source_alpha->image, col, row); sa = (pixel >> _ashift) & _amask; } else sa = _amask; bytes[(row * srect.width + col)*spp] = sr; bytes[(row * srect.width + col)*spp+1] = sg; bytes[(row * srect.width + col)*spp+2] = sb; if (source_alpha) bytes[(row * srect.width + col)*spp+3] = sa; } } } else { unsigned row; unsigned long pixels[CSIZE]; XColor colors[CSIZE]; BOOL empty[CSIZE]; int cind; for (cind = 0; cind < CSIZE; cind++) { empty[cind] = YES; } /* * This block of code should be totally portable as it uses the * 'official' X mechanism for converting from pixel values to * RGB color values - on the downside, it's very slow. */ pixel = (unsigned long)-1; // Never valid? for (row = 0; row < srect.height; row++) { unsigned col; for (col = 0; col < srect.width; col++) { int r, g, b, alpha; XColor pcolor, acolor; pcolor.pixel = XGetPixel(source_im->image, col, row); GS_QUERY_COLOR(pcolor); r = pcolor.red >> 8; g = pcolor.green >> 8; b = pcolor.blue >> 8; alpha = 255; if (source_alpha) { acolor.pixel = XGetPixel(source_alpha->image, col, row); GS_QUERY_COLOR(acolor); alpha = acolor.red >> 8; } bytes[(row * srect.width + col)*spp] = r; bytes[(row * srect.width + col)*spp+1] = g; bytes[(row * srect.width + col)*spp+2] = b; if (source_alpha) bytes[(row * srect.width + col)*spp+3] = alpha; } } } return (NSData *)data; } gnustep-back-0.29.0/Source/xlib/XGCommonFont.m000066400000000000000000000173041404163720200210630ustar00rootroot00000000000000/* XGFontInfo NSFont helper for GNUstep GUI X/GPS Backend Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Author: Ovidiu Predescu Date: February 1997 Author: Felipe A. Rodriguez Date: May, October 1998 Author: Michael Hanni Date: August 1998 Author: Fred Kiefer Date: September 2000 This file is part of the GNUstep GUI X/GPS Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "xlib/XGContext.h" #include "xlib/XGPrivate.h" #include // For the encoding functions #include static Atom XA_SLANT = (Atom)0; static Atom XA_SETWIDTH_NAME = (Atom)0; static Atom XA_CHARSET_REGISTRY = (Atom)0; static Atom XA_CHARSET_ENCODING = (Atom)0; static Atom XA_SPACING = (Atom)0; static Atom XA_PIXEL_SIZE = (Atom)0; static Atom XA_WEIGHT_NAME = (Atom)0; /* static Atom XA_RESOLUTION_X = (Atom)0; static Atom XA_RESOLUTION_Y = (Atom)0; static Atom XA_ADD_STYLE_NAME = (Atom)0; static Atom XA_AVERAGE_WIDTH = (Atom)0; static Atom XA_FACE_NAME = (Atom)0; */ /* * Initialise the X atoms we are going to use */ static BOOL XGInitAtoms(Display *dpy) { // X atoms used to query a font if (!dpy) { NSDebugLog(@"No Display opened in XGInitAtoms"); return NO; } XA_PIXEL_SIZE = XInternAtom(dpy, "PIXEL_SIZE", False); XA_SPACING = XInternAtom(dpy, "SPACING", False); XA_WEIGHT_NAME = XInternAtom(dpy, "WEIGHT_NAME", False); XA_SLANT = XInternAtom(dpy, "SLANT", False); XA_SETWIDTH_NAME = XInternAtom(dpy, "SETWIDTH_NAME", False); XA_CHARSET_REGISTRY = XInternAtom(dpy, "CHARSET_REGISTRY", False); XA_CHARSET_ENCODING = XInternAtom(dpy, "CHARSET_ENCODING", False); /* XA_ADD_STYLE_NAME = XInternAtom(dpy, "ADD_STYLE_NAME", False); XA_RESOLUTION_X = XInternAtom(dpy, "RESOLUTION_X", False); XA_RESOLUTION_Y = XInternAtom(dpy, "RESOLUTION_Y", False); XA_AVERAGE_WIDTH = XInternAtom(dpy, "AVERAGE_WIDTH", False); XA_FACE_NAME = XInternAtom(dpy, "FACE_NAME", False); */ return YES; } /* * Return the name of the font cache file (used by font_cacher to write * the file and the backend to read the file */ extern NSString *XGFontCacheName(Display *dpy) { NSString *dname; dname = [NSString stringWithCString: XDisplayName(NULL)]; if ([dname hasPrefix: @"/tmp"]) { /* This is the new Mac OS X display server information, not a real host name. Use a more file-friendly name for the display */ NSString *str = [dname lastPathComponent]; dname = [dname stringByDeletingLastPathComponent]; dname = [NSString stringWithFormat: @"%@%@", [dname lastPathComponent], str]; } return dname; } /* * Read an X Font property of type unsigned long */ unsigned long XGFontPropULong(Display *dpy, XFontStruct *font_struct, Atom atom) { unsigned long lvalue; if (XGetFontProperty(font_struct, atom, &lvalue)) return lvalue; else return 0; } /* * Read an X Font property of type string */ NSString *XGFontPropString(Display *dpy, XFontStruct *font_struct, Atom atom) { unsigned long lvalue; char *value; NSString *ret = nil; if (XGetFontProperty(font_struct, atom, &lvalue) && dpy) { value = XGetAtomName(dpy, lvalue); if (value != NULL) { // We convert all props to lowercase so comparing is easier ret = [[NSString stringWithCString: value] lowercaseString]; XFree(value); } } return ret; } NSString *XGFontName(Display *dpy, XFontStruct *font_struct) { return XGFontPropString(dpy, font_struct, XA_FONT); } float XGFontPointSize(Display *dpy, XFontStruct *font_struct) { float size = 12.0; long pointSize; if (!XA_PIXEL_SIZE) XGInitAtoms(dpy); /* * We use pixel size here not point size, which is about 10 times its size. * Perhaps we will change that later on! */ pointSize = XGFontPropULong(dpy, font_struct, XA_PIXEL_SIZE); if (pointSize != 0) { size = (float) pointSize; } return size; } BOOL XGFontIsFixedPitch(Display *dpy, XFontStruct *font_struct) { /* Is this font fixed pitch? default, NO */ BOOL fixedFont = NO; NSString *spacing; // If there is no information per character, all must be equal if (!font_struct->per_char) { return YES; } if (!XA_SPACING) XGInitAtoms(dpy); /* * We could also check the value of MONOSPACED, but I have never seen it set. */ spacing = XGFontPropString(dpy, font_struct, XA_SPACING); if (spacing != nil) { if ([spacing isEqualToString: @"m"]) fixedFont = YES; } /* * We could calculate the pitch from the XLFD but that does not seem to be * saved. If we can't get the property, say no and cope. */ return fixedFont; } NSString *XGFontFamily(Display *dpy, XFontStruct *font_struct) { NSString *family; family = XGFontPropString(dpy, font_struct, XA_FAMILY_NAME); if (family == nil) return @"Unknown"; // FIXME: We should return the font name instead return [family capitalizedString]; } // Get the weight of a X font int XGWeightOfFont(Display *dpy, XFontStruct *info) { int w = 5; NSString *string; if (!XA_WEIGHT_NAME) XGInitAtoms(dpy); string = XGFontPropString(dpy, info, XA_WEIGHT_NAME); if (string != nil) { w = [GSFontInfo weightForString: string]; } return w; } // Get the traits of a X font NSFontTraitMask XGTraitsOfFont(Display *dpy, XFontStruct *info) { NSFontTraitMask mask = 0; NSString *string; int w = XGWeightOfFont(dpy, info); if (w >= 9) mask |= NSBoldFontMask; else mask |= NSUnboldFontMask; if (XGFontIsFixedPitch(dpy, info)) mask |= NSFixedPitchFontMask; string = XGFontPropString(dpy, info, XA_SLANT); if (string != nil) { char c = [string cString][0]; if (c == 'o' || c == 'i') mask |= NSItalicFontMask; else mask |= NSUnitalicFontMask; } string = XGFontPropString(dpy, info, XA_CHARSET_REGISTRY); if (string != nil) { if (![string isEqualToString: @"iso8859"] && ![string isEqualToString: @"iso10646"]) mask |= NSNonStandardCharacterSetFontMask; } string = XGFontPropString(dpy, info, XA_CHARSET_ENCODING); if (string != nil) { if (![string isEqualToString: @"1"]) mask |= NSNonStandardCharacterSetFontMask; } string = XGFontPropString(dpy, info, XA_SETWIDTH_NAME); if (string != nil) { if ([string isEqualToString: @"narrow"]) mask |= NSNarrowFontMask; else if ([string isEqualToString: @"semicondensed"]) mask |= NSCondensedFontMask; } string = XGFontPropString(dpy, info, XA_SPACING); if (string != nil) { if ([string isEqualToString: @"c"]) mask |= NSCompressedFontMask; } //FIXME: How can I find out about the other traits? /* unsigned long weight = XGFontPropULong(dpy, info, XA_WEIGHT); */ return mask; } gnustep-back-0.29.0/Source/xlib/XGContext.m000066400000000000000000000127671404163720200204400ustar00rootroot00000000000000/* -*- mode:ObjC -*- XGContext - Drawing context using the Xlib Library. Copyright (C) 1998,1999,2002 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "x11/XGServer.h" #include "xlib/XGContext.h" #include "xlib/XGPrivate.h" #include "xlib/XGGState.h" #ifdef HAVE_XFT #include "xlib/GSXftFontInfo.h" #endif #include "xlib/XGFontSetFontInfo.h" #include #include #include /** XGContext

The documentation below mostly describes methods that are specific to this backend and wouldn't necessarily be used in other backends. The methods that this class does implement that would need to be in every backend are the methods of its NSGraphicContext superclass. See the documentation for NSGraphicContext for more information.

*/ @implementation XGContext /* Initialize AppKit backend */ + (void)initializeBackend { Class fontClass = Nil; Class fontEnumerator = Nil; BOOL enableFontSet; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSDebugLog(@"Initializing GNUstep xlib backend.\n"); [NSGraphicsContext setDefaultContextClass: [XGContext class]]; #ifdef HAVE_XFT if (([ud objectForKey: @"GSFontAntiAlias"] == nil) || ([ud boolForKey: @"GSFontAntiAlias"])) { fontClass = [GSXftFontInfo class]; fontEnumerator = [GSXftFontEnumerator class]; } #endif enableFontSet = [ud boolForKey: @"GSXEnableFontSet"]; if (fontClass == Nil) { if (enableFontSet == NO) { fontClass = [XGFontInfo class]; } else { #ifdef X_HAVE_UTF8_STRING fontClass = [XGFontSetFontInfo class]; #else NSLog(@"Can't use GSXEnableFontSet: You need XFree86 >= 4.0.2"); fontClass = [XGFontInfo class]; #endif } } [GSFontInfo setDefaultClass: fontClass]; if (fontEnumerator == Nil) { if (enableFontSet == NO) { fontEnumerator = [XGFontEnumerator class]; } else { #ifdef X_HAVE_UTF8_STRING // Commented out till the implementation of XGFontSetEnumerator // completes. //fontEnumerator = [XGFontSetEnumerator class]; fontEnumerator = [XGFontEnumerator class]; #else fontEnumerator = [XGFontEnumerator class]; #endif } } [GSFontEnumerator setDefaultClass: fontEnumerator]; } + (Class) GStateClass { return [XGGState class]; } - (void) flushGraphics { XFlush([(XGServer *)server xDisplay]); } // Try to match the restrictions in XGBitmap - (BOOL) isCompatibleBitmap: (NSBitmapImageRep*)bitmap { NSString *colorSpaceName; int numColors; if ([bitmap bitmapFormat] != 0) { return NO; } if ([bitmap bitsPerSample] > 8) { return NO; } numColors = [bitmap samplesPerPixel] - ([bitmap hasAlpha] ? 1 : 0); colorSpaceName = [bitmap colorSpaceName]; if ([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] || [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) { return (numColors == 3); } else if ([colorSpaceName isEqualToString: NSDeviceCMYKColorSpace]) { return (numColors == 4); } else if ([colorSpaceName isEqualToString: NSDeviceWhiteColorSpace] || [colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) { return (numColors == 1); } else if ([colorSpaceName isEqualToString: NSDeviceBlackColorSpace] || [colorSpaceName isEqualToString: NSCalibratedBlackColorSpace]) { return (numColors == 1); } else { return NO; } } @end @implementation XGContext (Ops) /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { void *windevice = [(XGGState *)gstate windevice]; if (device) *device = windevice; if (x && y) { NSPoint offset = [gstate offset]; *x = offset.x; *y = offset.y; } } - (void) GSSetDevice: (void *)device : (int)x : (int)y { [(XGGState *)gstate setWindowDevice: device]; [gstate setOffset: NSMakePoint(x, y)]; } @end gnustep-back-0.29.0/Source/xlib/XGFont.m000066400000000000000000000247111404163720200177120ustar00rootroot00000000000000/* XGFontInfo NSFont helper for GNUstep GUI X/GPS Backend Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Author: Ovidiu Predescu Date: February 1997 Author: Felipe A. Rodriguez Date: May, October 1998 Author: Michael Hanni Date: August 1998 Author: Fred Kiefer Date: September 2000 This file is part of the GNUstep GUI X/GPS Backend. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "xlib/XGContext.h" #include "xlib/XGPrivate.h" #include "xlib/XGGState.h" #include "x11/XGServer.h" #include #include #include // For the encoding functions #include #include static Atom XA_SLANT = (Atom)0; static Atom XA_SETWIDTH_NAME = (Atom)0; static Atom XA_CHARSET_REGISTRY = (Atom)0; static Atom XA_CHARSET_ENCODING = (Atom)0; static Atom XA_SPACING = (Atom)0; static Atom XA_PIXEL_SIZE = (Atom)0; static Atom XA_WEIGHT_NAME = (Atom)0; /* * Initialise the X atoms we are going to use */ static BOOL XGInitAtoms(Display *dpy) { // X atoms used to query a font if (!dpy) { NSDebugLog(@"No Display opened in XGInitAtoms"); return NO; } XA_PIXEL_SIZE = XInternAtom(dpy, "PIXEL_SIZE", False); XA_SPACING = XInternAtom(dpy, "SPACING", False); XA_WEIGHT_NAME = XInternAtom(dpy, "WEIGHT_NAME", False); XA_SLANT = XInternAtom(dpy, "SLANT", False); XA_SETWIDTH_NAME = XInternAtom(dpy, "SETWIDTH_NAME", False); XA_CHARSET_REGISTRY = XInternAtom(dpy, "CHARSET_REGISTRY", False); XA_CHARSET_ENCODING = XInternAtom(dpy, "CHARSET_ENCODING", False); /* XA_ADD_STYLE_NAME = XInternAtom(dpy, "ADD_STYLE_NAME", False); XA_RESOLUTION_X = XInternAtom(dpy, "RESOLUTION_X", False); XA_RESOLUTION_Y = XInternAtom(dpy, "RESOLUTION_Y", False); XA_AVERAGE_WIDTH = XInternAtom(dpy, "AVERAGE_WIDTH", False); XA_FACE_NAME = XInternAtom(dpy, "FACE_NAME", False); */ return YES; } @interface XGFontInfo (Private) - (BOOL) setupAttributes; - (XCharStruct *)xCharStructForGlyph: (NSGlyph) glyph; @end @implementation XGFontInfo - (XFontStruct*) xFontStruct { return font_info; } - initWithFontName: (NSString*)name matrix: (const CGFloat*)fmatrix screenFont: (BOOL)screenFont { if (screenFont) { RELEASE(self); return nil; } [super init]; ASSIGN(fontName, name); memcpy(matrix, fmatrix, sizeof(matrix)); if (![self setupAttributes]) { RELEASE(self); return nil; } return self; } - (void) dealloc { if (font_info != NULL) { XFreeFont([XGServer xDisplay], font_info); } [super dealloc]; } - (NSMultibyteGlyphPacking)glyphPacking { if (font_info->min_byte1 == 0 && font_info->max_byte1 == 0) return NSOneByteGlyphPacking; else return NSTwoByteGlyphPacking; } - (NSSize) advancementForGlyph: (NSGlyph)glyph { XCharStruct *pc = [self xCharStructForGlyph: glyph]; // if per_char is NULL assume max bounds if (!pc) pc = &(font_info->max_bounds); return NSMakeSize((float)pc->width, 0); } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { XCharStruct *pc = [self xCharStructForGlyph: glyph]; // if per_char is NULL assume max bounds if (!pc) return fontBBox; return NSMakeRect((float)pc->lbearing, (float)-pc->descent, (float)(pc->rbearing - pc->lbearing), (float)(pc->ascent + pc->descent)); } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { XCharStruct *pc = [self xCharStructForGlyph: glyph]; return (pc != NULL); } - (NSGlyph) glyphWithName: (NSString*)glyphName { // FIXME: There is a mismatch between PS names and X names, that we should // try to correct here KeySym k = XStringToKeysym([glyphName cString]); if (k == NoSymbol) return 0; else return (NSGlyph)k; } - (void) drawString: (NSString*)string onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp { XGCValues gcv; NSData *d = [string dataUsingEncoding: mostCompatibleStringEncoding allowLossyConversion: YES]; int length = [d length]; const char *cstr = (const char*)[d bytes]; // Select this font, although it might already be current. gcv.font = font_info->fid; XChangeGC(xdpy, xgcntxt, GCFont, &gcv); // FIXME: Use XDrawString16 for NSTwoByteGlyphPacking XDrawString(xdpy, draw, xgcntxt, xp.x, xp.y, cstr, length); } - (void) draw: (const char*) s length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp { // This font must already be active! XDrawString(xdpy, draw, xgcntxt, xp.x, xp.y, s, len); } - (void) drawGlyphs: (const NSGlyph *) glyphs length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw with: (GC) xgcntxt at: (XPoint) xp { // This font must already be active! char buf[len]; int i; for (i = 0; i < len; i++) { buf[i] = glyphs[i]; } XDrawString(xdpy, draw, xgcntxt, xp.x, xp.y, buf, len); } - (CGFloat) widthOfString: (NSString*)string { NSData *d = [string dataUsingEncoding: mostCompatibleStringEncoding allowLossyConversion: YES]; int length = [d length]; const char *cstr = (const char*)[d bytes]; // FIXME: Use XTextWidth16 for NSTwoByteGlyphPacking return XTextWidth(font_info, cstr, length); } - (CGFloat) widthOf: (const char*) s length: (int) len { return XTextWidth(font_info, s, len); } - (CGFloat) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len { char buf[len]; int i; for (i = 0; i < len; i++) { buf[i] = glyphs[i]; } return XTextWidth(font_info, buf, len); } - (void) setActiveFor: (Display*) xdpy gc: (GC) xgcntxt { XGCValues gcv; // Select this font, although it might already be current. gcv.font = font_info->fid; XChangeGC(xdpy, xgcntxt, GCFont, &gcv); } @end @implementation XGFontInfo (Private) - (BOOL) setupAttributes { Display *xdpy = [XGServer xDisplay]; NSString *reg; long height; NSString *xfontname; if (!xdpy) return NO; if (!XA_PIXEL_SIZE) XGInitAtoms(xdpy); // Retrieve the XLFD matching the given fontName. DPS->X. xfontname = XGXFontName(fontName, matrix[0]); // Load X font and get font info structure. if ((xfontname == nil) || (font_info = XLoadQueryFont(xdpy, [xfontname cString])) == NULL) { NSLog(@"XGFont: selected font: %@ at %f (%@) is not available.\n", fontName, matrix[0], xfontname); return NO; } else NSDebugLLog(@"NSFont", @"Loaded font: %@", xfontname); // Fill the ivars ASSIGN(familyName, XGFontFamily(xdpy, font_info)); isFixedPitch = XGFontIsFixedPitch(xdpy, font_info); isBaseFont = NO; ascender = font_info->ascent; descender = -(font_info->descent); fontBBox = NSMakeRect( (float)(font_info->min_bounds.lbearing), (float)(-font_info->max_bounds.descent), (float)(font_info->max_bounds.rbearing - font_info->min_bounds.lbearing), (float)(font_info->max_bounds.ascent + font_info->max_bounds.descent)); maximumAdvancement = NSMakeSize(font_info->max_bounds.width, 0.0); minimumAdvancement = NSMakeSize(0,0); weight = XGWeightOfFont(xdpy, font_info); traits = XGTraitsOfFont(xdpy, font_info); reg = XGFontPropString(xdpy, font_info, XA_CHARSET_REGISTRY); if (reg != nil) { NSString *enc = XGFontPropString(xdpy, font_info, XA_CHARSET_ENCODING); if (enc != nil) { if ([enc length] != 0 && [enc isEqualToString: @"0"] == NO) { encodingScheme = [NSString stringWithFormat: @"%@-%@", reg, enc]; } else { encodingScheme = reg; } mostCompatibleStringEncoding = [GSMimeDocument encodingFromCharset: encodingScheme]; NSDebugLLog(@"NSFont", @"Found encoding %d for %@", mostCompatibleStringEncoding, encodingScheme); if (mostCompatibleStringEncoding == GSUndefinedEncoding) { mostCompatibleStringEncoding = NSASCIIStringEncoding; } RETAIN(encodingScheme); } } height = XGFontPropULong(xdpy, font_info, XA_X_HEIGHT); if (height != 0) { xHeight = (float)height; } height = XGFontPropULong(xdpy, font_info, XA_CAP_HEIGHT); if (height != 0) { capHeight = (float)height; } // FIXME: italicAngle, underlinePosition, underlineThickness are not set. // Should use XA_ITALIC_ANGLE, XA_UNDERLINE_POSITION, XA_UNDERLINE_THICKNESS return YES; } - (XCharStruct *)xCharStructForGlyph: (NSGlyph) glyph { XCharStruct *pc = NULL; if (font_info->per_char) { unsigned index; unsigned min1 = font_info->min_byte1; unsigned max1 = font_info->max_byte1; unsigned min2 = font_info->min_char_or_byte2; unsigned max2 = font_info->max_char_or_byte2; // glyph is an unicode char value // if the font has non-standard encoding we need to remap it. if ((mostCompatibleStringEncoding != NSASCIIStringEncoding) && (mostCompatibleStringEncoding != NSISOLatin1StringEncoding) && (mostCompatibleStringEncoding != NSUnicodeStringEncoding)) { // FIXME: This only works for 8-Bit characters unsigned int size = 1; unsigned char c = 0; unsigned char *dst = &c; unichar ch = glyph; GSFromUnicode(&dst, &size, &ch, 1, mostCompatibleStringEncoding, 0, 0); index = c; } else { index = glyph; } if (min1 == 0 && max1 == 0) { if (index >= min2 && index <= max2) pc = &(font_info->per_char[index - min2]); } else { unsigned b1 = index >> 8; unsigned b2 = index & 255; if (b1 >= min1 && b1 <= max1 && b2 >= min2 && b2 <= max2) pc = &(font_info->per_char[(b1 - min1) * (max2 - min2 + 1) + b2 - min2]); } } return pc; } @end gnustep-back-0.29.0/Source/xlib/XGFontManager.m000066400000000000000000000137131404163720200212050ustar00rootroot00000000000000/* XGFontManager.m NSFontManager helper for GNUstep GUI X/GPS Backend Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: February 1997 A completely rewritten version of the original source of Scott Christley. Modified: Fred Kiefer Date: Febuary 2000 Added some X calls and changed the overall structure This file is part of the GNUstep GUI X/GPS Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "xlib/XGContext.h" #include "xlib/XGPrivate.h" #include "x11/XGServer.h" #define stringify_it(X) #X @interface NSBundle (Private) // Maybe we should rather use -pathForAuxiliaryExecutable:? + (NSString *) _absolutePathOfExecutable: (NSString *)path; @end static NSMutableDictionary* creationDictionary; // Fills in the size into an creation string to make it an X font name NSString *XGXFontName(NSString *fontName, float size) { NSString *creationName = [creationDictionary objectForKey: fontName]; if (creationName != nil) return [NSString stringWithFormat: creationName, (int)size]; else return nil; } @implementation XGFontEnumerator static NSDictionary *cache; static NSString* cache_name() { static NSString *cacheName = nil; if (cacheName == nil) { NSFileManager *mgr; BOOL flag; Display *dpy = [XGServer xDisplay]; NSString *file_name; NSArray *paths; NSString *path = nil; file_name = XGFontCacheName(dpy); paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); if ((paths != nil) && ([paths count] > 0)) { path = [paths objectAtIndex: 0]; } /* * If standard search paths are not set up, try a default location. */ if (path == nil) { path = [[NSHomeDirectory() stringByAppendingPathComponent: @"GNUstep"] stringByAppendingPathComponent: @"Library"]; } mgr = [NSFileManager defaultManager]; if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { NSLog(@"Library directory '%@' not available!", path); return nil; } path = [path stringByAppendingPathComponent: @"Fonts"]; if ([mgr fileExistsAtPath: path] == NO) { [mgr createDirectoryAtPath: path attributes: nil]; } if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { NSLog(@"Fonts directory '%@' not available!", path); return nil; } path = [path stringByAppendingPathComponent: @"Cache"]; if ([mgr fileExistsAtPath: path] == NO) { [mgr createDirectoryAtPath: path attributes: nil]; } if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { NSLog(@"Fonts directory '%@' not available!", path); return nil; } cacheName = [path stringByAppendingPathComponent: file_name]; RETAIN(cacheName); } return cacheName; } static BOOL load_cache(NSString *cacheName, BOOL async) { NSNumber *v; id o; NS_DURING { o = [NSUnarchiver unarchiveObjectWithFile: cacheName]; } NS_HANDLER { NSLog(@"Exception while attempting to load font cache file %@ - %@: %@", cacheName, [localException name], [localException reason]); o = nil; } NS_ENDHANDLER if ((o == nil) || ((v = [o objectForKey: @"Version"]) == nil) || ([v intValue] != 3)) { NSString *file_name = [cacheName lastPathComponent]; NSString *path; NSTask *task; if (async == NO) { NSLog(@"No font cache available - building new one - this may " @"take several seconds (or minutes on a slow machine with " @"lots of fonts)"); } path = [NSBundle _absolutePathOfExecutable: @"font_cacher"]; if (path == nil) { NSLog(@"Could not find font_cacher program. Please run manually"); return NO; } NSLog(@"Running %@", path); task = [NSTask launchedTaskWithLaunchPath: path arguments: [NSArray arrayWithObject: file_name]]; if (task == nil || async == YES) { return NO; } [task waitUntilExit]; o = [NSUnarchiver unarchiveObjectWithFile: cacheName]; if (o == nil) { NSLog(@"Error - font cache doesn't exist"); return NO; } } else { // Ensure archive is written in latest format. // No longer needed as NSString coding format did not change in // the last two years. //[NSArchiver archiveRootObject: o toFile: cacheName]; } ASSIGN(cache, o); return YES; } - (void) enumerateFontsAndFamilies { if (cache == nil) { if (load_cache(cache_name(), NO)) { allFontNames = RETAIN([[cache objectForKey: @"AllFontNames"] allObjects]); allFontFamilies = [cache objectForKey: @"AllFontFamilies"]; // This dictionary stores the XLFD for each font creationDictionary = [cache objectForKey: @"CreationDictionary"]; } } } @end gnustep-back-0.29.0/Source/xlib/XGFontSetFontInfo.m000066400000000000000000000316521404163720200220330ustar00rootroot00000000000000/* XGFontSetFontInfo NSFont helper for GNUstep X/GPS Backend Copyright (C) 2003-2005 Free Software Foundation, Inc. Author: Kazunobu Kuriyama Date: July 2003 This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "x11/XGServer.h" #include "xlib/XGPrivate.h" #include "xlib/XGFontSetFontInfo.h" #ifdef X_HAVE_UTF8_STRING #define XSERVER [XGServer xDisplay] typedef struct _UTF8Str { char *data; int size; } UTF8Str; #define UTF8StrData(x) ((x)->data) #define UTF8StrSize(x) ((x)->size) #define UTF8StrFree(x) \ do { \ if ((x)->data) \ { \ free((x)->data); \ (x)->data = NULL; \ (x)->size = 0; \ } \ } while (0) #define UTF8StrAlloc(x, length) \ do { (x)->data = malloc(6 * (length)); } while (0) #define UTF8StrUsable(x) ((x)->data != NULL) // Forward declarations static BOOL load_font_set(Display *dpy, const char *given_font_name, XFontSet *font_set, XFontStruct ***fonts, int *num_fonts); static BOOL glyphs2utf8(const NSGlyph* glyphs, int length, UTF8Str* ustr); static BOOL char_struct_for_glyph(NSGlyph glyph, XFontSet font_set, XFontStruct **fonts, int num_fonts, XCharStruct *cs); #if 0 // Commented out till the implementation completes. // ---------------------------------------------------------------------------- // XGFontSetEnumerator // ---------------------------------------------------------------------------- @implementation XGFontSetEnumerator : GSFontEnumerator - (void) enumerateFontsAndFamilies { } @end // XGFontSetEnumerator : GSFontEnumerator #endif // #if 0 // ---------------------------------------------------------------------------- // XGFontSetFontInfo // ---------------------------------------------------------------------------- @implementation XGFontSetFontInfo : GSFontInfo - (id) initWithFontName: (NSString *)name matrix: (const CGFloat*)fmatrix screenFont: (BOOL)screenFont { Display *dpy; XFontSet font_set; XFontStruct **fonts; XFontStruct *base; int num_fonts; if (screenFont) { RELEASE(self); return nil; } if (!name || [name length] == 0 || (dpy = XSERVER) == NULL) { RELEASE(self); return nil; } if (!load_font_set(dpy, [XGXFontName(name, fmatrix[0]) cString], &font_set, &fonts, &num_fonts)) { RELEASE(self); return nil; } base = fonts[0]; // GSFontInfo part [super init]; ASSIGN(fontName, name); ASSIGN(familyName, XGFontFamily(dpy, base)); memcpy(matrix, fmatrix, sizeof(matrix)); italicAngle = 0; underlinePosition = 0; underlineThickness = 0; capHeight = 0; xHeight = 0; descender = -base->descent; ascender = base->ascent; maximumAdvancement = NSMakeSize(base->max_bounds.width, base->max_bounds.ascent + base->max_bounds.descent); minimumAdvancement = NSMakeSize(0, 0); ASSIGN(encodingScheme, @""); mostCompatibleStringEncoding = NSASCIIStringEncoding; fontBBox = NSMakeRect(base->min_bounds.lbearing, -base->max_bounds.descent, base->max_bounds.rbearing - base->max_bounds.lbearing, base->max_bounds.ascent + base->max_bounds.descent); isFixedPitch = XGFontIsFixedPitch(dpy, base); isBaseFont = NO; weight = XGWeightOfFont(dpy, base); traits = XGTraitsOfFont(dpy, base); // XGFontSetFontInfo part _font_set = font_set; _fonts = fonts; _num_fonts = num_fonts; return self; } - (void) dealloc { if (_font_set) { XFreeFontSet(XSERVER, _font_set); _font_set = NULL; } [super dealloc]; } - (NSSize) advancementForGlyph: (NSGlyph)glyph { XCharStruct cs; if (!char_struct_for_glyph(glyph, _font_set, _fonts, _num_fonts, &cs)) { cs.width = _fonts[0]->max_bounds.width; } return NSMakeSize((float)cs.width, 0); } - (NSRect) boundingRectForGlyph: (NSGlyph)glyph { XCharStruct cs; if (!char_struct_for_glyph(glyph, _font_set, _fonts, _num_fonts, &cs)) { return fontBBox; } return NSMakeRect((float)cs.lbearing, (float)-cs.descent, (float)(cs.rbearing - cs.lbearing), (float)(cs.ascent + cs.descent)); } - (BOOL) glyphIsEncoded: (NSGlyph)glyph { XCharStruct cs; return char_struct_for_glyph(glyph, _font_set, _fonts, _num_fonts, &cs); } - (NSGlyph) glyphWithName: (NSString *)glyphName { KeySym k; k = XStringToKeysym([glyphName cString]); if (k == NoSymbol) return 0; else return (NSGlyph)k; } - (void) drawGlyphs: (const NSGlyph *)glyphs length: (int)len onDisplay: (Display *)dpy drawable: (Drawable)win with: (GC)gc at: (XPoint)xp { UTF8Str ustr; if (glyphs2utf8(glyphs, len, &ustr)) { Xutf8DrawString(dpy, win, _font_set, gc, xp.x, xp.y, UTF8StrData(&ustr), UTF8StrSize(&ustr)); UTF8StrFree(&ustr); } } - (CGFloat) widthOfGlyphs: (const NSGlyph *)glyphs length: (int)len { UTF8Str ustr; float val; if (glyphs2utf8(glyphs, len, &ustr)) { XRectangle logical; Xutf8TextExtents(_font_set, UTF8StrData(&ustr), UTF8StrSize(&ustr), NULL, &logical); UTF8StrFree(&ustr); val = logical.width; } else { val = 0.0; } return val; } - (void) setActiveFor: (Display *)dpy gc: (GC)gc { // Do nothing. } @end // XGFontSetFontInfo : GSFontInfo // ---------------------------------------------------------------------------- // Static Functions // ---------------------------------------------------------------------------- static BOOL load_font_set(Display *dpy, const char *given_font_name, XFontSet *font_set, XFontStruct ***fonts, int *num_fonts) { int i; char xlfd[256]; #ifndef STATIC_BUFFER_IS_RELIABLE char *p; #endif int xlfd_num_elms; BOOL has_add_style; char *xlfd_elms[14]; char base_font_name[256]; char **missing_charsets; int num_missing_charsets; char *def_string; char **font_names; int num_font_names; XFontStruct **font_structs; if (!dpy || !given_font_name) { return NO; } strcpy(xlfd, given_font_name); xlfd_num_elms = 14; has_add_style = YES; // Both of the following compilation branches, based on the switch // 'STATIC_BUFFER_IS_RELIABLE', basically do the same thing. Because some // people worry about making use of strtok(), the latter branch is used // primarily unless the switch is explicitly defined somewhere. The former // branch should document what the latter one does. #ifdef STATIC_BUFFER_IS_RELIABLE if (strstr(xlfd, "--")) { --xlfd_num_elms; has_add_style = NO; } i = 0; xlfd_elms[i++] = strtok(xlfd, "-"); while (i < xlfd_num_elms) { xlfd_elms[i++] = strtok(NULL, "-"); } #else // 'STATIC_BUFFER_IS_RELIABLE' not defined i = 0; p = xlfd; do { while (*p != '-') ++p; *p = '\0'; if (*++p == '-') // The token is in the form of '--'. { *p++ = '\0'; --xlfd_num_elms; has_add_style = NO; } xlfd_elms[i] = p; } while (++i < xlfd_num_elms && *p != '\0'); #endif // 'STATIC_BUFFER_IS_RELIABLE' not defined // To let the X server determine a font set automatically, some elements // of the XLFD should be replaced with the wild card. // // N.B. Rigorously speaking, to make use of proportional fonts, we need to // define a mapping from NSGlyph to the XFontStruct's field 'per_char'. // The property 'spacing' is set to "*" until such a mapping is given. // (see also char_struct_for_glyph()). if (has_add_style) { sprintf(base_font_name, "-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s", xlfd_elms[0], // foundry "*", // family xlfd_elms[2], // weight xlfd_elms[3], // slant xlfd_elms[4], // set width xlfd_elms[5], // add style xlfd_elms[6], // pixel size xlfd_elms[7], // point size xlfd_elms[8], // resolutionX xlfd_elms[9], // resolutionY "*", // spacing xlfd_elms[11], // avg width "*", // registry "*" // encoding ); } else { sprintf(base_font_name, "-%s-%s-%s-%s-%s--%s-%s-%s-%s-%s-%s-%s-%s", xlfd_elms[0], // foundry "*", // family xlfd_elms[2], // weight xlfd_elms[3], // slant xlfd_elms[4], // set width xlfd_elms[5], // pixel size xlfd_elms[6], // point size xlfd_elms[7], // resolutionX xlfd_elms[8], // resolutionY "*", // spacing xlfd_elms[10], // avg width "*", // registry "*" // encoding ); } // N.B. def_string is owned by the X server: Don't release it. missing_charsets = NULL; num_missing_charsets = 0; def_string = NULL; *font_set = NULL; *font_set = XCreateFontSet(dpy, base_font_name, &missing_charsets, &num_missing_charsets, &def_string); if (!*font_set) { NSLog(@"XGFontSetFontInfo: Can't create a font set\n"); return NO; } if (num_missing_charsets > 0) { for (i = 0; i < num_missing_charsets; ++i) { NSLog(@"XGFontSetFontInfo: Charset %s is not available\n", missing_charsets[i]); } XFreeStringList(missing_charsets); missing_charsets = NULL; num_missing_charsets = 0; } // N.B. font_structs and font_names are owned by the X server: Don't // release them. num_font_names = 0; font_structs = NULL; font_names = NULL; num_font_names = XFontsOfFontSet(*font_set, &font_structs, &font_names); if (!num_font_names) { NSLog(@"XGFontSetFontInfo: " @"Can't get any information from the font set\n"); return NO; } *fonts = font_structs; *num_fonts = num_font_names; return YES; } // N.B. Use UTF8StrFree() to release the space pointed to by 'ustr'. static BOOL glyphs2utf8(const NSGlyph* glyphs, int length, UTF8Str* ustr) { int i; NSGlyph *g; NSGlyph *end; char *p; if (!glyphs || !length) { return NO; } UTF8StrAlloc(ustr, length); if (!UTF8StrUsable(ustr)) { return NO; } p = UTF8StrData(ustr); i = 0; for (g = (NSGlyph *)glyphs, end = (NSGlyph *)glyphs + length; g < end; ++g) { if (*g < 0x00000080) { p[i++] = *g; } else if (*g < 0x00000800) { p[i++] = 0xc0 | ((*g >> 6) & 0x1f); p[i++] = 0x80 | (*g & 0x3f); } else if (*g < 0x00010000) { p[i++] = 0xe0 | ((*g >> 12) & 0x0f); p[i++] = 0x80 | ((*g >> 6) & 0x3f); p[i++] = 0x80 | (*g & 0x3f); } else if (*g < 0x00200000) { p[i++] = 0xf0 | ((*g >> 18) & 0x07); p[i++] = 0x80 | ((*g >> 12) & 0x3f); p[i++] = 0x80 | ((*g >> 6) & 0x3f); p[i++] = 0x80 | (*g & 0x3f); } else if (*g < 0x04000000) { p[i++] = 0xf8 | ((*g >> 24) & 0x03); p[i++] = 0x80 | ((*g >> 18) & 0x3f); p[i++] = 0x80 | ((*g >> 12) & 0x3f); p[i++] = 0x80 | ((*g >> 6) & 0x3f); p[i++] = 0x80 | (*g & 0x3f); } else if (*g < 0x80000000) { p[i++] = 0xfc | ((*g >> 30) & 0x01); p[i++] = 0x80 | ((*g >> 24) & 0x3f); p[i++] = 0x80 | ((*g >> 18) & 0x3f); p[i++] = 0x80 | ((*g >> 12) & 0x3f); p[i++] = 0x80 | ((*g >> 6) & 0x3f); p[i++] = 0x80 | (*g & 0x3f); } else { // Out of range UTF8StrFree(ustr); return NO; } } UTF8StrSize(ustr) = i; return YES; } static BOOL char_struct_for_glyph(NSGlyph glyph, XFontSet font_set, XFontStruct **fonts, int num_fonts, XCharStruct *cs) { UTF8Str utf8char; if (glyphs2utf8(&glyph, 1, &utf8char)) { XRectangle ink, logical; int num_chars; Xutf8TextPerCharExtents(font_set, UTF8StrData(&utf8char), UTF8StrSize(&utf8char), &ink, &logical, 1, &num_chars, NULL, NULL); UTF8StrFree(&utf8char); if (num_chars != 1) { return NO; } // When the font in use is proportional, the following variables should // be tuned finer based on the the XFontStruct's field 'per_char'. cs->lbearing = 0; cs->rbearing = 0; cs->width = logical.width; cs->ascent = fonts[0]->max_bounds.ascent; cs->descent = fonts[0]->max_bounds.descent; cs->attributes = 0; return YES; } else { return NO; } } #endif // X_HAVE_UTF8_STRING defined gnustep-back-0.29.0/Source/xlib/XGGState.m000066400000000000000000001421441404163720200201740ustar00rootroot00000000000000/* XGGState - Implements graphic state drawing for Xlib Copyright (C) 1998-2010 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import "xlib/XGGeometry.h" #import "xlib/XGContext.h" #import "xlib/XGGState.h" #import "xlib/XGContext.h" #import "xlib/XGPrivate.h" #include "math.h" #define XDPY (((RContext *)context)->dpy) static BOOL shouldDrawAlpha = YES; #define CHECK_GC \ if (!xgcntxt) \ [self createGraphicContext] #define COPY_GC_ON_CHANGE \ CHECK_GC; \ if (sharedGC == YES) \ [self copyGraphicContext] u_long xrRGBToPixel(RContext* context, device_color_t color) { XColor cc; RColor rcolor; rcolor.red = 255. * color.field[0]; rcolor.green = 255. * color.field[1]; rcolor.blue = 255. * color.field[2]; rcolor.alpha = 0; RGetClosestXColor(context, &rcolor, &cc); return cc.pixel; } @interface XGGState (Private) - (void) _alphaBuffer: (gswindow_device_t *)dest_win; - (void) _paintPath: (ctxt_object_t) drawType; - (void) createGraphicContext; - (void) copyGraphicContext; - (void) setAlphaColor: (float)color; @end @implementation XGGState static Region emptyRegion; + (void) initialize { static BOOL beenHere = NO; if (beenHere == NO) { XPoint pts[5]; id obj = [[NSUserDefaults standardUserDefaults] stringForKey: @"GraphicCompositing"]; if (obj) shouldDrawAlpha = [obj boolValue]; beenHere = YES; pts[0].x = 0; pts[0].y = 0; pts[1].x = 0; pts[1].y = 0; pts[2].x = 0; pts[2].y = 0; pts[3].x = 0; pts[3].y = 0; pts[4].x = 0; pts[4].y = 0; emptyRegion = XPolygonRegion(pts, 5, WindingRule); NSAssert(XEmptyRegion(emptyRegion), NSInternalInconsistencyException); } } /* Designated initializer. */ - initWithDrawContext: (GSContext *)drawContext { [super initWithDrawContext: drawContext]; drawMechanism = -1; draw = 0; alpha_buffer = 0; xgcntxt = None; agcntxt = None; #ifdef HAVE_XFT xft_draw = NULL; xft_alpha_draw = NULL; memset(&xft_color, 0, sizeof(XftColor)); #endif return self; } - (void) dealloc { if (sharedGC == NO && xgcntxt) { XFreeGC(XDPY, xgcntxt); } if (agcntxt) XFreeGC(XDPY, agcntxt); if (clipregion) XDestroyRegion(clipregion); #ifdef HAVE_XFT if (xft_draw != NULL) { XftDrawDestroy(xft_draw); } if (xft_alpha_draw != NULL) { XftDrawDestroy(xft_alpha_draw); } #endif [super dealloc]; } - (id) deepen { [super deepen]; // Copy the GC if (draw != 0) [self copyGraphicContext]; /* Force a new one to be created */ agcntxt = None; // Copy the clipregion if (clipregion) { Region region = XCreateRegion(); XIntersectRegion(clipregion, clipregion, region); self->clipregion = region; } #ifdef HAVE_XFT xft_draw = NULL; xft_alpha_draw = NULL; #endif return self; } - (void) setWindowDevice: (void *)device { XGServer *srv; gswindow_device_t *gs_win; gs_win = windevice = device; draw = GET_XDRAWABLE(gs_win); [self setGraphicContext: gs_win->gc]; alpha_buffer = 0; drawingAlpha = NO; /* We know the current server sent us this */ srv = (XGServer *)GSCurrentServer(); context = [srv screenRContext]; drawMechanism = [srv screenDrawMechanism]; if (gs_win != NULL && gs_win->alpha_buffer != 0) { alpha_buffer = gs_win->alpha_buffer; if (shouldDrawAlpha) drawingAlpha = YES; } } - (void) setDrawable: (Drawable)theDrawable; { draw = theDrawable; } - (void) setGraphicContext: (GC)xGraphicContext { GC source; unsigned long mask; BOOL old_shared; source = xgcntxt; old_shared = sharedGC; if (xGraphicContext == None) return; if (xGraphicContext == xgcntxt) return; xgcntxt = xGraphicContext; sharedGC = YES; /* Not sure if we really own the GC */ /* Update the GC to reflect our settings */ if (source == None) return; mask = GCForeground | GCFont | GCFunction | GCFillRule | GCBackground | GCCapStyle | GCJoinStyle | GCLineWidth | GCLineStyle | GCDashOffset | GCDashList; XCopyGC(XDPY, source, mask, xgcntxt); if (source != None && old_shared == NO) XFreeGC(XDPY, source); } /* Set various characteristics of the graphic context */ - (void) setGCValues: (XGCValues)values withMask: (int)mask { COPY_GC_ON_CHANGE; if (xgcntxt == 0) return; XChangeGC(XDPY, xgcntxt, mask, &values); } /* Set the GC clipmask. */ - (void) setClipMask { COPY_GC_ON_CHANGE; if (xgcntxt == 0) return; if (!clipregion) { XSetClipMask(XDPY, xgcntxt, None); return; } XSetRegion(XDPY, xgcntxt, clipregion); NSDebugLLog(@"XGGraphics", @"Clip %@ set to X rect %@", self, NSStringFromRect([self clipRect])); } /* Returns the clip region, which must be freed by the caller */ - (Region) xClipRegion { Region region = XCreateRegion(); if (clipregion) XIntersectRegion(clipregion, clipregion, region); else XIntersectRegion(emptyRegion, emptyRegion, region); return region; } - (void) setColor: (device_color_t *)color state: (color_state_t)cState { device_color_t c; [super setColor: color state: cState]; if (context == NULL) { /* Window device isn't set yet */ return; } c = *color; gsColorToRGB(&c); gcv.foreground = xrRGBToPixel(context, c); [self setGCValues: gcv withMask: GCForeground]; #ifdef HAVE_XFT xft_color.color.red = 65535.0 * c.field[0]; xft_color.color.green = 65535.0 * c.field[1]; xft_color.color.blue = 65535.0 * c.field[2]; xft_color.color.alpha = 0xffff; xft_color.pixel = gcv.foreground; #endif } - (void) setAlphaColor: (float)value { device_color_t color; if (context == NULL) { /* Window device isn't set yet */ return; } gsMakeColor(&color, rgb_colorspace, value, value, value, 0); gcv.foreground = xrRGBToPixel(context, color); if (agcntxt == None) agcntxt = XCreateGC(XDPY, draw, GCForeground, &gcv); else XChangeGC(XDPY, agcntxt, GCForeground, &gcv); #ifdef HAVE_XFT xft_color.color.alpha = 65535.0 * value; #endif } - (void) copyGraphicContext { GC source; unsigned long mask; if (draw == 0) { DPS_ERROR(DPSinvalidid, @"Copying a GC with no Drawable defined"); return; } source = xgcntxt; mask = 0xffffffff; /* Copy everything (Hopefully) */ xgcntxt = XCreateGC(XDPY, draw, 0, NULL); XCopyGC(XDPY, source, mask, xgcntxt); sharedGC = NO; return; } // Create a default graphics context. - (void) createGraphicContext { if (draw == 0) { /* This could happen with a defered window */ DPS_WARN(DPSinvalidid, @"Creating a GC with no Drawable defined"); return; } gcv.function = GXcopy; gcv.background = ((RContext *)context)->white; gcv.foreground = ((RContext *)context)->black; gcv.plane_mask = AllPlanes; gcv.line_style = LineSolid; gcv.fill_style = FillSolid; gcv.fill_rule = WindingRule; xgcntxt = XCreateGC(XDPY, draw, GCFunction | GCForeground | GCBackground | GCPlaneMask | GCFillStyle | GCFillRule| GCLineStyle, &gcv); [self setClipMask]; sharedGC = NO; return; } - (NSRect)clipRect { XRectangle r; r.width = 0; r.height = 0; if (clipregion) XClipBox(clipregion, &r); return NSMakeRect(r.x, r.y, r.width-1, r.height-1); } - (BOOL) hasGraphicContext { return (xgcntxt) ? YES : NO; } - (BOOL) hasDrawable { return (draw ? YES : NO); } - (void *) windevice { return windevice; } - (Drawable) drawable { return draw; } - (GC) graphicContext { return xgcntxt; } #ifdef HAVE_XFT - (XftColor) xftColor { return xft_color; } - (XftDraw *)xftDrawForDrawable: (Drawable)d { if (d == 0) return 0; //PENDING: warn? throw? if (d == draw) { if (xft_draw == NULL) xft_draw = XftDrawCreate(XDPY, d, DefaultVisual(XDPY, DefaultScreen(XDPY)), DefaultColormap(XDPY, DefaultScreen(XDPY))); if (clipregion != None) XftDrawSetClip(xft_draw, clipregion); return xft_draw; } else if (d == alpha_buffer) { if (xft_alpha_draw == NULL) xft_alpha_draw = XftDrawCreate(XDPY, d, DefaultVisual(XDPY, DefaultScreen(XDPY)), DefaultColormap(XDPY, DefaultScreen(XDPY))); if (clipregion != None) XftDrawSetClip(xft_alpha_draw, clipregion); return xft_alpha_draw; } return 0; //PENDING: warn? throw? } #endif - (void) copyBits: (XGGState*)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint { NSAffineTransformStruct sctms; NSAffineTransformStruct ctms; XRectangle dst; XRectangle src; NSRect flushRect; Drawable from; CHECK_GC; if (draw == 0) { DPS_WARN(DPSinvalidid, @"No Drawable defined for copyBits"); return; } from = source->draw; if (from == 0) { DPS_ERROR(DPSinvalidid, @"No source Drawable defined for copyBits"); return; } src = XGViewRectToX(source, aRect); flushRect.size = aRect.size; flushRect.origin = aPoint; dst = XGViewRectToX(self, flushRect); sctms = [source->ctm transformStruct]; ctms = [ctm transformStruct]; if (sctms.m22 < 0 && ctms.m22 > 0) dst.y += src.height; if (sctms.m22 > 0 && ctms.m22 < 0) dst.y -= src.height; NSDebugLLog(@"XGGraphics", @"Copy area from %@ to %@", NSStringFromRect(aRect), NSStringFromPoint(aPoint)); XCopyArea(XDPY, from, draw, xgcntxt, src.x, src.y, src.width, src.height, dst.x, dst.y); } - (void) _alphaBuffer: (gswindow_device_t *)dest_win { if (dest_win->alpha_buffer == 0 && dest_win->type != NSBackingStoreNonretained) { dest_win->alpha_buffer = XCreatePixmap(XDPY, draw, NSWidth(dest_win->xframe), NSHeight(dest_win->xframe), dest_win->depth); /* Fill alpha also (opaque by default) */ [self setAlphaColor: 1.0]; XFillRectangle(XDPY, dest_win->alpha_buffer, agcntxt, 0, 0, NSWidth(dest_win->xframe), NSHeight(dest_win->xframe)); } if (shouldDrawAlpha && dest_win->alpha_buffer != 0) { alpha_buffer = dest_win->alpha_buffer; drawingAlpha = YES; } } - (void) _compositeGState: (XGGState *) source fromRect: (NSRect) fromRect toPoint: (NSPoint) toPoint op: (NSCompositingOperation) op fraction: (CGFloat)delta { XRectangle srect; XRectangle drect; XPoint toXPoint; RXImage *source_im; RXImage *source_alpha; RXImage *dest_im; RXImage *dest_alpha; gswindow_device_t *source_win; gswindow_device_t *dest_win; // --- get source information -------------------------------------------------- NSDebugLLog(@"XGGraphics", @"Composite from %@ to %@", NSStringFromRect(fromRect), NSStringFromPoint(toPoint)); if (!source) source = self; source_win = (gswindow_device_t *)source->windevice; if (!source_win) { DPS_ERROR(DPSinvalidid, @"Invalid composite source gstate"); return; } if (source_win->buffer == 0 && source_win->map_state != IsViewable) { /* Can't get pixel information from a window that isn't mapped */ DPS_ERROR(DPSinvalidaccess, @"Invalid gstate buffer"); return; } // --- get destination information ---------------------------------------------- dest_win = (gswindow_device_t *)windevice; if (!dest_win) { DPS_ERROR(DPSinvalidid, @"Invalid composite gstate"); return; } if (dest_win->buffer == 0 && dest_win->map_state != IsViewable) { /* Why bother drawing? */ return; } // --- determine region to draw -------------------------------------- srect = XGViewRectToX(source, fromRect); toXPoint = XGViewPointToX(self, toPoint); drect.x = toXPoint.x; drect.y = toXPoint.y - srect.height; drect.width = srect.width; drect.height = srect.height; clipXRectsForCopying(source_win, &srect, dest_win, &drect); if (XGIsEmptyRect(drect)) return; // --- get destination XImage ---------------------------------------- if (draw == dest_win->ident && dest_win->visibility < 0) { /* Non-backingstore window isn't visible, so just make up the image */ dest_im = RCreateXImage(context, dest_win->depth, XGWidth(drect), XGHeight(drect)); } else { dest_im = RGetXImage(context, draw, XGMinX(drect), XGMinY (drect), XGWidth (drect), XGHeight (drect)); } if (dest_im->image == 0) {//FIXME: Should not happen, DPS_ERROR (DPSinvalidaccess, @"unable to fetch destination image"); return; } // --- get source XImage --------------------------------------------- source_im = RGetXImage ((RContext *)context, GET_XDRAWABLE (source_win), XGMinX(srect), XGMinY(srect), XGWidth(srect), XGHeight(srect)); // --- create alpha XImage ------------------------------------------- /* Force creation of our alpha buffer */ [self _alphaBuffer: dest_win]; /* Composite it */ source_alpha = RGetXImage((RContext *)context, source_win->alpha_buffer, XGMinX(srect), XGMinY(srect), XGWidth(srect), XGHeight(srect)); if (alpha_buffer) { dest_alpha = RGetXImage((RContext *)context, alpha_buffer, XGMinX(drect), XGMinY(drect), XGWidth(drect), XGHeight(drect)); } else { dest_alpha = NULL; } // --- THE REAL WORK IS DONE HERE! ----------------------------------- { XRectangle xdrect = { 0, 0, XGWidth (drect), XGHeight (drect) }; _pixmap_combine_alpha((RContext *)context, source_im, source_alpha, dest_im, dest_alpha, xdrect, op, drawMechanism, delta); } // --- put result back in the drawable ------------------------------- RPutXImage((RContext *)context, draw, xgcntxt, dest_im, 0, 0, XGMinX(drect), XGMinY(drect), XGWidth(drect), XGHeight(drect)); if (dest_alpha) { RPutXImage((RContext *)context, dest_win->alpha_buffer, xgcntxt, dest_alpha, 0, 0, XGMinX(drect), XGMinY(drect), XGWidth(drect), XGHeight(drect)); RDestroyXImage((RContext *)context, dest_alpha); } // --- clean up ------------------------------------------------------ RDestroyXImage((RContext *)context, dest_im); RDestroyXImage((RContext *)context, source_im); if (source_alpha) RDestroyXImage((RContext *)context, source_alpha); } - (void) compositeGState: (GSGState *)source fromRect: (NSRect)aRect toPoint: (NSPoint)aPoint op: (NSCompositingOperation)op fraction: (CGFloat)delta { BOOL do_copy, source_alpha; XGCValues comp_gcv; if (!source) source = self; /* If we have no drawable, we can't proceed. */ if (draw == 0) { DPS_WARN(DPSinvalidid, @"No Drawable defined for composite"); return; } /* Check alpha */ #define CHECK_ALPHA \ do { \ gswindow_device_t *source_win; \ source_win = (gswindow_device_t *)[(XGGState *)source windevice]; \ source_alpha = (source_win && source_win->alpha_buffer); \ } while (0) do_copy = NO; switch (op) { case NSCompositeClear: do_copy = YES; comp_gcv.function = GXclear; break; case NSCompositeCopy: do_copy = YES; comp_gcv.function = GXcopy; break; case NSCompositeSourceOver: case NSCompositeHighlight: CHECK_ALPHA; if (source_alpha == NO) do_copy = YES; else do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeSourceIn: CHECK_ALPHA; if (source_alpha == NO && drawingAlpha == NO) do_copy = YES; else do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeSourceOut: do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeSourceAtop: CHECK_ALPHA; if (source_alpha == NO && drawingAlpha == NO) do_copy = YES; else do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeDestinationOver: CHECK_ALPHA; if (drawingAlpha == NO) return; else do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeDestinationIn: CHECK_ALPHA; if (source_alpha == NO && drawingAlpha == NO) return; else do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeDestinationOut: do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeDestinationAtop: CHECK_ALPHA; if (source_alpha == NO && drawingAlpha == NO) return; else do_copy = NO; comp_gcv.function = GXcopy; break; case NSCompositeXOR: do_copy = NO; comp_gcv.function = GXxor; break; case NSCompositePlusDarker: do_copy = NO; comp_gcv.function = GXcopy; break; case GSCompositeHighlight: do_copy = NO; comp_gcv.function = GXxor; break; case NSCompositePlusLighter: do_copy = NO; comp_gcv.function = GXcopy; break; default: comp_gcv.function = GXcopy; } if (comp_gcv.function != GXcopy) [self setGCValues: comp_gcv withMask: GCFunction]; if (shouldDrawAlpha == NO) do_copy = YES; if (do_copy) { [self copyBits: (XGGState *)source fromRect: aRect toPoint: aPoint]; } else { [self _compositeGState: (XGGState *)source fromRect: aRect toPoint: aPoint op: op fraction: delta]; } if (comp_gcv.function != GXcopy) { comp_gcv.function = GXcopy; [self setGCValues: comp_gcv withMask: GCFunction]; } } - (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op { CGFloat gray; [self DPScurrentgray: &gray]; if (fabs(gray - 0.667) < 0.005) [self DPSsetgray: 0.333]; else [self DPSsetrgbcolor: 0.121 : 0.121 : 0]; /* FIXME: Really need alpha dithering to do this right - combine with XGBitmapImageRep code? */ switch (op) { case NSCompositeClear: gcv.function = GXclear; break; case NSCompositeCopy: gcv.function = GXcopy; break; case NSCompositeSourceOver: case NSCompositeHighlight: gcv.function = GXcopy; break; case NSCompositeSourceIn: gcv.function = GXcopy; break; case NSCompositeSourceOut: gcv.function = GXcopy; break; case NSCompositeSourceAtop: gcv.function = GXcopy; break; case NSCompositeDestinationOver: gcv.function = GXcopy; break; case NSCompositeDestinationIn: gcv.function = GXcopy; break; case NSCompositeDestinationOut: gcv.function = GXcopy; break; case NSCompositeDestinationAtop: gcv.function = GXcopy; break; case NSCompositeXOR: gcv.function = GXcopy; break; case NSCompositePlusDarker: gcv.function = GXcopy; break; case GSCompositeHighlight: gcv.function = GXxor; break; case NSCompositePlusLighter: gcv.function = GXcopy; break; default: gcv.function = GXcopy; break; } [self setGCValues: gcv withMask: GCFunction]; [self DPSrectfill: NSMinX(aRect) : NSMinY(aRect) : NSWidth(aRect) : NSHeight(aRect)]; if (gcv.function != GXcopy) { gcv.function = GXcopy; [self setGCValues: gcv withMask: GCFunction]; } [self DPSsetgray: gray]; } /* Paint the current path using Xlib calls. All coordinates should already have been transformed to device coordinates. */ - (void) _doPath: (XPoint*)pts : (int)count draw: (ctxt_object_t)type { int fill_rule; COPY_GC_ON_CHANGE; if (draw == 0) { DPS_WARN(DPSinvalidid, @"No Drawable defined for path"); return; } fill_rule = WindingRule; switch (type) { case path_stroke: // Hack: Only draw when alpha is not zero if (drawingAlpha == NO || strokeColor.field[AINDEX] != 0.0) XDrawLines(XDPY, draw, xgcntxt, pts, count, CoordModeOrigin); if (drawingAlpha) { NSAssert(alpha_buffer, NSInternalInconsistencyException); [self setAlphaColor: strokeColor.field[AINDEX]]; XDrawLines(XDPY, alpha_buffer, agcntxt, pts, count, CoordModeOrigin); } break; case path_eofill: fill_rule = EvenOddRule; /* NO BREAK */ case path_fill: gcv.fill_rule = fill_rule; [self setGCValues: gcv withMask: GCFillRule]; // Hack: Only draw when alpha is not zero if (drawingAlpha == NO || fillColor.field[AINDEX] != 0.0) XFillPolygon(XDPY, draw, xgcntxt, pts, count, Complex, CoordModeOrigin); if (drawingAlpha) { NSAssert(alpha_buffer, NSInternalInconsistencyException); [self setAlphaColor: fillColor.field[AINDEX]]; XFillPolygon(XDPY, alpha_buffer, agcntxt, pts, count, Complex, CoordModeOrigin); } break; case path_eoclip: fill_rule = EvenOddRule; /* NO BREAK */ case path_clip: { Region region, new_region; region = XPolygonRegion(pts, count, fill_rule); if (clipregion) { new_region=XCreateRegion(); XIntersectRegion(clipregion, region, new_region); XDestroyRegion(region); XDestroyRegion(clipregion); } else new_region = region; clipregion = new_region; [self setClipMask]; } break; default: break; } } /* fill a complex path. All coordinates should already have been transformed to device coordinates. */ - (void) _doComplexPath: (XPoint*)pts : (int*)types : (int)count ll: (XPoint)ll ur: (XPoint)ur draw: (ctxt_object_t)type { int x, y, i, j, cnt, nseg = 0; XSegment segments[count]; Window root_rtn; unsigned int width, height, b_rtn, d_rtn; COPY_GC_ON_CHANGE; if (draw == 0) { DPS_WARN (DPSinvalidid, @"No Drawable defined for path"); return; } XGetGeometry (XDPY, draw, &root_rtn, &x, &y, &width, &height, &b_rtn, &d_rtn); if (ur.x < x || ll.x > x + (int)width) { return; } if (ll.y < y) { ll.y = y; } if (ur.y > y + (int)height) { ur.y = y + height; } /* draw horizontal lines from the bottom to the top of the path */ for (y = ll.y; y <= ur.y; y++) { int x[count], w[count], y0, y1; int yh = y * 2 + 1; // shift y of horizontal line XPoint lastP, p1; int wi = 0; // To keep compiler happy lastP.x = 0; lastP.y = 0; /* intersect horizontal line with path */ for (i = 0, cnt = 0; i < count - 1; i++) { if (types[i] == 0) // move (new subpath) { lastP = pts[i]; } if (types[i+1] == 0) // last line of subpath { if (lastP.y == pts[i].y) { continue; } p1 = lastP; // close subpath } else { p1 = pts[i+1]; } y0 = pts[i].y * 2; y1 = p1.y * 2; if ((y0 < yh && yh < y1) || (y1 < yh && yh < y0)) { int dy = yh - pts[i].y * 2; int ldy = y1 - y0; int ldx = (p1.x - pts[i].x) * 2; x[cnt] = pts[i].x + (ldx * dy / ldy) / 2; // Get winding for segment if (type == path_fill) { w[cnt] = ((y0 < y1) ? -1 : 1); } cnt++; } } /* sort intersections */ for (i = 0; i < cnt-1; i++) { for (j=i+1; j start line on odd intersection count * winding fill -> start line on odd winding count */ if ((type == path_eofill && !(i%2)) || (type == path_fill && wi)) { segments[nseg].x1 = x[i]; segments[nseg].x2 = x[i+1]; segments[nseg].y1 = segments[nseg].y2 = y; nseg++; } } // Hack: Only draw when alpha is not zero if (drawingAlpha == NO || fillColor.field[AINDEX] != 0.0) XDrawSegments (XDPY, draw, xgcntxt, segments, nseg); if (drawingAlpha) { NSAssert (alpha_buffer, NSInternalInconsistencyException); [self setAlphaColor: fillColor.field[AINDEX]]; XDrawSegments (XDPY, alpha_buffer, agcntxt, segments, nseg); } nseg = 0; } // for y } - (void) _paintPath: (ctxt_object_t) drawType { unsigned count; NSBezierPath *flatPath; XPoint ll, ur; if (!path) { return; } ll.x = ll.y = 0x7FFF; ur.x = ur.y = 0; flatPath = [path bezierPathByFlatteningPath]; count = [flatPath elementCount]; if (count) { XPoint pts[count]; int ts[count]; unsigned j, i = 0; NSBezierPathElement type; NSPoint points[3]; BOOL first = YES; NSPoint p, last_p; BOOL doit; BOOL complex = NO; // To keep compiler happy last_p.x = 0; last_p.y = 0; p.x = 0; p.y = 0; for (j = 0; j < count; j++) { doit = NO; type = [flatPath elementAtIndex: j associatedPoints: points]; switch(type) { case NSMoveToBezierPathElement: if (drawType != path_eofill && drawType != path_fill) { if (i > 1) { [self _doPath: pts : i draw: drawType]; } i = 0; } else if (i > 1) { complex = YES; } last_p = p = points[0]; ts[i] = 0; first = NO; break; case NSLineToBezierPathElement: p = points[0]; ts[i] = 1; if (first) { last_p = points[0]; first = NO; } break; case NSCurveToBezierPathElement: // This should not happen, as we flatten the path p = points[2]; ts[i] = 1; if (first) { last_p = points[2]; first = NO; } break; case NSClosePathBezierPathElement: p = last_p; ts[i] = 1; // doit = YES; if (drawType != path_eofill && drawType != path_fill) { doit = YES; } else { complex = YES; } /* */ break; default: break; } pts[i] = XGWindowPointToX (self, p); if (pts[i].x < ll.x) { ll.x = pts[i].x; } if (pts[i].y > ur.x) { ur.x = pts[i].x; } if (pts[i].y < ll.y) { ll.y = pts[i].y; } if (pts[i].y > ur.y) { ur.y = pts[i].y; } i++; if (doit && i > 1) { if (complex) { [self _doComplexPath: pts : ts : i ll: ll ur: ur draw: drawType]; } else { [self _doPath: pts : i draw: drawType]; } i = 0; } } /* for */ if (i > 1) { if (complex) { [self _doComplexPath: pts : ts : i ll: ll ur: ur draw: drawType]; } else { [self _doPath: pts : i draw: drawType]; } } } /* * clip does not delete the current path, so we only clear the path if the * operation was not a clipping operation. */ if ((drawType != path_clip) && (drawType != path_eoclip)) { [path removeAllPoints]; } } - (XPoint) viewPointToX: (NSPoint)aPoint { return XGViewPointToX(self, aPoint); } - (XRectangle) viewRectToX: (NSRect)aRect { return XGViewRectToX(self, aRect); } - (XPoint) windowPointToX: (NSPoint)aPoint { return XGWindowPointToX(self, aPoint); } - (XRectangle) windowRectToX: (NSRect)aRect { return XGWindowRectToX(self, aRect); } @end @implementation XGGState (Ops) - (void) DPSsetalpha: (CGFloat)a { gswindow_device_t *gs_win; [super DPSsetalpha: a]; gs_win = (gswindow_device_t *)windevice; if (!gs_win) return; if (fillColor.field[AINDEX] < 1.0) [self _alphaBuffer: gs_win]; } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ - (void)DPSshow: (const char *)s { int len; int width; NSSize scale; XPoint xp; if (font == nil) { NSLog(@"DPS (xgps): no font set\n"); return; } COPY_GC_ON_CHANGE; if (draw == 0) { DPS_WARN(DPSinvalidid, @"No Drawable defined for show"); return; } if ((cstate & COLOR_FILL) == 0) [self setColor: &fillColor state: COLOR_FILL]; len = strlen(s); width = [(XGFontInfo *)font widthOf: s length: len]; xp = XGWindowPointToX(self, [path currentPoint]); // Hack: Only draw when alpha is not zero if (drawingAlpha == NO || fillColor.field[AINDEX] != 0.0) [(XGFontInfo *)font draw: s length: len onDisplay: XDPY drawable: draw with: xgcntxt at: xp]; if (drawingAlpha) { NSAssert(alpha_buffer, NSInternalInconsistencyException); [self setAlphaColor: fillColor.field[AINDEX]]; [(XGFontInfo *)font draw: s length: len onDisplay: XDPY drawable: alpha_buffer with: agcntxt at: xp]; } /* Note we update the current point according to the current transformation scaling, although the text isn't currently scaled (FIXME). */ scale = [ctm transformSize: NSMakeSize(1, 1)]; //scale = NSMakeSize(1, 1); [path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)]; } - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { // FIXME: Currently advances is ignored int width; NSSize scale; XPoint xp; if (font == nil) { NSLog(@"DPS (xgps): no font set\n"); return; } COPY_GC_ON_CHANGE; if (draw == 0) { DPS_WARN(DPSinvalidid, @"No Drawable defined for show"); return; } if ((cstate & COLOR_FILL) == 0) [self setColor: &fillColor state: COLOR_FILL]; width = [(XGFontInfo *)font widthOfGlyphs: glyphs length: length]; xp = XGWindowPointToX(self, [path currentPoint]); // Hack: Only draw when alpha is not zero if (drawingAlpha == NO || fillColor.field[AINDEX] != 0.0) [(XGFontInfo *)font drawGlyphs: glyphs length: length onDisplay: XDPY drawable: draw with: xgcntxt at: xp]; if (drawingAlpha) { NSAssert(alpha_buffer, NSInternalInconsistencyException); [self setAlphaColor: fillColor.field[AINDEX]]; [(XGFontInfo *)font drawGlyphs: glyphs length: length onDisplay: XDPY drawable: alpha_buffer with: agcntxt at: xp]; } /* Note we update the current point according to the current transformation scaling, although the text isn't currently scaled (FIXME). */ scale = [ctm transformSize: NSMakeSize(1, 1)]; //scale = NSMakeSize(1, 1); [path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)]; } - (void) GSSetFont: (GSFontInfo *)newFont { if (font == newFont) return; [super GSSetFont: newFont]; COPY_GC_ON_CHANGE; if (xgcntxt == 0) return; [(XGFontInfo *)font setActiveFor: XDPY gc: xgcntxt]; } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - (void)DPScurrentlinecap: (int *)linecap { *linecap = gcv.cap_style - CapButt; } - (void)DPScurrentlinejoin: (int *)linejoin { *linejoin = gcv.join_style - JoinMiter; } - (void)DPScurrentlinewidth: (CGFloat *)width { *width = gcv.line_width; } - (void)DPSinitgraphics { [super DPSinitgraphics]; if (clipregion) XDestroyRegion(clipregion); clipregion = 0; } - (void)DPSsetdash: (const CGFloat *)pat : (NSInteger)size : (CGFloat)pat_offset { int dash_offset; char dash_list[size]; int i; if ((pat == NULL) || (size == 0)) { gcv.line_style = LineSolid; [self setGCValues: gcv withMask: GCLineStyle]; return; } gcv.line_style = LineOnOffDash; [self setGCValues: gcv withMask: GCLineStyle]; // FIXME: How to convert those values? dash_offset = (int)pat_offset; for (i = 0; i < size; i++) { dash_list[i] = (char)pat[i]; } // We can only set the dash pattern, if xgcntxt exists. if (xgcntxt == 0) return; XSetDashes(XDPY, xgcntxt, dash_offset, dash_list, size); } - (void)DPSsetlinecap: (int)linecap { gcv.cap_style = linecap + CapButt; [self setGCValues: gcv withMask: GCCapStyle]; } - (void)DPSsetlinejoin: (int)linejoin { gcv.join_style = linejoin + JoinMiter; [self setGCValues: gcv withMask: GCJoinStyle]; } - (void)DPSsetlinewidth: (CGFloat)width { int w; NSSize ws; ws = [ctm transformSize: NSMakeSize(width,width)]; width = (ws.width + ws.height) / 2; /* * Evil hack to get drawing to work - with a line thickness of 1, the * rectangles we draw seem to lose their bottom right corners irrespective * of the join/cap settings - but with a thickness of zero things work. */ if (width < 1.5) width = 0.0; w = (int)width; if (gcv.line_width != w) { gcv.line_width = w; [self setGCValues: gcv withMask: GCLineWidth]; } } - (void) DPSsetmiterlimit: (CGFloat)limit { /* Do nothing. X11 does its own thing and doesn't give us a choice */ } /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ - (void)DPSclip { [self _paintPath: path_clip]; } - (void)DPSeoclip { [self _paintPath: path_eoclip]; } - (void)DPSeofill { if (pattern != nil) { [self eofillPath: path withPattern: pattern]; return; } if ((cstate & COLOR_FILL) == 0) [self setColor: &fillColor state: COLOR_FILL]; [self _paintPath: path_eofill]; } - (void)DPSfill { if (pattern != nil) { [self fillPath: path withPattern: pattern]; return; } if ((cstate & COLOR_FILL) == 0) [self setColor: &fillColor state: COLOR_FILL]; [self _paintPath: path_fill]; } - (void)DPSinitclip { if (clipregion) XDestroyRegion(clipregion); clipregion = 0; [self setClipMask]; } - (void)DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { XRectangle xrect; NSRect orect; CHECK_GC; orect = NSMakeRect(x, y, w, h); xrect = XGViewRectToX(self, orect); if (clipregion == 0) { clipregion = XCreateRegion(); XUnionRectWithRegion(&xrect, clipregion, clipregion); } else { Region region; region = XCreateRegion(); XUnionRectWithRegion(&xrect, region, region); XIntersectRegion(clipregion, region, clipregion); XDestroyRegion(region); } [self setClipMask]; [self DPSnewpath]; } - (void)DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { XRectangle bounds; CHECK_GC; if (draw == 0) { DPS_WARN(DPSinvalidid, @"No Drawable defined for drawing"); return; } if (pattern != nil) { NSBezierPath *rpath; rpath = [[NSBezierPath alloc] init]; [rpath appendBezierPathWithRect: NSMakeRect(x, y, w, h)]; [rpath transformUsingAffineTransform: ctm]; [self fillPath: rpath withPattern: pattern]; RELEASE(rpath); return; } if ((cstate & COLOR_FILL) == 0) [self setColor: &fillColor state: COLOR_FILL]; bounds = XGViewRectToX(self, NSMakeRect(x, y, w, h)); NSDebugLLog(@"XGGraphics", @"Fill %@ X rect %d,%d,%d,%d", self, bounds.x, bounds.y, bounds.width, bounds.height); // Hack: Only draw when alpha is not zero if (drawingAlpha == NO || fillColor.field[AINDEX] != 0.0) XFillRectangle(XDPY, draw, xgcntxt, bounds.x, bounds.y, bounds.width, bounds.height); if (drawingAlpha) { /* Fill alpha also */ NSAssert(alpha_buffer, NSInternalInconsistencyException); [self setAlphaColor: fillColor.field[AINDEX]]; XFillRectangle(XDPY, alpha_buffer, agcntxt, bounds.x, bounds.y, bounds.width, bounds.height); } } - (void)DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { XRectangle bounds; CHECK_GC; if (draw == 0) { DPS_WARN(DPSinvalidid, @"No Drawable defined for drawing"); return; } if ((cstate & COLOR_STROKE) == 0) [self setColor: &fillColor state: COLOR_STROKE]; bounds = XGViewRectToX(self, NSMakeRect(x, y, w, h)); // Hack: Only draw when alpha is not zero if (drawingAlpha == NO || strokeColor.field[AINDEX] != 0.0) XDrawRectangle(XDPY, draw, xgcntxt, bounds.x, bounds.y, bounds.width, bounds.height); if (drawingAlpha) { /* Fill alpha also */ NSAssert(alpha_buffer, NSInternalInconsistencyException); [self setAlphaColor: strokeColor.field[AINDEX]]; XDrawRectangle(XDPY, alpha_buffer, agcntxt, bounds.x, bounds.y, bounds.width, bounds.height); } } - (void)DPSstroke { if ((cstate & COLOR_STROKE) == 0) [self setColor: &fillColor state: COLOR_STROKE]; [self _paintPath: path_stroke]; } /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ - (void)DPSimage: (NSAffineTransform*) matrix : (NSInteger) pixelsWide : (NSInteger) pixelsHigh : (NSInteger) bitsPerSample : (NSInteger) samplesPerPixel : (NSInteger) bitsPerPixel : (NSInteger) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data { BOOL one_is_black, fast_min; NSRect rect; XRectangle sr, dr, cr; RXImage *dest_im, *dest_alpha; gswindow_device_t *dest_win; int cspace; NSAffineTransform *old_ctm = nil; // FIXME for now we hard code the minification behaviour fast_min = YES; rect = NSZeroRect; one_is_black = NO; cspace = rgb_colorspace; rect.size.width = (CGFloat) pixelsWide; rect.size.height = (CGFloat) pixelsHigh; // default is 8 bit grayscale if (!bitsPerSample) bitsPerSample = 8; if (!samplesPerPixel) samplesPerPixel = 1; // FIXME - does this work if we are passed a planar image but no hints ? if (!bitsPerPixel) bitsPerPixel = bitsPerSample * samplesPerPixel; if (!bytesPerRow) bytesPerRow = (bitsPerPixel * pixelsWide) / 8; /* make sure its sane - also handles row padding if hint missing */ while ((bytesPerRow * 8) < (bitsPerPixel * pixelsWide)) bytesPerRow++; /* get the colour space */ if (colorSpaceName) { if ([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] || [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) cspace = rgb_colorspace; else if ([colorSpaceName isEqualToString: NSDeviceCMYKColorSpace]) cspace = cmyk_colorspace; else if ([colorSpaceName isEqualToString: NSDeviceWhiteColorSpace] || [colorSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) cspace = gray_colorspace; else if ([colorSpaceName isEqualToString: NSDeviceBlackColorSpace] || [colorSpaceName isEqualToString: NSCalibratedBlackColorSpace]) { cspace = gray_colorspace; one_is_black = YES; } else { // if we dont recognise the name use RGB or greyscale as appropriate NSLog(@"XGContext (DPSImage): Unknown colour space %@", colorSpaceName); if (samplesPerPixel > 2) cspace = rgb_colorspace; else cspace = gray_colorspace; } } // Apply the additional transformation if (matrix) { old_ctm = [ctm copy]; [ctm prependTransform: matrix]; } // --- Get our drawable info ----------------------------------------- dest_win = (gswindow_device_t *)windevice; if (!dest_win) { DPS_ERROR(DPSinvalidid, @"Invalid image gstate"); return; } // --- Determine screen coverage -------------------------------------- sr = [self viewRectToX: rect]; // --- Determine region to draw -------------------------------------- if (clipregion) XClipBox (clipregion, &cr); else cr = sr; dr = XGIntersectionRect (sr, cr); // --- If there is nothing to draw return ---------------------------- if (XGIsEmptyRect (dr)) { if (old_ctm != nil) { RELEASE(ctm); // old_ctm is already retained ctm = old_ctm; } return; } if (dest_win->buffer == 0 && dest_win->map_state != IsViewable) { if (old_ctm != nil) { RELEASE(ctm); // old_ctm is already retained ctm = old_ctm; } return; } // --- Get the destination images ------------------------------------ dest_im = RGetXImage ((RContext *)context, draw, XGMinX (dr), XGMinY (dr), XGWidth (dr), XGHeight (dr)); // Force creation of our alpha buffer if (hasAlpha) { [self _alphaBuffer: dest_win]; } // Composite it if (alpha_buffer != 0) { dest_alpha = RGetXImage ((RContext *)context, alpha_buffer, XGMinX (dr), XGMinY (dr), XGWidth (dr), XGHeight (dr)); } else { dest_alpha = 0; } if (hasAlpha && alpha_buffer && (dest_alpha == 0 || dest_alpha->image == 0)) { NSLog(@"XGContext (DPSimage): Cannot create alpha image\n"); if (old_ctm != nil) { RELEASE(ctm); // old_ctm is already retained ctm = old_ctm; } return; } // --- The real work is done HERE ------------------------------------ _bitmap_combine_alpha((RContext *)context, (unsigned char **)data, pixelsWide, pixelsHigh, bitsPerSample, samplesPerPixel, bitsPerPixel, bytesPerRow, cspace, one_is_black, isPlanar, hasAlpha, fast_min, dest_im, dest_alpha, sr, dr, 0, drawMechanism); /* Draw into the window/buffer */ RPutXImage((RContext *)context, draw, xgcntxt, dest_im, 0, 0, XGMinX (dr), XGMinY (dr), XGWidth (dr), XGHeight (dr)); if (dest_alpha) { RPutXImage((RContext *)context, dest_win->alpha_buffer, xgcntxt, dest_alpha, 0, 0, XGMinX (dr), XGMinY (dr), XGWidth (dr), XGHeight (dr)); RDestroyXImage((RContext *)context, dest_alpha); } RDestroyXImage((RContext *)context, dest_im); if (old_ctm != nil) { RELEASE(ctm); // old_ctm is already retained ctm = old_ctm; } } - (NSDictionary *) GSReadRect: (NSRect)rect { NSSize ssize; XRectangle srect; RXImage *source_im; RXImage *source_alpha; gswindow_device_t *source_win; NSMutableDictionary *dict; NSData *data; NSAffineTransform *matrix; source_win = (gswindow_device_t *)windevice; if (!source_win) { DPS_ERROR(DPSinvalidid, @"Invalid read gstate"); return nil; } if (source_win->buffer == 0 && source_win->map_state != IsViewable) { /* Can't read anything */ DPS_ERROR(DPSinvalidid, @"Invalid window not readable"); return nil; } dict = [NSMutableDictionary dictionary]; // --- determine region to read -------------------------------------- rect.origin = [ctm transformPoint: rect.origin]; srect = XGWindowRectToX(self, rect); srect = XGIntersectionRect (srect, accessibleRectForWindow (source_win)); ssize.width = srect.width; ssize.height = srect.height; [dict setObject: [NSValue valueWithSize: ssize] forKey: @"Size"]; [dict setObject: NSDeviceRGBColorSpace forKey: @"ColorSpace"]; [dict setObject: [NSNumber numberWithUnsignedInt: 8] forKey: @"BitsPerSample"]; [dict setObject: [NSNumber numberWithUnsignedInt: source_win->depth] forKey: @"Depth"]; [self _alphaBuffer: source_win]; if (alpha_buffer) { [dict setObject: [NSNumber numberWithUnsignedInt: 4] forKey: @"SamplesPerPixel"]; [dict setObject: [NSNumber numberWithUnsignedInt: 1] forKey: @"HasAlpha"]; } else { [dict setObject: [NSNumber numberWithUnsignedInt: 3] forKey: @"SamplesPerPixel"]; [dict setObject: [NSNumber numberWithUnsignedInt: 0] forKey: @"HasAlpha"]; } matrix = [ctm copy]; [matrix translateXBy: -srect.x - offset.x yBy: srect.y + srect.height - offset.y]; [dict setObject: matrix forKey: @"Matrix"]; DESTROY(matrix); if (XGIsEmptyRect(srect)) return dict; // --- get source XImage ---------------------------------------- if (draw == source_win->ident && source_win->visibility < 0) { /* Non-backingstore window isn't visible, so we can't read it. */ return nil; } else { source_im = RGetXImage(context, draw, XGMinX(srect), XGMinY (srect), XGWidth (srect), XGHeight (srect)); } if (source_im->image == 0) { // Should not happen, return nil; } if (alpha_buffer) { source_alpha = RGetXImage((RContext *)context, alpha_buffer, XGMinX(srect), XGMinY(srect), XGWidth(srect), XGHeight(srect)); } else { source_alpha = NULL; } data = _pixmap_read_alpha(context, source_im, source_alpha, srect, drawMechanism); [dict setObject: data forKey: @"Data"]; /* Pixmap routine always returns image in same format (FIXME?). */ // --- clean up ------------------------------------------------------ RDestroyXImage((RContext *)context, source_im); RDestroyXImage((RContext *)context, source_alpha); return dict; } @end @implementation XGGState (PatternColor) - (void *) saveClip { if (clipregion) { Region region = XCreateRegion(); XIntersectRegion(clipregion, clipregion, region); return region; } return clipregion; } - (void) restoreClip: (void *)savedClip { if (clipregion) { XDestroyRegion(clipregion); } clipregion = savedClip; [self setClipMask]; } @end gnustep-back-0.29.0/Source/xlib/XGGeometry.m000066400000000000000000000112271404163720200205750ustar00rootroot00000000000000/* XGGeometry - Utility functions that calculate in device space Copyright (C) 2002 Free Software Foundation, Inc. Written by: Willem Oudshoorn This file is part of the GNU Objective C User Interface Library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include "xlib/XGGeometry.h" #include "x11/XGServer.h" /** * Returns the area that is accessible in the underlying drawable * of win. * * Accessible means that we can use XPutPixel and XGetPixel * on all the points in the result. * If the window uses a backingstore this will be the size * of the underlying drawable, but if the window does not * use backing store and the window is partly outside the screen * it will be the part of the window that falls inside the screen. * * NOTE: * Unfortunately, the gswindow_device_t does not contain a reference * to the XDisplay it is displayed on and we need it. */ XRectangle accessibleRectForWindow (gswindow_device_t* win) { Display* xdpy = [XGServer xDisplay]; Window root; Window ignoreWindow; int x, y; unsigned int w, h; int ignoreInt; unsigned int ignoreUInt; XRectangle winRect; if (!XGetGeometry (xdpy, GET_XDRAWABLE (win), &root, &x, &y, &w, &h, &ignoreUInt, &ignoreUInt)) { NSDebugLLog (@"XGGeometry", @"invalid Drawable in gswindow_device"); return XGMakeRect (0, 0, 0, 0); } winRect = XGMakeRect (0, 0, w, h); if (win->buffer) { return winRect; } // we do not have backing store, so clip it to the screen. if (!XGetGeometry (xdpy, root, &root, &ignoreInt, &ignoreInt, &w, &h, &ignoreUInt, &ignoreUInt)) { NSDebugLLog (@"XGGeometry", @"could not determine size of root"); return XGMakeRect (0, 0, 0, 0); } if (!XTranslateCoordinates (xdpy, root, GET_XDRAWABLE (win), 0, 0, &x, &y, &ignoreWindow)) { NSDebugLLog (@"XGGeometry", @"could not determine position of device"); return XGMakeRect (0, 0, 0, 0); } return XGIntersectionRect (winRect, XGMakeRect (x, y, w, h)); } /** * * POST CONDITIONS * winA and winB are unmodified * rectA and rectB have the same size * rectA is an accessible rectangle in winA * rectB is an accessible rectangle in winB * rectA is a subrectangle of the argument rectA * rectB is a subrectangle of the argument rectB * the size of RectA and rectB are maximal with respect to the conditions above. * * USAGE * typical usage will be in copy operations between one gswindow_device to * another gswindow_device. This because the result will be the maximal * region that we are able to copy without generating X-protocol errors * or segfaults. */ void clipXRectsForCopying (gswindow_device_t* winA, XRectangle* rectA, gswindow_device_t* winB, XRectangle* rectB) { XPoint shiftA, shiftB; // First make A smaller. shiftA.x = rectA->x; shiftA.y = rectA->y; *rectA = XGIntersectionRect (*rectA, accessibleRectForWindow (winA)); // update size of B with the size of A rectB->x += rectA->x - shiftA.x; rectB->y += rectA->y - shiftA.y; rectB->width = MIN (rectA->width, rectB->width); rectB->height = MIN (rectA->height, rectB->height); // now make B smaller shiftB.x = rectB->x; shiftB.y = rectB->y; *rectB = XGIntersectionRect (*rectB, accessibleRectForWindow (winB)); // and update size of A with size of B rectA->x += rectB->x - shiftB.x; rectA->y += rectB->y - shiftB.y; rectA->width = rectB->width; rectA->height = rectB->height; } gnustep-back-0.29.0/Source/xlib/linking.m000066400000000000000000000024551404163720200202010ustar00rootroot00000000000000/* linking Copyright (C) 2005 Free Software Foundation, Inc. Author: Adam Fedor This file is part of the GNU Objective C User Interface library. 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 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; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "xlib/XGContext.h" //extern void __objc_xgps_gsbackend_linking (void); extern void __objc_xgcontextwindow_linking (void); extern void __objc_xgcontextevent_linking (void); void __objc_xgps_linking(void) { //__objc_xgps_gsbackend_linking(); __objc_xgcontextwindow_linking(); __objc_xgcontextevent_linking(); } gnustep-back-0.29.0/Tools/000077500000000000000000000000001404163720200152645ustar00rootroot00000000000000gnustep-back-0.29.0/Tools/.cvsignore000066400000000000000000000000711404163720200172620ustar00rootroot00000000000000shared_debug_obj shared_obj xdnd.c xdnd.h XGCommonFont.m gnustep-back-0.29.0/Tools/GNUmakefile000066400000000000000000000034171404163720200173430ustar00rootroot00000000000000# # Tools level makefile for GNUstep Backend Library # # Copyright (C) 1997,1999 Free Software Foundation, Inc. # # Author: Scott Christley # # This file is part of the GNUstep GUI Library. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-back GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../back.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ../config.make # The applications to be compiled TOOL_NAME = gpbs # The source files to be compiled gpbs_OBJC_FILES = gpbs.m font_cacher_OBJC_FILES = font_cacher.m MAN1_PAGES = gpbs.1 ifeq ($(BUILD_GRAPHICS),xlib) ifeq ($(WITH_XFT),no) TOOL_NAME += font_cacher MAN1_PAGES += font_cacher.1 endif endif ifeq ($(BUILD_SERVER),x11) gpbs_OBJC_FILES += xpbs.m ifeq ($(BACKEND_BUNDLE),yes) font_cacher_OBJC_FILES += XGCommonFont.m gpbs_C_FILES += xdnd.c endif endif ifeq ($(BUILD_SERVER),win32) gpbs_OBJC_FILES += win32pbs.m endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble gnustep-back-0.29.0/Tools/GNUmakefile.postamble000066400000000000000000000046361404163720200213340ustar00rootroot00000000000000# # GNUmakefile.postamble # # Copyright (C) 1997-2005 Free Software Foundation, Inc. # # This file is part of the GNUstep User Interface Library. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling before-all:: -$(RM) XGCommonFont.m $(LN_S) ../Source/xlib/XGCommonFont.m . -$(RM) xdnd.c $(LN_S) ../Source/x11/xdnd.c . # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing after-install:: if [ ! -f $(GNUSTEP_DOC_MAN) ]; then \ $(MKDIRS) $(GNUSTEP_DOC_MAN); \ fi; \ if [ ! -f $(GNUSTEP_DOC_MAN)/man1 ]; then \ $(MKDIRS) $(GNUSTEP_DOC_MAN)/man1; \ fi; \ for file in $(MAN1_PAGES) __done; do \ if [ $$file != __done ]; then \ $(INSTALL_DATA) $$file $(GNUSTEP_DOC_MAN)/man1/$$file; \ which gzip && rm -f $(GNUSTEP_DOC_MAN)/man1/$$file.gz \ && gzip -9 $(GNUSTEP_DOC_MAN)/man1/$$file; \ fi; \ done; # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling after-uninstall:: for file in $(MAN1_PAGES) __done; do \ if [ $$file != __done ]; then \ rm -f $(GNUSTEP_DOC_MAN)/man1/$$file.gz; \ fi; \ done; # Things to do before cleaning # before-clean:: # Things to do after cleaning after-clean:: -$(RM) XGCommonFont.m -$(RM) xdnd.c # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: gnustep-back-0.29.0/Tools/GNUmakefile.preamble000066400000000000000000000042761404163720200211350ustar00rootroot00000000000000# # GNUmakefile.preamble # # Project specific makefile variables, and additional # # Copyright (C) 1997-2005 Free Software Foundation, Inc. # # This file is part of the GNUstep User Interface Library. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # Do not put any Makefile rules in this file, instead they should # be put into Makefile.postamble. # # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor #ADDITIONAL_CPPFLAGS += # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS += -Wall # Additional flags to pass to the C compiler #ADDITIONAL_CFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../Headers -I../Source/$(GNUSTEP_TARGET_DIR) # Additional LDFLAGS to pass to the linker # ADDITIONAL_LDFLAGS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) # Additional libraries when linking applications #ADDITIONAL_GUI_LIBS += # # Flags dealing with installing and uninstalling # # Additional directories to be created during installation ADDITIONAL_INSTALL_DIRS += # Flags for when the backend is compiled as a bundle ifneq ($(BACKEND_BUNDLE),) ADDITIONAL_TOOL_LIBS += $(GUI_LIBS) $(GRAPHIC_LIBS) $(SYSTEM_LIBS) CONFIG_SYSTEM_INCL += $(GRAPHIC_CFLAGS) CONFIG_SYSTEM_LIB_DIR += $(GRAPHIC_LFLAGS) else ADDITIONAL_TOOL_LIBS += -lgnustep-gui -lgnustep-back $(SYSTEM_LIBS) endif gnustep-back-0.29.0/Tools/font_cacher.1000066400000000000000000000035421404163720200176250ustar00rootroot00000000000000.\"font_cacher(1) man page .\"Written by Yavor Doganov .\"Copyright (C) 2018 Free Software Foundation, Inc. .\"License: GPL-3+ .TH FONT_CACHER 1 "February 2018" GNUstep "GNUstep System Manual" .SH NAME font_cacher \- font cacher for the GNUstep xlib Backend .SH SYNOPSIS \fBfont_cacher\fR [\fIoptions\fR] .PP .SH DESCRIPTION The .B font_cacher program generates a cache from all available X fonts. The cache is stored in .I $HOME/GNUstep/Library/Fonts/Cache and is used only by the GNUstep xlib backend. The xlib backend will automatically launch .B font_cacher if the cache is not available or cannot be accessed. This can cause some slowness when a GNUstep application is started for the first time with xlib configured as backend. .PP Normally, the .B font_cacher program is used without options. .PP .SH OPTIONS .TP \fB\--version\fR Displays version information. (Not implemented.) .TP \fB\--help\fR Prints the exact location of the file where the font cache will be written. .TP \fB\--GNU-Debug=\fR\fIdflt\fR Displays progress and other debugging information while generating the cache. (This is a global .I GNUstep option.) .PP .SH BUGS AND LIMITATIONS If .I $HOME/GNUstep/Library does not exist, .B font_cacher will fail and the directory must be created manually. .PP When fonts are installed or removed, the program must be invoked explicitly to update the cache. There is no way to handle this automatically. .PP .SH SEE ALSO Defaults related to the GNUstep Backend: .I $GNUSTEP_DOC/Developer/Back/General/DefaultsSummary.html .PP .SH AUTHORS .B font_cacher was written by Fred Kiefer and Richard Frith-Macdonald . .PP This manual page was written by Yavor Doganov . .SH COPYING \(co 2018 Free Software Foundation, Inc. .PP This manual page is distributed under the same license as the .B font_cacher program. gnustep-back-0.29.0/Tools/font_cacher.m000066400000000000000000000356111404163720200177230ustar00rootroot00000000000000/* Font cacher for GNUstep GUI X/GPS Backend Copyright (C) 2000 Free Software Foundation, Inc. Author: Fred Kiefer and Richard Frith-Macdonald Date: Febuary 2000 This file is part of the GNUstep GUI X/GPS Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include "xlib/XGPrivate.h" #define stringify_it(X) #X #define makever(X) stringify_it(X) @interface XFontCacher : NSObject { NSMutableSet *allFontNames; NSMutableDictionary *allFontFamilies; NSMutableDictionary *creationDictionary; NSMutableDictionary *xFontDictionary; NSMutableSet *knownFonts; Display *dpy; } - (NSString*) faceNameFromParts: (NSArray*) parts; - (NSString*) creationNameFromParts: (NSArray*) parts; - (NSString*) getPathFor: (NSString*) display; - (BOOL) fontLoop; - (BOOL) processPattern: (const char *) pattern; - (void) processFont: (char*) name; - (void) sortResults; - (void) writeCacheTo: (NSString*)path; @end @implementation XFontCacher - (id) init { allFontNames = RETAIN([NSMutableSet setWithCapacity: 1000]); allFontFamilies = RETAIN([NSMutableDictionary dictionaryWithCapacity: 1000]); creationDictionary = RETAIN([NSMutableDictionary dictionaryWithCapacity: 1000]); xFontDictionary = RETAIN([NSMutableDictionary dictionaryWithCapacity: 1000]); knownFonts = RETAIN([NSMutableSet setWithCapacity: 1000]); return self; } - (void) dealloc { RELEASE(allFontNames); RELEASE(allFontFamilies); RELEASE(creationDictionary); RELEASE(xFontDictionary); RELEASE(knownFonts); if (dpy) XCloseDisplay(dpy); [super dealloc]; } /* * Find a suitable type face name for a full X font name, which * has already been split into parts seperated by - * -sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1 * becomes Normal */ - (NSString*) faceNameFromParts: (NSArray*) parts { NSString *faceName; NSString *face = [[parts objectAtIndex: 3] capitalizedString]; NSString *slant = [[parts objectAtIndex: 4] capitalizedString]; NSString *weight = [[parts objectAtIndex: 5] capitalizedString]; NSString *add = [[parts objectAtIndex: 6] capitalizedString]; if ([face length] == 0 || [face isEqualToString: @"Medium"]) faceName = @""; else faceName = face; if ([slant isEqualToString: @"I"]) faceName = [NSString stringWithFormat: @"%@%@", faceName, @"Italic"]; else if ([slant isEqualToString: @"O"]) faceName = [NSString stringWithFormat: @"%@%@", faceName, @"Oblique"]; if ([weight length] != 0 && ![weight isEqualToString: @"Normal"]) { if ([faceName length] != 0) faceName = [NSString stringWithFormat: @"%@-%@", faceName, weight]; else faceName = weight; } if ([add length] != 0) { if ([faceName length] != 0) faceName = [NSString stringWithFormat: @"%@-%@", faceName, add]; else faceName = add; } if ([faceName length] == 0) faceName = @"Normal"; return faceName; } /* * Build up an X font creation string * -sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1 * becomes * -*-fixed-medium-r-normal--%d-*-*-*-c-*-iso8859-1 */ - (NSString*) creationNameFromParts: (NSArray*) parts { NSString *creationName; creationName = [NSString stringWithFormat: @"-%@-%@-%@-%@-%@-%@-%@-%@-%@-%@-%@-%@-%@-%@", @"*", [parts objectAtIndex: 2], [parts objectAtIndex: 3], [parts objectAtIndex: 4], [parts objectAtIndex: 5], [parts objectAtIndex: 6], @"%d",//[parts objectAtIndex: 7], @"*", // place holder for integer size (points *10) @"*",//[parts objectAtIndex: 9], @"*",//[parts objectAtIndex: 10], [parts objectAtIndex: 11], @"*",//[parts objectAtIndex: 12], [parts objectAtIndex: 13], [parts objectAtIndex: 14]]; return creationName; } - (NSString*) getPathFor: (NSString*) display { NSArray *paths; NSFileManager *mgr; NSString *path; BOOL flag; if (display != nil) dpy = XOpenDisplay([display cString]); else dpy = XOpenDisplay(NULL); if (dpy == 0) { NSLog(@"Unable to open X display - no font information available"); return nil; } /* Standardize the name */ display = XGFontCacheName(dpy); paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); if ((paths != nil) && ([paths count] > 0)) { path = [paths objectAtIndex: 0]; } else { NSLog(@" No valid path for cached information exists. You "); NSLog(@" should create ~/GNUstep/Library by hand"); return nil; } mgr = [NSFileManager defaultManager]; if ([mgr fileExistsAtPath: path] == NO) { NSError *err; BOOL r; r = [mgr createDirectoryAtPath: path withIntermediateDirectories: YES attributes: nil error: &err]; if (r == NO) NSLog(@"font_cacher: Library directory creation error: %@", err); } if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { NSLog(@"font_cacher: Library directory '%@' not available!", path); return nil; } path = [path stringByAppendingPathComponent: @"Fonts"]; if ([mgr fileExistsAtPath: path] == NO) { [mgr createDirectoryAtPath: path attributes: nil]; } if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { NSLog(@"Fonts directory '%@' not available!", path); return nil; } path = [path stringByAppendingPathComponent: @"Cache"]; if ([mgr fileExistsAtPath: path] == NO) { [mgr createDirectoryAtPath: path attributes: nil]; } if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { NSLog(@"Fonts directory '%@' not available!", path); return nil; } return [path stringByAppendingPathComponent: display]; } - (BOOL) fontLoop { NSUserDefaults *defs; const char *pattern = "*"; BOOL result; defs = [NSUserDefaults standardUserDefaults]; if (defs == nil) NSLog(@"Unable to access defaults database!"); else { NSString *font_mask; font_mask = [defs stringForKey: @"GSFontMask"]; if ((font_mask != nil) && [font_mask length]) // only fonts matching the supplied mask will be cached pattern = [font_mask lossyCString]; } // In a next step we allow multiple font masks result = [self processPattern: pattern]; // No longer needed DESTROY(knownFonts); return result; } - (BOOL) processPattern: (const char *) pattern { NSAutoreleasePool *loopPool; int nnames = 10000; int available = nnames+1; int i; char **fonts; /* Get list of all fonts */ for (;;) { fonts = XListFonts(dpy, pattern, nnames, &available); if (fonts == NULL || available < nnames) break; /* There are more fonts then we expected, so just start again and request more */ XFreeFontNames(fonts); nnames = available * 2; } if (fonts == NULL) { NSLog(@"No X fonts found for pattern %s", pattern); return NO; } NSDebugFLog(@"Fonts loaded, now the loop. Available: %d", available); loopPool = [NSAutoreleasePool new]; for (i = 0; i < available; i++) { char *name = fonts[i]; NSDebugLLog(@"Fonts", @"%s", name); NS_DURING [self processFont: name]; NS_HANDLER NSLog(@"Problem during processing of font %s", name); NS_ENDHANDLER if (i && i % 500 == 0) { NSDebugLog(@"Finished %d", i); RELEASE (loopPool); loopPool = [NSAutoreleasePool new]; } } RELEASE (loopPool); XFreeFontNames(fonts); NSDebugLog(@"Finished loop"); return YES; } - (void) processFont: (char*) name { NSString *alias = [[NSString stringWithCString: name] lowercaseString]; NSString *fontName; /* * First time we find this font. A font may be found more than * once, when the XFontPath has the same directory twice. * Somehow this is the case on my machine. */ if ([xFontDictionary objectForKey: alias] == nil) { XFontStruct *info = XLoadQueryFont(dpy, name); NSString *family; NSString *baseName; NSString *face; NSString *creationName; NSArray *parts; if (info == 0) { NSDebugLog(@"No information for font %s", name); return; } fontName = XGFontName(dpy, info); if (fontName == nil) { NSDebugLog(@"No font Name in info for font %s", name); XFreeFont(dpy, info); return; } if ([alias isEqualToString: fontName] == NO) { // We have got an alias name, store it [xFontDictionary setObject: fontName forKey: alias]; } // Use the normal function to keep the names consistent family = XGFontFamily(dpy, info); parts = [fontName componentsSeparatedByString: @"-"]; if ([parts count] == 15) { face = [self faceNameFromParts: parts]; if ([face length] == 0 || [face isEqualToString: @"Normal"]) { baseName = family; } else baseName = [NSString stringWithFormat: @"%@-%@", family, face]; creationName = [self creationNameFromParts: parts]; } else { baseName = [fontName capitalizedString]; face = @"Normal"; creationName = fontName; } // Store the alias to baseName [xFontDictionary setObject: baseName forKey: fontName]; // it might already have been found with another size if ([knownFonts member: baseName] == nil) { int weight; NSFontTraitMask traits; NSMutableArray *fontDefs; NSMutableArray *fontDef; // the first time we find that base font. // Store the font name [knownFonts addObject: baseName]; [allFontNames addObject: baseName]; [creationDictionary setObject: creationName forKey: baseName]; weight = XGWeightOfFont(dpy, info); traits = XGTraitsOfFont(dpy, info); // Store the family name and information fontDefs = [allFontFamilies objectForKey: family]; if (fontDefs == nil) { fontDefs = [NSMutableArray array]; [allFontFamilies setObject: fontDefs forKey: family]; } // Fill the structure for the font fontDef = [NSMutableArray arrayWithCapacity: 4]; [fontDef addObject: baseName]; [fontDef addObject: face]; [fontDef addObject: [NSNumber numberWithInt: weight]]; [fontDef addObject: [NSNumber numberWithUnsignedInt: traits]]; // Add to the family information [fontDefs addObject: fontDef]; } // Release the font XFreeFont(dpy, info); } } static NSComparisonResult fontDefSorter(id e1, id e2, void *context) { // This is not exactly the order the OpenStep specification states. NSArray *el1 = (NSArray *)e1; NSArray *el2 = (NSArray *)e2; NSFontTraitMask t1 = [[el1 objectAtIndex: 3] unsignedIntValue]; NSFontTraitMask t2 = [[el2 objectAtIndex: 3] unsignedIntValue]; int w1 = [[el1 objectAtIndex: 2] intValue]; int w2 = [[el2 objectAtIndex: 2] intValue]; if (t1 < t2) return NSOrderedAscending; else if (t2 < t1) return NSOrderedDescending; else if (w1 < w2) return NSOrderedAscending; else if (w2 < w1) return NSOrderedDescending; return NSOrderedSame; } - (void) sortResults { NSEnumerator *enumerator; id key; // Now sort the fonts of each family enumerator = [allFontFamilies keyEnumerator]; while ((key = [enumerator nextObject])) { NSMutableArray *fontDefs = [allFontFamilies objectForKey: key]; [fontDefs sortUsingFunction: fontDefSorter context: nil]; } // define a creation string for alias names enumerator = [xFontDictionary keyEnumerator]; while ((key = [enumerator nextObject])) { id name = key; id creationName; while ((name != nil) && (creationName = [creationDictionary objectForKey: name]) == nil) { name = [xFontDictionary objectForKey: name]; } if (creationName != nil) { [creationDictionary setObject: creationName forKey: key]; } } // No longer needed DESTROY(xFontDictionary); } - (void) writeCacheTo: (NSString*)path { NSData *data; NSMutableDictionary *cache = [NSMutableDictionary dictionaryWithCapacity: 4]; [cache setObject: [NSNumber numberWithInt: 3] forKey: @"Version"]; [cache setObject: allFontNames forKey: @"AllFontNames"]; [cache setObject: allFontFamilies forKey: @"AllFontFamilies"]; [cache setObject: creationDictionary forKey: @"CreationDictionary"]; data = [NSArchiver archivedDataWithRootObject: cache]; [data writeToFile: path atomically: YES]; } @end int main(int argc, char **argv, char **env) { NSArray *args; NSArray *paths; NSString *path; NSString *file_name; XFontCacher *cacher; CREATE_AUTORELEASE_POOL(pool); #ifdef GS_PASS_ARGUMENTS [NSProcessInfo initializeWithArguments: argv count: argc environment: env]; #endif args = [[NSProcessInfo processInfo] arguments]; if ([args containsObject: @"--help"]) { paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); if ((paths != nil) && ([paths count] > 0)) path = [paths objectAtIndex: 0]; else path = nil; NSLog(@"This tool caches system font information\n"); if (path != nil) NSLog(@" Information is cached in %@/Fonts/Cache/", path); else { NSLog(@" No valid path for cached information exists. You "); NSLog(@" should create ~/GNUstep/Library by hand"); } RELEASE(pool); return 0; } if ([args containsObject: @"--version"]) { NSLog(@"%@ version %s", [[args objectAtIndex: 0] lastPathComponent], makever(GNUSTEP_VERSION)); RELEASE(pool); return 0; } if ([args count] > 1) file_name = [args objectAtIndex: 1]; else file_name = nil; cacher = [[XFontCacher alloc] init]; path = [cacher getPathFor: file_name]; if (path == nil) { RELEASE(pool); return 1; } if (![cacher fontLoop]) { RELEASE(pool); return 2; } [cacher sortResults]; NS_DURING [cacher writeCacheTo: path]; NS_HANDLER NSLog(@"Problem during writing of font cache"); NS_ENDHANDLER RELEASE(cacher); RELEASE(pool); return 0; } gnustep-back-0.29.0/Tools/gpbs.1000066400000000000000000000055021404163720200163030ustar00rootroot00000000000000.\"gpbs(1) man page .\"put together by Martin Brecher .\"Copyright (C) 2003 Free Software Foundation, Inc. .\" .\"Process this file with .\"groff -man -Tascii gpbs.1 .\" .TH GPBS 1 "September 2006" GNUstep "GNUstep System Manual" .SH NAME gpbs \- GNUstep PasteBoard Server .SH SYNOPSIS .B gpbs .P .SH DESCRIPTION The .B gpbs daemon serves as a clipboard/pasteboard for GNUstep programs, handling the copying, cutting and pasting of objects as well as drag and drop operations between applications. .P Every user needs to have his own instance of .B gpbs running. While .B gpbs will be started automatically as soon as it is needed, it is recommend to start .B gpbs in a personal login script like ~/.bashrc or ~/.cshrc. Alternatively you can launch gpbs when your windowing system or the window manager is started. For example, on systems with X11 you can launch .B gpbs from your .xinitrc script or alternatively - if you are running Window Maker - put it in Window Maker's autostart script. See the .I GNUstep Build Guide for a sample startup script. .P .SH OPTIONS .TP \fB\-NSHost\fR \fB\fR attaches \fBgpbs\fR to a remote session. .TP \fB\--GSStartupNotification\fR sends a notification through the NSDistributedNotificationCenter (i.e. gdnc) so that apps know that it has started up. This is only relevant if the application itself tries to startup \fBgpbs\fR (which means \fBgpbs\fR was not started at session login). .TP \fB\--daemon\fR starts \fBgpbs\fR as a daemon - mostly this means that all output gets sent to syslog rather than the terminal. .TP \fB\--no-fork\fR does not fork a separate process .TP \fB\--verbose\fR makes \fB\gpbs\fR his logging more verbose .SH DIAGNOSTICS .B gdomap -L GNUstepGSPasteboardServer will lookup instances of .B gpbs. .P Alternatively, .B gdomap -N will list all registered names on the local host. .P .SH BUGS Versions of .B gpbs up to (including) 1.7.2 have problems with copy and paste of mulit-lingual text, as it used the atom XA_STRING alone to exchange string data between X clients (and thus GNUstep clients). This means .B gpbs is inherently unable to do cut-and-paste with characters other than ISO Latin1 ones, TAB, and NEWLINE. .P .SH SEE ALSO gdnc(1), gdomap(8), GNUstep(7) xinit(1) wmaker(1) .P .I The GNUstep Build Guide example startup script: .P .SH HISTORY Work on .B gdnc started August 1997. .PP This manual page first appeared in gnustep-back 0.8.8 (July 2003). .P .SH AUTHORS gpbs was written by Richard Frith-McDonald .P This man page was written by Martin Brecher with contributions from Kazunobu Kuriyama . .P This man page was updated September 2006 by Dennis Leeuw (dleeuw@made-it.com) with notes by Adam Fedor (fedor@doc.com). gnustep-back-0.29.0/Tools/gpbs.m000066400000000000000000000705051404163720200164040ustar00rootroot00000000000000/* gpbs.m GNUstep pasteboard server Copyright (C) 1997,1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: August 1997 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "config.h" #include #ifdef HAVE_SYSLOG_H #include #endif #include #include #include #ifdef __MINGW__ #include "process.h" #endif #ifndef NSIG #define NSIG 32 #endif static BOOL is_daemon = NO; /* Currently running as daemon. */ static BOOL auto_stop = NO; /* Stop when all connections closed. */ static NSMutableArray *connections = nil; #if defined(HAVE_SYSLOG) || defined(HAVE_SLOGF) # if defined(HAVE_SLOGF) # include # include # define LOG_CRIT _SLOG_CRITICAL # define LOG_DEBUG _SLOG_DEBUG1 # define LOG_ERR _SLOG_ERROR # define LOG_INFO _SLOG_INFO # define LOG_WARNING _SLOG_WARNING # define syslog(prio, msg,...) slogf(_SLOG_SETCODE(_SLOG_SYSLOG, 0), prio, msg, __VA_ARGS__) # endif static int log_priority = LOG_DEBUG; static void gpbs_log (int prio, const char *ebuf) { if (is_daemon) { # if defined(HAVE_SLOGF) // Let's not have 0 as the value for prio. It means "shutdown" on QNX syslog (prio ? prio : log_priority, "%s", ebuf); # else syslog (log_priority | prio, "%s", ebuf); # endif } else if (prio == LOG_INFO) { write (1, ebuf, strlen (ebuf)); write (1, "\n", 1); } else { write (2, ebuf, strlen (ebuf)); write (2, "\n", 1); } if (prio == LOG_CRIT) { if (is_daemon) { syslog (LOG_CRIT, "%s", "exiting."); } else { fprintf (stderr, "exiting.\n"); fflush (stderr); } exit(EXIT_FAILURE); } } #else #define LOG_CRIT 2 #define LOG_DEBUG 0 #define LOG_ERR 1 #define LOG_INFO 0 #define LOG_WARNING 0 void gpbs_log (int prio, const char *ebuf) { write (2, ebuf, strlen (ebuf)); write (2, "\n", 1); if (prio == LOG_CRIT) { fprintf (stderr, "exiting.\n"); fflush (stderr); exit(EXIT_FAILURE); } } #endif @class PasteboardServer; @class PasteboardObject; @protocol XPb + (id) ownerByOsPb: (NSString*)p; + (BOOL) initializePasteboard; @end static Class xPbClass; int verbose = 0; #define MAXHIST 100 PasteboardServer *server = nil; NSConnection *conn = nil; NSLock *dictionary_lock = nil; NSMutableDictionary *pasteboards = nil; @interface NSPasteboard (GNULocal) + (void) _localServer: (id)s; @end @interface PasteboardData: NSObject { NSData *data; NSString *type; id owner; id pboard; id entry; } + (PasteboardData*) newWithType: (NSString*)aType owner: (id)anObject pboard: (id)anotherObject entry: (id)anEntry; - (BOOL) checkConnection: (NSConnection*)c; - (NSData*) data; - (NSData*) dataWithVersion: (int)version; - (id) owner; - (id) pboard; - (void) setData: (NSData*)d; - (NSString*) type; @end @implementation PasteboardData + (PasteboardData*) newWithType: (NSString*)aType owner: (id)anObject pboard: (id)anotherObject entry: (id)anEntry { PasteboardData* d = [PasteboardData alloc]; if (d) { d->type = RETAIN(aType); d->owner = RETAIN(anObject); d->pboard = RETAIN(anotherObject); d->entry = RETAIN(anEntry); } return d; } - (BOOL) checkConnection: (NSConnection*)c { BOOL ourConnection = NO; if (owner && [owner isProxy] && [owner connectionForProxy] == c) { DESTROY(owner); DESTROY(pboard); DESTROY(entry); ourConnection = YES; } if (pboard && [pboard isProxy] && [pboard connectionForProxy] == c) { DESTROY(owner); DESTROY(pboard); DESTROY(entry); ourConnection = YES; } return ourConnection; } - (void) dealloc { RELEASE(type); RELEASE(data); RELEASE(owner); RELEASE(pboard); RELEASE(entry); [super dealloc]; } - (NSString*) description { return [NSString stringWithFormat: @"%@ %p for type '%@' in %@", [super description], data, type, entry]; } - (NSData*) data { if (verbose) { NSLog(@"-data for %@", self); } return data; } - (NSData*) dataWithVersion: (int)version { if (verbose) { NSLog(@"-dataWithversion:%d for %@", version, self); } /* * If the owner of this item is an X window - we can't use the data from * the last time the selection was accessed because the X window may have * changed it's selection without telling us - isn't X wonderful :-( */ if (data != nil && owner != nil && [owner isProxy] == NO && [owner isKindOfClass: xPbClass] == YES) { DESTROY(data); } if (data == nil && (owner && pboard)) { if ([owner respondsToSelector: @selector(pasteboard:provideDataForType:andVersion:)]) { [owner pasteboard: pboard provideDataForType: type andVersion: version]; } else if ([owner respondsToSelector: @selector(pasteboard:provideDataForType:)]) { [owner pasteboard: pboard provideDataForType: type]; } } return [self data]; } - (id) owner { return owner; } - (id) pboard { return pboard; } - (void) setData: (NSData*)d { ASSIGN(data, d); if (verbose) { NSLog(@"-setData: for %@", self); } } - (NSString*) type { return type; } @end @interface PasteboardEntry: NSObject { int refNum; id owner; id pboard; NSMutableArray *items; } + (PasteboardEntry*) newWithTypes: (NSArray*)someTypes owner: (id)anOwner pboard: (id)aPboard ref: (int)count; - (void) addTypes: (NSArray*)types owner: (id)owner pasteboard: (id)pb; - (BOOL) checkConnection: (NSConnection*)c; - (PasteboardData*) itemForType: (NSString*)type; - (void) lostOwnership; - (id) owner; - (int) refNum; - (NSArray*) types; @end @implementation PasteboardEntry + (PasteboardEntry*) newWithTypes: (NSArray*)someTypes owner: (id)anOwner pboard: (id)aPboard ref: (int)count { PasteboardEntry* e = [PasteboardEntry alloc]; if (e) { int i; e->owner = RETAIN(anOwner); e->pboard = RETAIN(aPboard); e->items = [[NSMutableArray alloc] initWithCapacity: [someTypes count]]; for (i = 0; i < [someTypes count]; i++) { NSString *type = [someTypes objectAtIndex: i]; PasteboardData *d; d = [PasteboardData newWithType: type owner: anOwner pboard: aPboard entry: e]; [e->items addObject: d]; RELEASE(d); } e->refNum = count; if (verbose > 1) { NSLog(@"New PasteboardEntry %@ with items - %@", e, e->items); } } return e; } - (void) addTypes: (NSArray*)newTypes owner: (id)newOwner pasteboard: (id)pb { int i; for (i = 0; i < [newTypes count]; i++) { NSString *type = (NSString*)[newTypes objectAtIndex: i]; if ([self itemForType: type] == nil) { PasteboardData* d; d = [PasteboardData newWithType: type owner: newOwner pboard: pb entry: self]; [items addObject: d]; RELEASE(d); } } if (verbose > 1) { NSLog(@"Modified %@ with items - %@", self, items); } } - (BOOL) checkConnection: (NSConnection*)c { BOOL ourConnection = NO; unsigned i; id o; if (owner && [owner isProxy] && [owner connectionForProxy] == c) { o = owner; owner = nil; RELEASE(o); o = pboard; pboard = nil; RELEASE(o); ourConnection = YES; } if (pboard && [pboard isProxy] && [pboard connectionForProxy] == c) { o = owner; owner = nil; RELEASE(o); o = pboard; pboard = nil; RELEASE(o); ourConnection = YES; } for (i = [items count]; i > 0; i--) { PasteboardData *d = [items objectAtIndex: i-1]; if ([d checkConnection: c] == YES && [d data] == nil && [d owner] == nil) { if (verbose > 1) { NSLog(@"Removing item from PasteboardEntry %d", refNum); } [items removeObjectAtIndex: i-1]; } } return ourConnection; } - (void) dealloc { RELEASE(owner); RELEASE(pboard); RELEASE(items); [super dealloc]; } - (NSString*) description { return [NSString stringWithFormat: @"%@ ref %d on %@ owned by %@", [super description], refNum, pboard, owner]; } - (PasteboardData*) itemForType: (NSString*)type { unsigned i, count; count = [items count]; for (i = 0; i < count; i++) { PasteboardData *d = [items objectAtIndex: i]; if ([[d type] isEqual: type]) { return d; } } return nil; } - (void) lostOwnership { NSMutableArray *a = [NSMutableArray arrayWithCapacity: 4]; unsigned i; NS_DURING { if (owner && [owner respondsToSelector: @selector(pasteboardChangedOwner:)]) { [a addObject: owner]; } for (i = 0; i < [items count]; i++) { PasteboardData *d = [items objectAtIndex: i]; id o = [d owner]; if (o && [o respondsToSelector: @selector(pasteboardChangedOwner:)] && [a indexOfObjectIdenticalTo: o] == NSNotFound) { [a addObject: o]; } } if (owner && [owner respondsToSelector: @selector(pasteboardChangedOwner:)]) { [owner pasteboardChangedOwner: pboard]; if (owner != nil) { [a removeObjectIdenticalTo: owner]; } } for (i = 0; i < [items count] && [a count] > 0; i++) { PasteboardData *d = [items objectAtIndex: i]; id o = [d owner]; if (o != nil && [a containsObject: o]) { [o pasteboardChangedOwner: [d pboard]]; [a removeObjectIdenticalTo: o]; } } } NS_HANDLER { NSLog(@"Error informing objects of ownership change - %@", [localException reason]); } NS_ENDHANDLER } - (id) owner { return owner; } - (int) refNum { return refNum; } - (NSArray*) types { NSMutableArray* t = [NSMutableArray arrayWithCapacity: [items count]]; unsigned int i; for (i = 0; i < [items count]; i++) { PasteboardData* d = [items objectAtIndex: i]; [t addObject: [d type]]; } return t; } @end @interface PasteboardObject: NSObject { NSString *name; int nextCount; unsigned histLength; NSMutableArray *history; PasteboardEntry *current; } + (PasteboardObject*) pasteboardWithName: (NSString*)name; - (int) addTypes: (NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pboard oldCount: (int)count; - (NSString*) availableTypeFromArray: (NSArray*)types changeCount: (int*)count; - (int) changeCount; - (BOOL) checkConnection: (NSConnection*)c; - (NSData*) dataForType: (NSString*)type oldCount: (int)count mustBeCurrent: (BOOL)flag; - (int) declareTypes: (NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pboard; - (PasteboardEntry*) entryByCount: (int)count; - (NSString*) name; - (void) releaseGlobally; - (BOOL) setData: (NSData*)data forType: (NSString*)type isFile: (BOOL)flag oldCount: (int)count; - (void) setHistory: (unsigned)length; - (NSArray*) typesAndChangeCount: (int*)count; @end @implementation PasteboardObject + (void) initialize { pasteboards = [[NSMutableDictionary alloc] initWithCapacity: 8]; dictionary_lock = [[NSLock alloc] init]; } + (PasteboardObject*) pasteboardWithName: (NSString*)aName { static int number = 0; PasteboardObject* pb; [dictionary_lock lock]; while (aName == nil) { aName = [NSString stringWithFormat: @"%dlocalName", number++]; if ([pasteboards objectForKey: aName] == nil) { break; // This name is unique. } else { aName = nil; // Name already in use - try another. } } pb = [pasteboards objectForKey: aName]; if (pb == nil) { pb = [PasteboardObject alloc]; pb->name = RETAIN(aName); pb->nextCount = 1; pb->histLength = 1; pb->history = [[NSMutableArray alloc] initWithCapacity: 2]; pb->current = nil; [pasteboards setObject: pb forKey: aName]; AUTORELEASE(pb); } [dictionary_lock unlock]; return pb; } - (int) addTypes: (NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb oldCount: (int)count { PasteboardEntry *e = [self entryByCount: count]; if ([owner isProxy] == YES) { Protocol *p = @protocol(GSPasteboardCallback); [owner setProtocolForProxy: p]; } if (e) { id x = [xPbClass ownerByOsPb: name]; [e addTypes: types owner: owner pasteboard: pb]; /* * If there is an X pasteboard corresponding to this pasteboard, and the * X system doesn't currently own the pasteboard, we must inform it of * the change in the types of data supplied by this pasteboard. * We do this by simulating a change of pasteboard ownership. */ if (x != owner && x != nil) [x pasteboardChangedOwner: pb]; return count; } return 0; } - (NSString*) availableTypeFromArray: (NSArray*)types changeCount: (int*)count { PasteboardEntry *e = nil; if (*count <= 0) { e = current; } else { e = [self entryByCount: *count]; } if (e) { unsigned i; *count = [e refNum]; for (i = 0; i < [types count]; i++) { NSString* key = [types objectAtIndex: i]; if ([e itemForType: key] != nil) { return key; } } } return nil; } - (int) changeCount { if (current) { return [current refNum]; } return 0; } - (BOOL) checkConnection: (NSConnection*)c { unsigned i; BOOL found = NO; for (i = 0; i < [history count]; i++) { if ([[history objectAtIndex: i] checkConnection: c] == YES) { found = YES; } } return found; } - (NSData*) dataForType: (NSString*)type oldCount: (int)count mustBeCurrent: (BOOL)flag { PasteboardEntry *e = nil; if (flag) { e = current; } else { e = [self entryByCount: count]; } if (verbose) { NSLog(@"%@ get data for type '%@' version %d", self, type, e ? [e refNum] : -1); } if (e) { PasteboardData *d = [e itemForType: type]; if (d) { return [d dataWithVersion: [e refNum]]; } } return nil; } - (void) dealloc { RELEASE(name); RELEASE(history); [super dealloc]; } - (int) declareTypes: (bycopy NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb { PasteboardEntry *old = RETAIN(current); id x = [xPbClass ownerByOsPb: name]; if ([owner isProxy] == YES) { Protocol *p = @protocol(GSPasteboardCallback); NSConnection *c = [owner connectionForProxy]; [owner setProtocolForProxy: p]; /* If this is on a connection we don't know about, add it to our * list of pasteboard connections so that we can track its removal * in order to auto_stop if necessary. */ if ([connections indexOfObjectIdenticalTo: c] == NSNotFound) { [connections addObject: c]; } } /* * If neither the new nor the old owner of the pasteboard is the X * pasteboard owner corresponding to this pasteboard, we will need * to inform the X owner of the change of ownership. */ if (x == owner) x = nil; else if (x == [old owner]) x = nil; current = [PasteboardEntry newWithTypes: types owner: owner pboard: pb ref: nextCount++]; [history addObject: current]; RELEASE(current); if ([history count] > histLength) { [history removeObjectAtIndex: 0]; } [old lostOwnership]; RELEASE(old); /* * If there is an interested X pasteboard - inform it of the ownership * change. */ if (x != nil) [x pasteboardChangedOwner: pb]; if (verbose) { NSLog(@"%@ declare types '%@' version %d on %@ for %@", self, types, [current refNum], pb, owner); } return [current refNum]; } - (NSString*) description { return [NSString stringWithFormat: @"%@ %@", [super description], name]; } - (PasteboardEntry*) entryByCount: (int)count { if (current == nil) { return nil; } else if ([current refNum] == count) { return current; } else { int i; for (i = 0; i < [history count]; i++) { if ([[history objectAtIndex: i] refNum] == count) { return (PasteboardEntry*)[history objectAtIndex: i]; } } return nil; } } - (NSString*) name { return name; } - (void) releaseGlobally { if ([name isEqual: NSDragPboard]) return; if ([name isEqual: NSFindPboard]) return; if ([name isEqual: NSFontPboard]) return; if ([name isEqual: NSGeneralPboard]) return; if ([name isEqual: NSRulerPboard]) return; [pasteboards removeObjectForKey: name]; } - (BOOL) setData: (NSData*)data forType: (NSString*)type isFile: (BOOL)flag oldCount: (int)count { PasteboardEntry *e; e = [self entryByCount: count]; if (verbose) { NSLog(@"%@ set data %p for type '%@' version %d in %@", self, data, type, count, e); } if (e) { PasteboardData *d; if (flag) { d = [e itemForType: NSFileContentsPboardType]; if (d) { [d setData: data]; } else { return NO; } if (type && [type isEqual: NSFileContentsPboardType] == NO) { d = [e itemForType: type]; if (d) { [d setData: data]; } else { return NO; } } return YES; } else if (type) { d = [e itemForType: type]; if (d) { [d setData: data]; return YES; } else { return NO; } } else { return NO; } } else { return NO; } } - (void) setHistory: (unsigned)length { if (length < 1) length = 1; if (length > MAXHIST) length = MAXHIST; histLength = length; if (length < histLength) { while ([history count] > histLength) { [history removeObjectAtIndex: 0]; } } } - (NSArray*) typesAndChangeCount: (int*)count { PasteboardEntry *e = nil; if (*count <= 0) { e = current; } else { e = [self entryByCount: *count]; } if (e) { *count = [e refNum]; return [e types]; } return nil; } @end @interface PasteboardServer : NSObject { NSMutableArray *permenant; } - (BOOL) connection: (NSConnection*)ancestor shouldMakeNewConnection: (NSConnection*)newConn; - (id) connectionBecameInvalid: (NSNotification*)notification; - (id) pasteboardWithName: (NSString*)name; @end @implementation PasteboardServer - (BOOL) connection: (NSConnection*)ancestor shouldMakeNewConnection: (NSConnection*)newConn; { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(connectionBecameInvalid:) name: NSConnectionDidDieNotification object: newConn]; [newConn setDelegate: self]; return YES; } - (id) connectionBecameInvalid: (NSNotification*)notification { id connection = [notification object]; if (connection == conn) { NSLog(@"Help - pasteboard server connection has died!"); exit(EXIT_FAILURE); } if ([connection isKindOfClass: [NSConnection class]]) { NSEnumerator *e = [pasteboards objectEnumerator]; PasteboardObject *o; while ((o = [e nextObject]) != nil) { [o checkConnection: connection]; } } [connections removeObjectIdenticalTo: connection]; if (auto_stop == YES && [connections count] == 0) { exit(EXIT_SUCCESS); } return self; } - (void) dealloc { RELEASE(permenant); [super dealloc]; } - (id) init { self = [super init]; if (self) { /* * Tell the NSPasteboard class to use us as the server so that the X * pasteboard owners can talk to us directly rather than over D.O. */ [NSPasteboard _localServer: (id)self]; /* * Create all the pasteboards which must persist forever and add them * to a local array. */ permenant = [[NSMutableArray alloc] initWithCapacity: 5]; [permenant addObject: [self pasteboardWithName: NSGeneralPboard]]; [permenant addObject: [self pasteboardWithName: NSDragPboard]]; [permenant addObject: [self pasteboardWithName: NSFontPboard]]; [permenant addObject: [self pasteboardWithName: NSRulerPboard]]; [permenant addObject: [self pasteboardWithName: NSFindPboard]]; /* * Ensure that the OS pasteboard system is initialised. */ #if defined(__WIN32__) || defined(__CYGWIN__) xPbClass = NSClassFromString(@"Win32PbOwner"); #else xPbClass = NSClassFromString(@"XPbOwner"); #endif /* If the OS pasteboard system fails to initialize, pretend that it isn't there. In practice, this happens if gpbs has been compiled with X support but is run on a display-less system. Note that +initializePasteboard will already have printed a warning in this case. */ if (xPbClass && ![xPbClass initializePasteboard]) xPbClass = nil; } return self; } - (id) pasteboardWithName: (NSString*)name { return [PasteboardObject pasteboardWithName: name]; } @end static void ihandler(int sig) { static BOOL beenHere = NO; BOOL action; const char *e; /* * Prevent recursion. */ if (beenHere == YES) { abort(); } beenHere = YES; /* * If asked to terminate, do so cleanly. */ if (sig == SIGTERM) { exit(EXIT_FAILURE); } #ifdef DEBUG action = YES; // abort() by default. #else action = NO; // exit() by default. #endif e = getenv("CRASH_ON_ABORT"); if (e != 0) { if (strcasecmp(e, "yes") == 0 || strcasecmp(e, "true") == 0) action = YES; else if (strcasecmp(e, "no") == 0 || strcasecmp(e, "false") == 0) action = NO; else if (isdigit(*e) && *e != '0') action = YES; else action = NO; } if (action == YES) { abort(); } else { fprintf(stderr, "gpbs killed by signal %d\n", sig); exit(sig); } } static void init(int argc, char** argv, char **env) { NSUserDefaults *defs; NSProcessInfo *pInfo; NSMutableArray *args; unsigned count; BOOL shouldFork = YES; pInfo = [NSProcessInfo processInfo]; args = AUTORELEASE([[pInfo arguments] mutableCopy]); for (count = 1; count < [args count]; count++) { NSString *a = [args objectAtIndex: count]; if ([a isEqualToString: @"--help"] == YES) { printf("gpbs\n\n"); printf("GNU Pasteboard server\n"); printf("--help\tfor help\n"); printf("--no-fork\tavoid fork() to make debugging easy\n"); printf("--verbose\tMore verbose debug output\n"); exit(EXIT_SUCCESS); } else if ([a isEqualToString: @"--auto"] == YES) { auto_stop = YES; } else if ([a isEqualToString: @"--daemon"] == YES) { is_daemon = YES; shouldFork = NO; } else if ([a isEqualToString: @"--no-fork"] == YES) { shouldFork = NO; } else if ([a isEqualToString: @"--verbose"] == YES) { verbose++; } else if ([a hasPrefix: @"-"] == YES) { count++; // Skip user default specification } else if ([a length] > 0) { printf("gpbs - GNU Pasteboard server\n"); printf("I don't understand '%s'\n", [a cString]); printf("--help for help\n"); exit(EXIT_SUCCESS); } } for (count = 0; count < NSIG; count++) { if (count == SIGABRT) continue; #ifdef SIGPROF if (count == SIGPROF) continue; #endif signal((int)count, ihandler); } #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); #endif #ifdef SIGTTOU signal(SIGTTOU, SIG_IGN); #endif #ifdef SIGTTIN signal(SIGTTIN, SIG_IGN); #endif #ifdef SIGHUP signal(SIGHUP, SIG_IGN); #endif signal(SIGTERM, ihandler); if (shouldFork == YES) { NSFileHandle *null; NSTask *t; t = [NSTask new]; NS_DURING { [args removeObjectAtIndex: 0]; [args addObject: @"--daemon"]; [t setLaunchPath: [[NSBundle mainBundle] executablePath]]; [t setArguments: args]; [t setEnvironment: [pInfo environment]]; null = [NSFileHandle fileHandleWithNullDevice]; [t setStandardInput: null]; [t setStandardOutput: null]; [t setStandardError: null]; [t launch]; DESTROY(t); } NS_HANDLER { gpbs_log(LOG_CRIT, [[localException description] UTF8String]); DESTROY(t); } NS_ENDHANDLER exit(EXIT_FAILURE); } /* * Make gpbs logging go to syslog unless overridden by user. */ defs = [NSUserDefaults standardUserDefaults]; [defs registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: @"YES", @"GSLogSyslog", nil]]; } int main(int argc, char** argv, char **env) { CREATE_AUTORELEASE_POOL(pool); NSString *hostname; #ifdef GS_PASS_ARGUMENTS [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; #endif init(argc, argv, env); // [NSObject enableDoubleReleaseCheck: YES]; server = [[PasteboardServer alloc] init]; if (server == nil) { NSLog(@"Unable to create server object."); exit(EXIT_FAILURE); } /* Register a connection that provides the server object to the network */ conn = [NSConnection defaultConnection]; [conn setRootObject: server]; [conn setDelegate: server]; [[NSNotificationCenter defaultCenter] addObserver: server selector: @selector(connectionBecameInvalid:) name: NSConnectionDidDieNotification object: (id)conn]; connections = [NSMutableArray new]; hostname = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"]; if ([hostname length] == 0 || [[NSHost hostWithName: hostname] isEqual: [NSHost currentHost]] == YES) { if ([conn registerName: PBSNAME] == NO) { NSLog(@"Unable to register with name server."); exit(EXIT_FAILURE); } } else { NSHost *host = [NSHost hostWithName: hostname]; NSPort *port = [conn receivePort]; NSPortNameServer *ns = [NSPortNameServer systemDefaultPortNameServer]; NSArray *a; unsigned c; if (host == nil) { NSLog(@"gpbs - unknown NSHost argument ... %@ - quitting.", hostname); exit(EXIT_FAILURE); } a = [host names]; c = [a count]; while (c-- > 0) { NSString *name = [a objectAtIndex: c]; name = [PBSNAME stringByAppendingFormat: @"-%@", name]; if ([ns registerPort: port forName: name] == NO) { } } a = [host addresses]; c = [a count]; while (c-- > 0) { NSString *name = [a objectAtIndex: c]; name = [PBSNAME stringByAppendingFormat: @"-%@", name]; if ([ns registerPort: port forName: name] == NO) { } } } if (verbose) { NSLog(@"GNU pasteboard server startup."); } if ([[NSUserDefaults standardUserDefaults] stringForKey: @"GSStartupNotification"]) { [[NSDistributedNotificationCenter defaultCenter] postNotificationName: [[NSUserDefaults standardUserDefaults] stringForKey: @"GSStartupNotification"] object: nil]; } [[NSRunLoop currentRunLoop] run]; RELEASE(server); RELEASE(pool); exit(EXIT_SUCCESS); } /* * The following dummy classe is here solely as a workaround for pre 3.3 * versions of gcc where protocols didn't work properly unless implemented * in the source where the '@protocol()' directive is used. */ @interface NSPasteboardOwnerDummy : NSObject - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type; - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type andVersion:(int)v; - (void) pasteboardChangedOwner: (NSPasteboard*)pb; @end @implementation NSPasteboardOwnerDummy - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type { } - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type andVersion:(int)v { } - (void) pasteboardChangedOwner: (NSPasteboard*)pb { } @end gnustep-back-0.29.0/Tools/win32pbs.m000077500000000000000000000230261404163720200171170ustar00rootroot00000000000000/* win32pbs.m GNUstep pasteboard server - Win32 extension Copyright (C) 2003 Free Software Foundation, Inc. Author: Fred Kiefer Date: December 2003 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Access Windows 2000 (and later) API. Required for HWND_MESSAGE. */ #define WINVER 0x500 #include #include #include #include #ifdef __CYGWIN__ #include #endif @interface Win32PbOwner : NSObject { NSPasteboard *_pb; HINSTANCE _hinstance; HWND _hwnd; BOOL _ignore; } - (id) initWithOSPb: (NSPasteboard*) ospb; - (void) clipboardHasData; - (void) setClipboardData; - (void) grapClipboard; - (void) setupRunLoopInputSourcesForMode: (NSString*)mode; @end static Win32PbOwner *wpb = nil; static HWND hwndNextViewer = NULL; LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); @implementation Win32PbOwner + (BOOL) initializePasteboard { if (self == [Win32PbOwner class]) { wpb = [[Win32PbOwner alloc] initWithOSPb: [NSPasteboard generalPasteboard]]; [wpb clipboardHasData]; } return YES; } + (id) ownerByOsPb: (NSString*)p { if ([p isEqual: [[NSPasteboard generalPasteboard] name]]) { return wpb; } else { return nil; } } - (id) initWithOSPb: (NSPasteboard*) ospb { WNDCLASSEX wc; _ignore = NO; _hinstance = (HINSTANCE)GetModuleHandle(NULL); // Register the main window class. wc.cbSize = sizeof(wc); //wc.style = CS_OWNDC; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC) MainWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = _hinstance; wc.hIcon = NULL; wc.hCursor = NULL; wc.hbrBackground = NULL; wc.lpszMenuName = NULL; wc.lpszClassName = "GNUstepClipboardClass"; wc.hIconSm = NULL; if (RegisterClassEx(&wc)) { _hwnd = CreateWindowEx(0, "GNUstepClipboardClass", "GNUstepClipboard", 0, 0, 0, 10, 10, HWND_MESSAGE, (HMENU)NULL, _hinstance, NULL); } ASSIGN(_pb, ospb); [self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode]; return self; } - (void) dealloc { RELEASE(_pb); DestroyWindow(_hwnd); UnregisterClass("GNUstepClipboardClass", _hinstance); [super dealloc]; } - (void) clipboardHasString { if ((_hwnd != GetClipboardOwner()) && IsClipboardFormatAvailable(CF_UNICODETEXT)) { [_pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: self]; } } /* The owner of the Windows clipboard did change. Check if this results in some action for us. */ - (void) clipboardHasData { if (!_ignore) { _ignore = YES; [self clipboardHasString]; _ignore = NO; } } - (void) setClipboardString { HGLOBAL hglb; LPWSTR lpwstr; NSString *s; unsigned int len; s = [_pb stringForType: NSStringPboardType]; if (s == nil) { return; } len = [s length]; hglb = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(WCHAR)); if (hglb == NULL) { return; } // Lock the handle and copy the text to the buffer. lpwstr = GlobalLock(hglb); [s getCharacters: lpwstr]; lpwstr[len] = (WCHAR)0; GlobalUnlock(hglb); SetClipboardData(CF_UNICODETEXT, hglb); } /* Data is requested from the Windows clipboard. We are already the owner of the clipboard. */ - (void) setClipboardData { if (!_ignore) { _ignore = YES; [self setClipboardString]; _ignore = NO;; } } /* Take over the ownership of the Windows clipboard, but don't provide data */ - (void) grapClipboard { if (!OpenClipboard(_hwnd)) { NSLog(@"Failed to get the Win32 clipboard. %d", GetLastError()); return; } if (!EmptyClipboard()) { NSLog(@"Failed to get the Win32 clipboard. %d", GetLastError()); CloseClipboard(); return; } SetClipboardData(CF_UNICODETEXT, NULL); CloseClipboard(); } /* * If this gets called, a GNUstep object has grabbed the pasteboard * or has changed the types of data available from the pasteboard * so we must tell the Windows system, that we have the current selection. */ - (void) pasteboardChangedOwner: (NSPasteboard*)sender { if (!_ignore) { _ignore = YES; [self grapClipboard]; _ignore = NO;; } } - (void) provideStringTo: (NSPasteboard*)pb { HGLOBAL hglb; if (!IsClipboardFormatAvailable(CF_UNICODETEXT) || !OpenClipboard(_hwnd)) { return; } hglb = GetClipboardData(CF_UNICODETEXT); if (hglb != NULL) { LPWSTR lpwstr; lpwstr = GlobalLock(hglb); if (lpwstr != NULL) { unsigned int len; NSString *s; len = lstrlenW(lpwstr); s = [NSString stringWithCharacters: lpwstr length: len]; [pb setString: s forType: NSStringPboardType]; GlobalUnlock(hglb); } } CloseClipboard(); } - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type { if (!_ignore) { if ([type isEqual: NSStringPboardType]) { _ignore = YES; [self provideStringTo: pb]; _ignore = NO;; } } } - (void) callback: (id) sender { MSG msg; WINBOOL bRet; while ((bRet = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) != 0) { if (msg.message == WM_QUIT) { // Exit the program return; } if (bRet == -1) { // handle the error and possibly exit } else { // Don't translate messages, as this would give extra character messages. DispatchMessage(&msg); } } } - (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode { #ifdef __CYGWIN__ if (type == ET_RDESC) #else if (type == ET_WINMSG) #endif { MSG *m = (MSG*)extra; if (m->message == WM_QUIT) { //[NSApp terminate: nil]; // Exit the program return; } else { DispatchMessage(m); } } if (mode != nil) [self callback: mode]; } - (void) setupRunLoopInputSourcesForMode: (NSString*)mode { NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; #ifdef __CYGWIN__ int fdMessageQueue; #define WIN_MSG_QUEUE_FNAME "/dev/windows" // Open a file descriptor for the windows message queue fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY); if (fdMessageQueue == -1) { NSLog(@"Failed opening %s\n", WIN_MSG_QUEUE_FNAME); exit(1); } [currentRunLoop addEvent: (void*)fdMessageQueue type: ET_RDESC watcher: (id)self forMode: mode]; #else [currentRunLoop addEvent: (void*)0 type: ET_WINMSG watcher: (id)self forMode: mode]; #endif } @end LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_CREATE: // Add the window to the clipboard viewer chain. hwndNextViewer = SetClipboardViewer(hwnd); break; case WM_CHANGECBCHAIN: // If the next window is closing, repair the chain. if ((HWND) wParam == hwndNextViewer) hwndNextViewer = (HWND) lParam; // Otherwise, pass the message to the next link. else if (hwndNextViewer != NULL) SendMessage(hwndNextViewer, uMsg, wParam, lParam); break; case WM_DESTROY: ChangeClipboardChain(hwnd, hwndNextViewer); PostQuitMessage(0); break; case WM_DRAWCLIPBOARD: // clipboard contents changed. if (wpb != nil) [wpb clipboardHasData]; // Pass the message to the next window in clipboard // viewer chain. if (hwndNextViewer != NULL) SendMessage(hwndNextViewer, uMsg, wParam, lParam); break; case WM_RENDERFORMAT: [wpb setClipboardData]; break; case WM_RENDERALLFORMATS: if (!OpenClipboard(hwnd)) { NSWarnMLog(@"Failed to get the Win32 clipboard. %d", GetLastError()); } else if (GetClipboardOwner() == hwnd) { if (!EmptyClipboard()) { NSWarnMLog(@"Failed to get the Win32 clipboard. %d", GetLastError()); } else { SendMessage(hwnd, WM_RENDERFORMAT, CF_UNICODETEXT, 0); CloseClipboard(); } } break; default: return DefWindowProc(hwnd, uMsg, wParam, lParam); } return (LRESULT) NULL; } gnustep-back-0.29.0/Tools/xpbs.m000066400000000000000000001326431404163720200164270ustar00rootroot00000000000000/* xpbs.m GNUstep pasteboard server - X extension Copyright (C) 1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: April 1999 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #include #if HAVE_XFIXES #include #endif /* * Non-predefined atoms that are used in the X selection mechanism */ static char *atom_names[] = { "CHARACTER_POSITION", "CLIENT_WINDOW", "HOST_NAME", "HOSTNAME", "LENGTH", "LIST_LENGTH", "NAME", "OWNER_OS", "SPAN", "TARGETS", "TIMESTAMP", "USER", "TEXT", "NULL", "FILE_NAME", "CLIPBOARD", "UTF8_STRING", "MULTIPLE", "COMPOUND_TEXT", "INCR", // some MIME types "text/plain", "text/uri-list", "application/postscript", "text/tab-separated-values", "text/richtext", "image/tiff", "application/octet-stream", "application/x-rootwindow-drop", "application/richtext", "text/rtf", "text/html", "application/xhtml+xml", "image/png", "image/svg", "application/rtf", "text/richtext" }; static Atom atoms[sizeof(atom_names)/sizeof(char*)]; /* * Macros to access elements in atom_names array. */ #define XG_CHAR_POSITION atoms[0] #define XG_CLIENT_WINDOW atoms[1] #define XG_HOST_NAME atoms[2] #define XG_HOSTNAME atoms[3] #define XG_LENGTH atoms[4] #define XG_LIST_LENGTH atoms[5] #define XG_NAME atoms[6] #define XG_OWNER_OS atoms[7] #define XG_SPAN atoms[8] #define XG_TARGETS atoms[9] #define XG_TIMESTAMP atoms[10] #define XG_USER atoms[11] #define XG_TEXT atoms[12] #define XG_NULL atoms[13] #define XG_FILE_NAME atoms[14] #define XA_CLIPBOARD atoms[15] #define XG_UTF8_STRING atoms[16] #define XG_MULTIPLE atoms[17] #define XG_COMPOUND_TEXT atoms[18] #define XG_INCR atoms[19] #define XG_MIME_PLAIN atoms[20] #define XG_MIME_URI atoms[21] #define XG_MIME_PS atoms[22] #define XG_MIME_TSV atoms[23] #define XG_MIME_RICHTEXT atoms[24] #define XG_MIME_TIFF atoms[25] #define XG_MIME_OCTET atoms[26] #define XG_MIME_ROOTWINDOW atoms[27] #define XG_MIME_APP_RICHTEXT atoms[28] #define XG_MIME_RTF atoms[29] #define XG_MIME_HTML atoms[30] #define XG_MIME_XHTML atoms[31] #define XG_MIME_PNG atoms[32] #define XG_MIME_SVG atoms[33] #define XG_MIME_APP_RTF atoms[34] #define XG_MIME_TEXT_RICHTEXT atoms[35] @interface XPbOwner : NSObject { NSPasteboard *_pb; NSData *_obj; NSString *_name; Atom _xPb; Time _waitingForSelection; Time _timeOfLastAppend; Time _timeOfSetSelectionOwner; BOOL _ownedByOpenStep; } + (XPbOwner*) ownerByXPb: (Atom)p; + (XPbOwner*) ownerByOsPb: (NSString*)p; + (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode; + (NSDate*) timedOutEvent: (void*)data type: (RunLoopEventType)type forMode: (NSString*)mode; + (void) xEvent: (XEvent *)xEvent; + (void) xPropertyNotify: (XPropertyEvent*)xEvent; + (void) xSelectionClear: (XSelectionClearEvent*)xEvent; + (void) xSelectionNotify: (XSelectionEvent*)xEvent; + (void) xSelectionRequest: (XSelectionRequestEvent*)xEvent; - (NSData*) data; - (id) initWithXPb: (Atom)x osPb: (NSPasteboard*)o; - (BOOL) ownedByOpenStep; - (NSPasteboard*) osPb; - (void) pasteboardChangedOwner: (NSPasteboard*)sender; - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type; - (void) setData: (NSData*)obj; - (void) setOwnedByOpenStep: (BOOL)flag; - (void) setTimeOfLastAppend: (Time)when; - (void) setWaitingForSelection: (Time)when; - (Time) timeOfLastAppend; - (Time) waitingForSelection; - (Atom) xPb; - (void) xSelectionClear; - (void) xSelectionNotify: (XSelectionEvent*)xEvent; - (void) xSelectionRequest: (XSelectionRequestEvent*)xEvent; #if HAVE_XFIXES + (void) xFixesSelectionNotify: (XFixesSelectionNotifyEvent*)xEvent; #endif - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent; - (Time) xTimeByAppending; - (BOOL) xSendData: (unsigned char*) data format: (int) format items: (int) numItems type: (Atom) xType to: (Window) window property: (Atom) property; @end // Special subclass for the drag pasteboard @interface XDragPbOwner : XPbOwner { } @end /* * The display we are using - everything refers to it. */ static Display *xDisplay; static Window xRootWin; static Window xAppWin; static NSMapTable *ownByX; static NSMapTable *ownByO; static NSString *xWaitMode = @"XPasteboardWaitMode"; static int xFixesEventBase; @implementation XPbOwner + (BOOL) initializePasteboard { XPbOwner *o; NSPasteboard *p; Atom generalPb, selectionPb; NSRunLoop *l = [NSRunLoop currentRunLoop]; int desc; ownByO = NSCreateMapTable(NSObjectMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0); ownByX = NSCreateMapTable(NSIntMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0); xDisplay = XOpenDisplay(NULL); if (xDisplay == 0) { NSLog(@"Unable to open X display - no X interoperation available"); return NO; } /* * Set up atoms for use in X selection mechanism. */ #ifdef HAVE_XINTERNATOMS XInternAtoms(xDisplay, atom_names, sizeof(atom_names)/sizeof(char*), False, atoms); #else { int atomCount; for (atomCount = 0; atomCount < sizeof(atom_names)/sizeof(char*); atomCount++) atoms[atomCount] = XInternAtom(xDisplay, atom_names[atomCount], False); } #endif xRootWin = RootWindow(xDisplay, DefaultScreen(xDisplay)); xAppWin = XCreateSimpleWindow(xDisplay, xRootWin, 0, 0, 100, 100, 1, 1, 0L); /* * Add the X descriptor to the run loop so we get callbacks when * X events arrive. */ desc = XConnectionNumber(xDisplay); [l addEvent: (void*)(gsaddr)desc type: ET_RDESC watcher: (id)self forMode: NSDefaultRunLoopMode]; [l addEvent: (void*)(gsaddr)desc type: ET_RDESC watcher: (id)self forMode: NSConnectionReplyMode]; [l addEvent: (void*)(gsaddr)desc type: ET_RDESC watcher: (id)self forMode: xWaitMode]; XSelectInput(xDisplay, xAppWin, PropertyChangeMask); #if HAVE_XFIXES { int error; // Subscribe to notifications of when the X clipboard changes, // so we can invalidate our cached list of types on it. // // FIXME: If we don't have Xfixes, we should really set up a polling timer. if (XFixesQueryExtension(xDisplay, &xFixesEventBase, &error)) { XFixesSelectSelectionInput(xDisplay, xAppWin, XA_CLIPBOARD, XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask ); XFixesSelectSelectionInput(xDisplay, xAppWin, XA_PRIMARY, XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); // FIXME: Also handle the dnd pasteboard NSDebugLLog(@"Pbs", @"Subscribed to XFixes notifications"); } } #endif XFlush(xDisplay); /* * According to the new open desktop specification * http://www.freedesktop.org/standards/clipboards-spec/clipboards.txt * these two pasteboards should be switched around. That is, * general should be XA_CLIPBOARD and selection XA_PRIMARY. * The problem is that most X programs still use the old way. * For these environments we offer a switch to the old mode. */ if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSOldClipboard"]) { generalPb = XA_PRIMARY; selectionPb = XA_CLIPBOARD; } else { generalPb = XA_CLIPBOARD; selectionPb = XA_PRIMARY; } /* * For the general and the selection pasteboard we establish an initial * owner that is the X selection system. In this way, any X window * selection already active will be available to the GNUstep system. * These objects are not released! */ p = [NSPasteboard generalPasteboard]; o = [[XPbOwner alloc] initWithXPb: generalPb osPb: p]; [o xSelectionClear]; p = [NSPasteboard pasteboardWithName: @"Selection"]; o = [[XPbOwner alloc] initWithXPb: selectionPb osPb: p]; [o xSelectionClear]; p = [NSPasteboard pasteboardWithName: @"Secondary"]; o = [[XPbOwner alloc] initWithXPb: XA_SECONDARY osPb: p]; [o xSelectionClear]; // Call this to get the class initialisation [XDragPbOwner class]; return YES; } + (XPbOwner*) ownerByOsPb: (NSString*)p { return (XPbOwner*)NSMapGet(ownByO, (void*)(gsaddr)p); } + (XPbOwner*) ownerByXPb: (Atom)x { return (XPbOwner*)NSMapGet(ownByX, (void*)(gsaddr)x); } /* * This is the event handler called by the runloop when the X descriptor * has data available to read. */ + (void) receivedEvent: (void*)data type: (RunLoopEventType)type extra: (void*)extra forMode: (NSString*)mode { int count; NSAssert(type == ET_RDESC, NSInternalInconsistencyException); while ((count = XPending(xDisplay)) > 0) { #if 0 /* Don't attempt to be smart here. We may enter this method recursively * when further data is requested while processing this event, which * means that the count will no longer be correct when returning to the * outer invocation. */ while (count-- > 0) #endif { XEvent xEvent; XNextEvent(xDisplay, &xEvent); [self xEvent: &xEvent]; } } } /* * This handler called if an operation times out - never happens 'cos we * don't supply any timeouts - included for protocol conformance. */ + (NSDate*) timedOutEvent: (void*)data type: (RunLoopEventType)type forMode: (NSString*)mode { return nil; } #define FULL_LENGTH 8192L /* Amount to read */ + (void) xEvent: (XEvent *)xEvent { switch (xEvent->type) { case PropertyNotify: NSDebugLLog(@"Pbs", @"PropertyNotify."); [self xPropertyNotify: &xEvent->xproperty]; break; case SelectionNotify: NSDebugLLog(@"Pbs", @"SelectionNotify."); [self xSelectionNotify: &xEvent->xselection]; break; case SelectionClear: NSDebugLLog(@"Pbs", @"SelectionClear."); [self xSelectionClear: &xEvent->xselectionclear]; break; case SelectionRequest: NSDebugLLog(@"Pbs", @"SelectionRequest."); [self xSelectionRequest: &xEvent->xselectionrequest]; break; default: #if HAVE_XFIXES if (xEvent->type == xFixesEventBase + XFixesSelectionNotify) { [self xFixesSelectionNotify: (XFixesSelectionNotifyEvent*)xEvent]; break; } #endif NSDebugLLog(@"Pbs", @"Unexpected X event."); break; } } + (void) xSelectionClear: (XSelectionClearEvent*)xEvent { XPbOwner *o; o = [self ownerByXPb: xEvent->selection]; if (o == nil) { char *name = XGetAtomName(xDisplay, xEvent->selection); NSDebugLLog(@"Pbs", @"Selection clear for unknown selection - '%s'.", name); XFree(name); return; } if (xEvent->window != (Window)xAppWin) { NSDebugLLog(@"Pbs", @"Selection clear for wrong (not our) window."); return; } [o xSelectionClear]; } + (void) xPropertyNotify: (XPropertyEvent*)xEvent { XPbOwner *o; o = [self ownerByXPb: xEvent->atom]; if (o == nil) { char *name = XGetAtomName(xDisplay, xEvent->atom); NSDebugLLog(@"Pbs", @"Property notify for unknown property - '%s'.", name); XFree(name); return; } if (xEvent->window != (Window)xAppWin) { NSDebugLLog(@"Pbs", @"Property notify for wrong (not our) window."); return; } if (xEvent->time != 0) { [o setTimeOfLastAppend: xEvent->time]; } } + (void) xSelectionNotify: (XSelectionEvent*)xEvent { XPbOwner *o; o = [self ownerByXPb: xEvent->selection]; if (o == nil) { char *name = XGetAtomName(xDisplay, xEvent->selection); NSDebugLLog(@"Pbs", @"Selection notify for unknown selection - '%s'.", name); XFree(name); return; } if (xEvent->requestor != (Window)xAppWin) { NSDebugLLog(@"Pbs", @"Selection notify for wrong (not our) window."); return; } else { char *sel_name = XGetAtomName(xDisplay, xEvent->selection); char *pro_name; if (xEvent->property == None) pro_name = NULL; else pro_name = XGetAtomName(xDisplay, xEvent->property); NSDebugLLog(@"Pbs", @"Selection (%s) notify - '%s'.", sel_name, pro_name? pro_name : "None"); XFree(sel_name); if (pro_name) XFree(pro_name); } [o xSelectionNotify: xEvent]; } #if HAVE_XFIXES + (void) xFixesSelectionNotify: (XFixesSelectionNotifyEvent*)xEvent { XPbOwner *o = [self ownerByXPb: xEvent->selection]; if (o != nil) { if (xEvent->owner != (Window)xAppWin) { NSDebugLLog(@"Pbs", @"Notified that selection %@ changed", [[o osPb] name]); // FIXME: Invalidate the cached types in the pasteboard since they are no longer valid } else { // The notification is telling us that we became the selection owner, // which we already know about since we must have initiated that change. } } } #endif + (void) xSelectionRequest: (XSelectionRequestEvent*)xEvent { XPbOwner *o; o = [self ownerByXPb: xEvent->selection]; if (o == nil) { char *name = XGetAtomName(xDisplay, xEvent->selection); NSDebugLLog(@"Pbs", @"Selection request for unknown selection - '%s'.", name); XFree(name); return; } if (xEvent->requestor == (Window)xAppWin) { NSDebugLLog(@"Pbs", @"Selection request for wrong (our) window."); return; } if (xEvent->property == None) { NSDebugLLog(@"Pbs", @"Selection request without reply property set."); return; } [o xSelectionRequest: xEvent]; } - (NSData*) data { return _obj; } - (void) dealloc { RELEASE(_pb); RELEASE(_obj); /* * Remove self from map of X pasteboard owners. */ NSMapRemove(ownByX, (void*)(gsaddr)_xPb); NSMapRemove(ownByO, (void*)(gsaddr)_name); [super dealloc]; } - (id) initWithXPb: (Atom)x osPb: (NSPasteboard*)o { _pb = RETAIN(o); _name = [_pb name]; _xPb = x; /* * Add self to map of all X pasteboard owners. */ NSMapInsert(ownByX, (void*)(gsaddr)_xPb, (void*)(gsaddr)self); NSMapInsert(ownByO, (void*)(gsaddr)_name, (void*)(gsaddr)self); return self; } - (NSPasteboard*) osPb { return _pb; } - (BOOL) ownedByOpenStep { return _ownedByOpenStep; } - (void) pasteboardChangedOwner: (NSPasteboard*)sender { Window w; /* * If this gets called, a GNUstep object has grabbed the pasteboard * or has changed the types of data available from the pasteboard * so we must tell the X server that we have the current selection. * To conform to ICCCM we need to specify an up-to-date timestamp. */ // FIXME: See note in -xSelectionClear:. This method is called by // -[NSPasteboard declareTypes:owner:], but we might not want // GNUstep to take ownership. (e.g. suppose selection ownership changes from // gnome-terminal to OpenOffice.org. But, we will still need to update the // types available on the pasteboard in case a GNUstep app wants to read from // the pasteboard.) _timeOfSetSelectionOwner = [self xTimeByAppending]; XSetSelectionOwner(xDisplay, _xPb, xAppWin, _timeOfSetSelectionOwner); w = XGetSelectionOwner(xDisplay, _xPb); if (w != xAppWin) { NSLog(@"Failed to set X selection owner to the pasteboard server."); } else { [self setOwnedByOpenStep: YES]; } } - (void) requestData: (Atom)xType { Time whenRequested; /* * Do a nul append to a property to get a timestamp, if it returns the * 'CurrentTime' constant then we haven't been able to get one. */ whenRequested = [self xTimeByAppending]; if (whenRequested != CurrentTime) { NSDate *limit; /* * Ok - we got a timestamp, so we can ask the selection system for * the pasteboard data that was/is valid for that time. * Ask the X system to provide the pasteboard data in the * appropriate property of our application root window. */ XConvertSelection(xDisplay, [self xPb], xType, [self xPb], xAppWin, whenRequested); XFlush(xDisplay); /* * Run an event loop to read X events until we have aquired the * pasteboard data we need. * However, before entering the event loop be sure to drain the X event * queue, since XFlush may read events from the X connection and thus * may have enqueued our expected property change notification in the * X event queue already. */ limit = [NSDate dateWithTimeIntervalSinceNow: 20.0]; [self setWaitingForSelection: whenRequested]; while (XQLength(xDisplay) > 0 && [self waitingForSelection] == whenRequested) { XEvent xEvent; XNextEvent(xDisplay, &xEvent); [[self class] xEvent: &xEvent]; } while ([self waitingForSelection] == whenRequested) { [[NSRunLoop currentRunLoop] runMode: xWaitMode beforeDate: limit]; if ([limit timeIntervalSinceNow] <= 0.0) break; /* Timeout */ } if ([self waitingForSelection] != 0) { char *name = XGetAtomName(xDisplay, xType); [self setWaitingForSelection: 0]; NSLog(@"Timed out waiting for X selection '%s'", name); XFree(name); } } } - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type { [self setData: nil]; /* * If this gets called, a GNUstep object wants the pasteboard contents * and a plain old X application is providing them, so we must grab * the info. */ if ([type isEqual: NSStringPboardType]) { [self requestData: XG_UTF8_STRING]; if ([self data] == nil) [self requestData: XA_STRING]; if ([self data] == nil) [self requestData: XG_TEXT]; } else if ([type isEqual: NSFilenamesPboardType]) { [self requestData: XG_FILE_NAME]; } else if ([type isEqual: NSRTFPboardType]) { [self requestData: XG_MIME_RTF]; if ([self data] == nil) [self requestData: XG_MIME_APP_RTF]; if ([self data] == nil) [self requestData: XG_MIME_TEXT_RICHTEXT]; } else if ([type isEqual: NSTIFFPboardType]) { [self requestData: XG_MIME_TIFF]; } // FIXME: Support more types else { NSDebugLLog(@"Pbs", @"Request for non-string info from X pasteboard: %@", type); } [pb setData: [self data] forType: type]; } - (void) setData: (NSData*)obj { ASSIGN(_obj, obj); } - (void) setOwnedByOpenStep: (BOOL)f { _ownedByOpenStep = f; } - (void) setTimeOfLastAppend: (Time)when { _timeOfLastAppend = when; } - (void) setWaitingForSelection: (Time)when { _waitingForSelection = when; } - (Time) timeOfLastAppend { return _timeOfLastAppend; } - (Time) waitingForSelection { return _waitingForSelection; } - (Atom) xPb { return _xPb; } static BOOL appendFailure; static int xErrorHandler(Display *d, XErrorEvent *e) { appendFailure = YES; return 0; } /* * Check to see what types of data the selection owner is * making available, and declare them all. * If this fails, declare string data. */ - (NSArray*) availableTypes { NSMutableArray *types; NSData *data; unsigned int count; unsigned int i; Atom *targets; NSDebugLLog(@"Pbs", @"%@ availableTypes called", [[self osPb] name]); [self setData: nil]; [self requestData: XG_TARGETS]; data = [self data]; if (data == nil) return [NSArray arrayWithObject: NSStringPboardType]; count = [data length] / sizeof(Atom); targets = (Atom*)[data bytes]; types = [NSMutableArray arrayWithCapacity: count]; NSDebugLLog(@"Pbs", @"%@ availableTypes: %d types available", [[self osPb] name], count); for (i = 0; i < count; i++) { Atom type; type = targets[i]; if ((type == XG_UTF8_STRING) || (type == XA_STRING) || (type == XG_TEXT) || (type == XG_MIME_PLAIN)) { [types addObject: NSStringPboardType]; } else if (type == XG_FILE_NAME) { [types addObject: NSFilenamesPboardType]; } else if ((type == XG_MIME_RTF) || (type == XG_MIME_APP_RTF) || (type == XG_MIME_TEXT_RICHTEXT)) { [types addObject: NSRTFPboardType]; } else if (type == XG_MIME_TIFF) { [types addObject: NSTIFFPboardType]; } else if ((type == XG_TARGETS) || (type == XG_TIMESTAMP) || (type == XG_OWNER_OS) || (type == XG_USER) || (type == XG_HOST_NAME) || (type == XG_HOSTNAME) || (type == XG_MULTIPLE)) { // Standard types } // FIXME: Support more types else { char *name = XGetAtomName(xDisplay, type); // FIXME: We should rather add this type to the // pasteboard as a string. NSDebugLLog(@"Pbs", @"Unsupported selection type '%s' available", name); XFree(name); } } return types; } /* * Should be called when ever the clipboard contents changes. * Currently it gets called when GNUstep looses the ownership * of the clipboard. */ - (void) xSelectionClear { // FIXME: This will cause -pasteboardChangedOwner: to be called, which will // take ownership of the X selection. That is probably wrong... [_pb declareTypes: [self availableTypes] owner: self]; [self setOwnedByOpenStep: NO]; } - (NSMutableData*) getSelectionData: (XSelectionEvent*)xEvent type: (Atom*)type { int status; unsigned char *data; long long_offset = 0L; long long_length = FULL_LENGTH; Atom req_type = AnyPropertyType; Atom actual_type; int actual_format; unsigned long bytes_remaining; unsigned long number_items; NSMutableData *md = nil; /* * Read data from property identified in SelectionNotify event. */ do { status = XGetWindowProperty(xDisplay, xEvent->requestor, xEvent->property, long_offset, // offset long_length, False, // Aug 2011 - changed to False (don't delete property) req_type, &actual_type, &actual_format, &number_items, &bytes_remaining, &data); if ((status == Success) && (number_items > 0)) { long count; if (actual_type == XA_ATOM) { // xlib will report an actual_format of 32, even if // data contains an array of 64-bit Atoms count = number_items * sizeof(Atom); } else { count = number_items * actual_format / 8; } if (md == nil) { md = [[NSMutableData alloc] initWithBytes: (void *)data length: count]; req_type = actual_type; } else { if (req_type != actual_type) { char *req_name = XGetAtomName(xDisplay, req_type); char *act_name = XGetAtomName(xDisplay, actual_type); NSLog(@"Selection changed type from %s to %s.", req_name, act_name); XFree(req_name); XFree(act_name); RELEASE(md); return nil; } [md appendBytes: (void *)data length: count]; } long_offset += count / 4; if (data) { XFree(data); } } } while ((status == Success) && (bytes_remaining > 0)); if (status == Success) { *type = actual_type; return AUTORELEASE(md); } else { RELEASE(md); return nil; } } - (void) xSelectionNotify: (XSelectionEvent*)xEvent { Atom actual_type; NSMutableData *md = nil; if (xEvent->property == (Atom)None) { NSDebugLLog(@"Pbs", @"Owning program failed to convert data."); [self setWaitingForSelection: 0]; return; } if ([self waitingForSelection] > xEvent->time) { NSDebugLLog(@"Pbs", @"Unexpected selection notify - time %lu.", xEvent->time); return; } [self setWaitingForSelection: 0]; md = [self getSelectionData: xEvent type: &actual_type]; if (md != nil) { if (actual_type == XG_INCR) { XEvent event; NSMutableData *imd = nil; BOOL wait = YES; md = nil; while (wait) { XNextEvent(xDisplay, &event); if (event.type == PropertyNotify) { if (event.xproperty.state != PropertyNewValue) continue; imd = [self getSelectionData: xEvent type: &actual_type]; if (imd != nil) { if (md == nil) { md = imd; } else { [md appendData: imd]; } } else { wait = NO; } } } } } if (md != nil) { // Convert data to text string. if (actual_type == XG_UTF8_STRING) { NSString *s; NSData *d; s = [[NSString alloc] initWithData: md encoding: NSUTF8StringEncoding]; if (s != nil) { d = [NSSerializer serializePropertyList: s]; RELEASE(s); [self setData: d]; } } else if ((actual_type == XA_STRING) || (actual_type == XG_TEXT) || (actual_type == XG_MIME_PLAIN)) { NSString *s; NSData *d; s = [[NSString alloc] initWithData: md encoding: NSISOLatin1StringEncoding]; if (s != nil) { d = [NSSerializer serializePropertyList: s]; RELEASE(s); [self setData: d]; } } else if (actual_type == XG_FILE_NAME) { NSArray *names; NSData *d; NSString *s; NSURL *url; s = [[NSString alloc] initWithData: md encoding: NSUTF8StringEncoding]; url = [[NSURL alloc] initWithString: s]; RELEASE(s); if ([url isFileURL]) { s = [url path]; names = [NSArray arrayWithObject: s]; d = [NSSerializer serializePropertyList: names]; [self setData: d]; } RELEASE(url); } else if ((actual_type == XG_MIME_RTF) || (actual_type == XG_MIME_APP_RTF) || (actual_type == XG_MIME_TEXT_RICHTEXT)) { [self setData: md]; } else if (actual_type == XG_MIME_TIFF) { [self setData: md]; } else if (actual_type == XA_ATOM) { // Used when requesting TARGETS to get available types [self setData: md]; } else { char *name = XGetAtomName(xDisplay, actual_type); NSDebugLLog(@"Pbs", @"Unsupported data type '%s' from X selection.", name); XFree(name); } } } - (void) xSelectionRequest: (XSelectionRequestEvent*)xEvent { XSelectionEvent notify_event; BOOL status; status = [self xProvideSelection: xEvent]; if (!status) NSDebugLLog(@"Pbs", @"Could not provide selection upon request."); /* * Set up the selection notify information from the event information * so we comply with the ICCCM. */ notify_event.display = xEvent->display; notify_event.type = SelectionNotify; notify_event.requestor = xEvent->requestor; notify_event.selection = xEvent->selection; notify_event.target = xEvent->target; notify_event.time = xEvent->time; notify_event.send_event = True; if (xEvent->property == None) { notify_event.property = xEvent->target; } else { notify_event.property = xEvent->property; } /* * If for any reason we cannot provide the data to the requestor, we must * send a selection notify with a property of 'None' so that the requestor * knows the request failed. */ if (status == NO) notify_event.property = None; XSendEvent(xEvent->display, xEvent->requestor, False, 0L, (XEvent*)¬ify_event); } - (BOOL) xProvideSelection: (XSelectionRequestEvent*)xEvent { NSArray *types = [_pb types]; Atom xType = XG_NULL; unsigned char *data = 0; int format = 0; int numItems = 0; if (xEvent->target == XG_TARGETS) { unsigned numTypes = 0; // ATTENTION: Increase this array when adding more types Atom xTypes[16]; /* * The requestor wants a list of the types we can supply it with. * We can supply one or more types of data to the requestor so * we will give it a list of the types supported. */ xTypes[numTypes++] = XG_TARGETS; xTypes[numTypes++] = XG_TIMESTAMP; xTypes[numTypes++] = XG_MULTIPLE; xTypes[numTypes++] = XG_USER; xTypes[numTypes++] = XG_HOST_NAME; xTypes[numTypes++] = XG_OWNER_OS; // FIXME: ICCCM requires even more types from us. if ([types containsObject: NSStringPboardType]) { xTypes[numTypes++] = XG_UTF8_STRING; xTypes[numTypes++] = XG_COMPOUND_TEXT; xTypes[numTypes++] = XA_STRING; xTypes[numTypes++] = XG_TEXT; } if ([types containsObject: NSFilenamesPboardType]) { xTypes[numTypes++] = XG_FILE_NAME; } if ([types containsObject: NSRTFPboardType]) { xTypes[numTypes++] = XG_MIME_RTF; xTypes[numTypes++] = XG_MIME_APP_RTF; xTypes[numTypes++] = XG_MIME_TEXT_RICHTEXT; } if ([types containsObject: NSTIFFPboardType]) { xTypes[numTypes++] = XG_MIME_TIFF; } xType = XA_ATOM; format = 32; numItems = numTypes; data = malloc(numTypes*sizeof(Atom)); memcpy(data, xTypes, numTypes*sizeof(Atom)); } else if (xEvent->target == XG_TIMESTAMP) { xType = XA_INTEGER; format = 32; numItems = 1; data = malloc(sizeof(int)); memcpy(data, &_timeOfSetSelectionOwner, sizeof(int)); } else if (xEvent->target == XG_USER) { NSString *s = NSUserName(); NSData *d = nil; xType = XG_TEXT; format = 8; d = [s dataUsingEncoding: NSISOLatin1StringEncoding]; if (d != nil) { numItems = [d length]; data = malloc(numItems + 1); if (data) [d getBytes: data]; } } else if (xEvent->target == XG_OWNER_OS) { NSString *s = [[NSProcessInfo processInfo] operatingSystemName]; NSData *d = nil; xType = XG_TEXT; format = 8; d = [s dataUsingEncoding: NSISOLatin1StringEncoding]; if (d != nil) { numItems = [d length]; data = malloc(numItems + 1); if (data) [d getBytes: data]; } } else if ((xEvent->target == XG_HOST_NAME) || (xEvent->target == XG_HOSTNAME)) { NSString *s = [[NSProcessInfo processInfo] hostName]; NSData *d = nil; xType = XG_TEXT; format = 8; d = [s dataUsingEncoding: NSISOLatin1StringEncoding]; if (d != nil) { numItems = [d length]; data = malloc(numItems + 1); if (data) [d getBytes: data]; } } else if (xEvent->target == AnyPropertyType) { /* * The requestor will accept any type of data - so we use the first * OpenStep type that corresponds to a known X type. */ if ([types containsObject: NSStringPboardType]) { xEvent->target = XG_UTF8_STRING; [self xProvideSelection: xEvent]; } else if ([types containsObject: NSFilenamesPboardType]) { xEvent->target = XG_FILE_NAME; [self xProvideSelection: xEvent]; } else if ([types containsObject: NSRTFPboardType]) { xEvent->target = XG_MIME_RTF; [self xProvideSelection: xEvent]; } else if ([types containsObject: NSTIFFPboardType]) { xEvent->target = XG_MIME_TIFF; [self xProvideSelection: xEvent]; } } else if (xEvent->target == XG_MULTIPLE) { if (xEvent->property != None) { Atom *multipleAtoms= NULL; int actual_format; Atom actual_type; unsigned long number_items, bytes_remaining; int status; status = XGetWindowProperty(xDisplay, xEvent->requestor, xEvent->property, 0, 100, False, AnyPropertyType, &actual_type, &actual_format, &number_items, &bytes_remaining, (unsigned char **)&multipleAtoms); if ((status == Success) && (bytes_remaining == 0) && (actual_format == 32) && (actual_type == XA_ATOM)) { int i; XSelectionRequestEvent requestEvent; memcpy(&requestEvent, xEvent, sizeof(XSelectionRequestEvent)); for (i = 0; i < number_items; i += 2) { requestEvent.target= multipleAtoms[i]; requestEvent.property= multipleAtoms[i+1]; if (requestEvent.target != None) { // Recursive call to this method for each pair. if (![self xProvideSelection: &requestEvent]) { multipleAtoms[i+1]= None; } } } // FIXME: Should we call XChangeProperty to set the invalid types? } } } else if ((xEvent->target == XG_COMPOUND_TEXT) && [types containsObject: NSStringPboardType]) { NSString *s = [_pb stringForType: NSStringPboardType]; const char *d; int status; xType = XG_COMPOUND_TEXT; format = 8; d = [s cString]; if (d) { char *list[]= {(char *)d, NULL}; XTextProperty textProperty; status = XmbTextListToTextProperty(xEvent->display, list, 1, XCompoundTextStyle, &textProperty); if (status == Success) { NSAssert(textProperty.format == 8, @"textProperty.format == 8"); numItems = textProperty.nitems; data = malloc(numItems + 1); memcpy(data, textProperty.value, numItems + 1); XFree((void *)textProperty.value); } } } else if (((xEvent->target == XG_UTF8_STRING) || (xEvent->target == XA_STRING) || (xEvent->target == XG_TEXT)) && [types containsObject: NSStringPboardType]) { NSString *s = [_pb stringForType: NSStringPboardType]; NSData *d = nil; xType = xEvent->target; format = 8; /* * Now we know what type of data is required - so get it from the * pasteboard and convert to a format X can understand. */ if (xType == XG_UTF8_STRING) { d = [s dataUsingEncoding: NSUTF8StringEncoding]; } else if ((xType == XA_STRING) || (xType == XG_TEXT)) { d = [s dataUsingEncoding: NSISOLatin1StringEncoding]; } if (d != nil) { numItems = [d length]; data = malloc(numItems + 1); if (data) [d getBytes: data]; } } else if ((xEvent->target == XG_FILE_NAME) && [types containsObject: NSFilenamesPboardType]) { NSArray *names = [_pb propertyListForType: NSFilenamesPboardType]; NSString *file = [[names lastObject] stringByStandardizingPath]; NSURL *url = [[NSURL alloc] initWithScheme: NSURLFileScheme host: @"localhost" path: file]; NSString *s = [url absoluteString]; NSData *d; RELEASE(url); d = [s dataUsingEncoding: NSISOLatin1StringEncoding]; xType = xEvent->target; format = 8; if (d != nil) { numItems = [d length]; data = malloc(numItems + 1); if (data) [d getBytes: data]; } } else if (((xEvent->target == XG_MIME_RTF) || (xEvent->target == XG_MIME_APP_RTF) || (xEvent->target == XG_MIME_TEXT_RICHTEXT)) && [types containsObject: NSRTFPboardType]) { NSData *d = [_pb dataForType: NSRTFPboardType]; xType = xEvent->target; format = 8; if (d != nil) { numItems = [d length]; data = malloc(numItems + 1); if (data) [d getBytes: data]; } } else if ((xEvent->target == XG_MIME_TIFF) && [types containsObject: NSTIFFPboardType]) { NSData *d = [_pb dataForType: NSTIFFPboardType]; xType = xEvent->target; format = 8; if (d != nil) { numItems = [d length]; data = malloc(numItems + 1); if (data) [d getBytes: data]; } } // FIXME: Support more types else { char *name = XGetAtomName(xDisplay, xEvent->target); NSLog(@"Request for unsupported data type '%s'.", name); XFree(name); return NO; } return [self xSendData: data format: format items: numItems type: xType to: xEvent->requestor property: xEvent->property]; } - (BOOL) xSendData: (unsigned char*) data format: (int) format items: (int) numItems type: (Atom) xType to: (Window) window property: (Atom) property { BOOL status = NO; /* * If we have managed to convert data of the appropritate type, we must now * append the data to the property on the requesting window. * We do this in small chunks, checking for errors, in case the window * manager puts a limit on the data size we can use. * This is not thread-safe - but I think that's a general problem with X. */ if (data != 0 && numItems != 0 && format != 0) { int (*oldHandler)(Display*, XErrorEvent*); int mode = PropModeReplace; int pos = 0; int maxItems = 4096 * 8 / format; appendFailure = NO; oldHandler = XSetErrorHandler(xErrorHandler); while (appendFailure == NO && pos < numItems) { if (pos + maxItems > numItems) { maxItems = numItems - pos; } XChangeProperty(xDisplay, window, property, xType, format, mode, &data[pos*format/8], maxItems); mode = PropModeAppend; pos += maxItems; XSync(xDisplay, False); } free(data); XSetErrorHandler(oldHandler); if (appendFailure == NO) { status = YES; } } return status; } - (Time) xTimeByAppending { NSDate *limit; Time whenRequested; Atom actualType = 0; int actualFormat = 0; unsigned long ni; unsigned long ba; unsigned char *pr; /* * Do a nul append to a property to get a timestamp, * - but first we must determine the property-type and format. */ XGetWindowProperty(xDisplay, xAppWin, [self xPb], 0, 0, False, AnyPropertyType, &actualType, &actualFormat, &ni, &ba, &pr); if (pr != 0) XFree(pr); if (actualType == None) { /* * The property doesn't exist - so we will be creating a new (empty) * property. */ actualType = XA_ATOM; actualFormat = 32; } XChangeProperty(xDisplay, xAppWin, [self xPb], actualType, actualFormat, PropModeReplace, 0, 0); XFlush(xDisplay); limit = [NSDate dateWithTimeIntervalSinceNow: 3.0]; [self setTimeOfLastAppend: 0]; /* * Run an event loop until we get a notification for our nul append. * this will give us an up-to-date timestamp as required by ICCCM. * However, before entering the event loop be sure to drain the X event * queue, since XFlush may read events from the X connection and thus may * have enqueued our expected property change notification in the X event * queue already. */ while (XQLength(xDisplay) && [self timeOfLastAppend] == 0) { XEvent xEvent; XNextEvent(xDisplay, &xEvent); [[self class] xEvent: &xEvent]; } while ([self timeOfLastAppend] == 0) { [[NSRunLoop currentRunLoop] runMode: xWaitMode beforeDate: limit]; if ([limit timeIntervalSinceNow] <= 0.0) break; /* Timeout */ } if ((whenRequested = [self timeOfLastAppend]) == 0) { NSLog(@"Timed out waiting for X append for %@", _name); whenRequested = CurrentTime; } return whenRequested; } @end // This are copies of functions from XGContextEvent.m. // We should create a separate file for them. static inline Atom * mimeTypeForPasteboardType(Display *xDisplay, NSZone *zone, NSArray *types) { Atom *typelist; int count = [types count]; int i; typelist = NSZoneMalloc(zone, (count+1) * sizeof(Atom)); for (i = 0; i < count; i++) { NSString *mime = [NSPasteboard mimeTypeForPasteboardType: [types objectAtIndex: i]]; typelist[i] = XInternAtom(xDisplay, [mime cString], False); } typelist[count] = 0; return typelist; } static inline NSArray * pasteboardTypeForMimeType(Display *xDisplay, NSZone *zone, Atom *typelist) { Atom *type = typelist; NSMutableArray *newTypes = [[NSMutableArray allocWithZone: zone] init]; while (*type != None) { char *s = XGetAtomName(xDisplay, *type); if (s) { [newTypes addObject: [NSPasteboard pasteboardTypeForMimeType: [NSString stringWithCString: s]]]; XFree(s); } } return AUTORELEASE(newTypes); } static DndClass dnd; @implementation XDragPbOwner + (void) initialize { if (self == [XDragPbOwner class]) { NSPasteboard *p; xdnd_init(&dnd, xDisplay); p = [NSPasteboard pasteboardWithName: NSDragPboard]; [[XDragPbOwner alloc] initWithXPb: dnd.XdndSelection osPb: p]; } } - (void) pasteboardChangedOwner: (NSPasteboard*)sender { NSArray *types; Atom *typelist; [super pasteboardChangedOwner: sender]; // We also have to set the supported types for our window types = [_pb types]; typelist = mimeTypeForPasteboardType(xDisplay, [self zone], types); xdnd_set_type_list(&dnd, xAppWin, typelist); NSZoneFree([self zone], typelist); } - (NSArray*) availableTypes { Window window; Atom *types; NSArray *newTypes; window = XGetSelectionOwner(xDisplay, dnd.XdndSelection); if (window == None) return nil; xdnd_get_type_list(&dnd, window, &types); newTypes = pasteboardTypeForMimeType(xDisplay, [self zone], types); free(types); return newTypes; } - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type { NSString *mime = [NSPasteboard mimeTypeForPasteboardType: type]; Atom mType = XInternAtom(xDisplay, [mime cString], False); [self setData: nil]; [self requestData: mType]; [pb setData: [self data] forType: type]; } - (void) xSelectionClear { // Do nothing as we don't know, which new types will be supplied [self setOwnedByOpenStep: NO]; } @end gnustep-back-0.29.0/Version000066400000000000000000000012051404163720200155320ustar00rootroot00000000000000# This file is included in various Makefile's to get version information. # Copyright (C) 2002 Free Software Foundation # The version number of this release. GNUSTEP_BACK_MAJOR_VERSION=0 GNUSTEP_BACK_MINOR_VERSION=29 GNUSTEP_BACK_SUBMINOR_VERSION=0 # This numeric value should match above VERSION_NUMBER=029.0 # This numeric value should match the compatible gui interface version INTERFACE_VERSION_NUMBER=029 GNUSTEP_BACK_VERSION=${GNUSTEP_BACK_MAJOR_VERSION}.${GNUSTEP_BACK_MINOR_VERSION}.${GNUSTEP_BACK_SUBMINOR_VERSION} VERSION=${GNUSTEP_BACK_VERSION} GNUSTEP_BACK_FTP_MACHINE=ftp.gnustep.org GNUSTEP_BACK_FTP_DIRECTORY=pub/gnustep/core gnustep-back-0.29.0/back.make.in000066400000000000000000000031221404163720200163260ustar00rootroot00000000000000# -*-makefile-*- # back.make # # Makefile flags and configs to build with the back library. # # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Nicola Pero # Based on code originally in the gnustep make package # # This file is part of the GNUstep Back Library. # # 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 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. ifeq ($(BACK_MAKE_LOADED),) BACK_MAKE_LOADED=yes ifeq ($(BACKEND_BUNDLE),) GRAPHIC_LIBS=@LIBS@ GRAPHIC_CFLAGS=@CPPFLAGS@ GRAPHIC_LFLAGS=@LDFLAGS@ X_PRE_LIBS=@X_PRE_LIBS@ BACKEND_LDFLAGS = BACKEND_LIBS = -lgnustep-@BACKEND_NAME@ BACKEND_DEFINE = -DBACKEND_LIBRARY=1 -D@BACKEND_NAME@_BACKEND_LIBRARY=1 SYSTEM_INCLUDES = $(CONFIG_SYSTEM_INCL) $(GRAPHIC_CFLAGS) SYSTEM_LDFLAGS = SYSTEM_LIB_DIR = $(GRAPHIC_LFLAGS) SYSTEM_LIBS = $(GRAPHIC_LIBS) endif endif # BACK_MAKE_LOADED gnustep-back-0.29.0/config.h.in000066400000000000000000000100071404163720200162050ustar00rootroot00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ #define SERVER_x11 1 #define SERVER_win32 2 #define SERVER_wayland 3 #define GRAPHICS_xdps 0 #define GRAPHICS_art 1 #define GRAPHICS_xlib 2 #define GRAPHICS_winlib 3 #define GRAPHICS_cairo 4 #define GRAPHICS_opal 5 /* Define to type of graphics context to build */ #undef BUILD_GRAPHICS /* Define to type of window server to build */ #undef BUILD_SERVER /* Define if X11 doesn't automatically use prototypes */ #undef FUNCPROTO /* Define to 1 if you have the header file. */ #undef HAVE_DPS_DPSCLIENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DPS_DPSNXARGS_H /* Define if you have FcPatternCreate */ #undef HAVE_FC /* Define if you have glitz-glx */ #undef HAVE_GLITZ_GLX /* Define if you have glitz-wgl */ #undef HAVE_GLITZ_WGL /* Define if you have the glx library */ #undef HAVE_GLX /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `Xext' library (-lXext). */ #undef HAVE_LIBXEXT /* Define to 1 if you have the `Xft' library (-lXft). */ #undef HAVE_LIBXFT /* Define to 1 if you have the `Xmu' library (-lXmu). */ #undef HAVE_LIBXMU /* Define to 1 if you have the `Xt' library (-lXt). */ #undef HAVE_LIBXT /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `shmctl' function. */ #undef HAVE_SHMCTL /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define if you have XftDrawStringUtf8 */ #undef HAVE_UTF8 /* Define if you have the wgl library */ #undef HAVE_WGL /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_SHAPE_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_SYNC_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XSHM_H /* Define to enable Xcursor support */ #undef HAVE_XCURSOR /* Define to enable Xfixes support */ #undef HAVE_XFIXES /* Define if you have a functional XFreeType installation, including libXft. */ #undef HAVE_XFT /* Define to 1 if you have 'XInternAtoms' function. */ #undef HAVE_XINTERNATOMS /* Define to enable Xshape support */ #undef HAVE_XSHAPE /* Define to 1 if you have the `Xutf8LookupString' function. */ #undef HAVE_XUTF8LOOKUPSTRING /* Define to enable Xrandr support */ #undef HAVE_XRANDR /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to enable glitz support */ #undef USE_GLITZ /* Define to enable XIM support */ #undef USE_XIM /* Define if you have X11 XRender extension */ #undef XRENDER /* Define if you have X11 XShm extensions */ #undef XSHM /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING gnustep-back-0.29.0/config.make.in000066400000000000000000000005031404163720200166730ustar00rootroot00000000000000# -*-makefile-*- # Extra make variables for backend library # WITH_WRASTER=@WITH_WRASTER@ WITH_XFT=@WITH_XFT@ WITH_GLITZ=@WITH_GLITZ@ GRAPHIC_LIBS=@LIBS@ GRAPHIC_CFLAGS=@CPPFLAGS@ GRAPHIC_LFLAGS=@LDFLAGS@ X_PRE_LIBS=@X_PRE_LIBS@ BUILD_SERVER=@BUILD_SERVER@ BUILD_GRAPHICS=@BUILD_GRAPHICS@ BACKEND_NAME=@BACKEND_NAME@ gnustep-back-0.29.0/configure000077500000000000000000010003361404163720200160760ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="back.make.in" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS BACKEND_NAME WARN_FLAGS BUILD_SERVER BUILD_GRAPHICS WITH_WRASTER WITH_GLITZ GLITZ_WGL_LIBS GLITZ_WGL_CFLAGS GLITZ_GLX_LIBS GLITZ_GLX_CFLAGS GLITZ_LIBS GLITZ_CFLAGS FONTCONFIG_LIBS FONTCONFIG_CFLAGS CAIRO_GLITZ_LIBS CAIRO_GLITZ_CFLAGS CAIRO_WIN32_LIBS CAIRO_WIN32_CFLAGS CAIRO_XLIB_LIBS CAIRO_XLIB_CFLAGS CAIRO_FT_LIBS CAIRO_FT_CFLAGS CAIRO_LIBS CAIRO_CFLAGS WITH_WGL WITH_GLX WITH_XFT XFT_LIBS XFT_CFLAGS FREETYPE_LIBS FREETYPE_CFLAGS XMU_LIBS XMU_CFLAGS XT_LIBS XT_CFLAGS XEXT_LIBS XEXT_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_tiff_library with_x with_freetype enable_glx enable_xim enable_wgl enable_glitz enable_server enable_graphics with_name ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR XEXT_CFLAGS XEXT_LIBS XT_CFLAGS XT_LIBS XMU_CFLAGS XMU_LIBS FREETYPE_CFLAGS FREETYPE_LIBS XFT_CFLAGS XFT_LIBS CAIRO_CFLAGS CAIRO_LIBS CAIRO_FT_CFLAGS CAIRO_FT_LIBS CAIRO_XLIB_CFLAGS CAIRO_XLIB_LIBS CAIRO_WIN32_CFLAGS CAIRO_WIN32_LIBS CAIRO_GLITZ_CFLAGS CAIRO_GLITZ_LIBS FONTCONFIG_CFLAGS FONTCONFIG_LIBS GLITZ_CFLAGS GLITZ_LIBS GLITZ_GLX_CFLAGS GLITZ_GLX_LIBS GLITZ_WGL_CFLAGS GLITZ_WGL_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-glx Disable GLX support --disable-xim Disable XIM support --disable-wgl Disable WGL support --enable-glitz Enable Glitz support --enable-server=SRV Build server type: x11, win32, wayland --enable-graphics=GPH Build graphics: xlib, xdps, winlib, art, cairo, opal Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tiff-library=DIR TIFF library file are in DIR --with-x use the X Window System --without-freetype Do not check for or include freetype --with-name=PREFIX Set the name of the backend (def=back) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path XEXT_CFLAGS C compiler flags for XEXT, overriding pkg-config XEXT_LIBS linker flags for XEXT, overriding pkg-config XT_CFLAGS C compiler flags for XT, overriding pkg-config XT_LIBS linker flags for XT, overriding pkg-config XMU_CFLAGS C compiler flags for XMU, overriding pkg-config XMU_LIBS linker flags for XMU, overriding pkg-config FREETYPE_CFLAGS C compiler flags for FREETYPE, overriding pkg-config FREETYPE_LIBS linker flags for FREETYPE, overriding pkg-config XFT_CFLAGS C compiler flags for XFT, overriding pkg-config XFT_LIBS linker flags for XFT, overriding pkg-config CAIRO_CFLAGS C compiler flags for CAIRO, overriding pkg-config CAIRO_LIBS linker flags for CAIRO, overriding pkg-config CAIRO_FT_CFLAGS C compiler flags for CAIRO_FT, overriding pkg-config CAIRO_FT_LIBS linker flags for CAIRO_FT, overriding pkg-config CAIRO_XLIB_CFLAGS C compiler flags for CAIRO_XLIB, overriding pkg-config CAIRO_XLIB_LIBS linker flags for CAIRO_XLIB, overriding pkg-config CAIRO_WIN32_CFLAGS C compiler flags for CAIRO_WIN32, overriding pkg-config CAIRO_WIN32_LIBS linker flags for CAIRO_WIN32, overriding pkg-config CAIRO_GLITZ_CFLAGS C compiler flags for CAIRO_GLITZ, overriding pkg-config CAIRO_GLITZ_LIBS linker flags for CAIRO_GLITZ, overriding pkg-config FONTCONFIG_CFLAGS C compiler flags for FONTCONFIG, overriding pkg-config FONTCONFIG_LIBS linker flags for FONTCONFIG, overriding pkg-config GLITZ_CFLAGS C compiler flags for GLITZ, overriding pkg-config GLITZ_LIBS linker flags for GLITZ, overriding pkg-config GLITZ_GLX_CFLAGS C compiler flags for GLITZ_GLX, overriding pkg-config GLITZ_GLX_LIBS linker flags for GLITZ_GLX, overriding pkg-config GLITZ_WGL_CFLAGS C compiler flags for GLITZ_WGL, overriding pkg-config GLITZ_WGL_LIBS linker flags for GLITZ_WGL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" # If GNUSTEP_MAKEFILES is undefined, try to use gnustep-config to determine it. if test -z "$GNUSTEP_MAKEFILES"; then GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5` fi if test -z "$GNUSTEP_MAKEFILES"; then as_fn_error $? "You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" "$LINENO" 5 fi #-------------------------------------------------------------------- # Use config.guess, config.sub and install-sh provided by gnustep-make #-------------------------------------------------------------------- ac_aux_dir= for ac_dir in $GNUSTEP_MAKEFILES "$srcdir"/$GNUSTEP_MAKEFILES; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in $GNUSTEP_MAKEFILES \"$srcdir\"/$GNUSTEP_MAKEFILES" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. #-------------------------------------------------------------------- # Determine the host, build, and target systems #-------------------------------------------------------------------- # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- #-------------------------------------------------------------------- # Find the compiler #-------------------------------------------------------------------- MAKECC=`gnustep-config --variable=CC` MAKECPP=`gnustep-config --variable=CPP` MAKECXX=`gnustep-config --variable=CXX` if test "$CC" = ""; then CC=$MAKECC else if test "$CC" != "$MAKECC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the compiler ($CC) set to a different value from that used by gnustep-make ($MAKECC). To a void conflicts/problems, reconfigure/reinstall gnustep-make to use $CC or run the gnustep-base configure again with your CC environment var iable set to $MAKECC" >&5 $as_echo "$as_me: WARNING: You are running configure with the compiler ($CC) set to a different value from that used by gnustep-make ($MAKECC). To a void conflicts/problems, reconfigure/reinstall gnustep-make to use $CC or run the gnustep-base configure again with your CC environment var iable set to $MAKECC" >&2;} fi fi if test "$CPP" = ""; then CPP=$MAKECPP else if test "$CPP" != "$MAKECPP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the preprocessor ($CPP) set to a different value from that used by gnustep-make ($MAKECPP). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CPP or run the gnustep-base configure again with your CPP environ ment variable set to $MAKECPP" >&5 $as_echo "$as_me: WARNING: You are running configure with the preprocessor ($CPP) set to a different value from that used by gnustep-make ($MAKECPP). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CPP or run the gnustep-base configure again with your CPP environ ment variable set to $MAKECPP" >&2;} fi fi if test "$CXX" = ""; then CXX=$MAKECXX else if test "$CXX" != "$MAKECXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the compiler ($CXX) set to a different value from that used by gnustep-make ($MAKECXX). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CXX or run the gnustep-base configure again with your CXX environment variable set to $MAKECXX" >&5 $as_echo "$as_me: WARNING: You are running configure with the compiler ($CXX) set to a different value from that used by gnustep-make ($MAKECXX). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CXX or run the gnustep-base configure again with your CXX environment variable set to $MAKECXX" >&2;} fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # The following is so that headers and custom libraries # in the GNUstep root are used before the standard ones #-------------------------------------------------------------------- GRAPHIC_CFLAGS="$CPPFLAGS" GRAPHIC_LFLAGS="$LDFLAGS" # # It looks like we ought to source the whole GNUstep.sh here, and even # ask it to output all variables! That way we have access to (eg) # GNUSTEP_SYSTEM_HEADERS below. # GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes . "$GNUSTEP_MAKEFILES/GNUstep.sh" unset GNUSTEP_SH_EXPORT_ALL_VARIABLES # For backwards compatibility, define GNUSTEP_SYSTEM_HEADERS from # GNUSTEP_SYSTEM_ROOT if not set yet. if test x"$GNUSTEP_SYSTEM_HEADERS" = x""; then GNUSTEP_SYSTEM_HEADERS="$GNUSTEP_SYSTEM_ROOT/Library/Headers" fi if test x"$GNUSTEP_SYSTEM_LIBRARIES" = x""; then GNUSTEP_SYSTEM_LIBRARIES="$GNUSTEP_SYSTEM_ROOT/Library/Libraries" fi if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES/$obj_dir GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS/$LIBRARY_COMBO else GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS fi CPPFLAGS="$CPPFLAGS -I$GNUSTEP_HDIR" LDFLAGS="$LDFLAGS -L$GNUSTEP_LDIR/$LIBRARY_COMBO -L$GNUSTEP_LDIR" #-------------------------------------------------------------------- # Add target OS directories as necessary #-------------------------------------------------------------------- case "$target_os" in freebsd* | openbsd* ) CPPFLAGS="-I/usr/pkg/include $CPPFLAGS" LDFLAGS="-L/usr/pkg/lib $LDFLAGS";; netbsd*) CPPFLAGS="-I/usr/pkg/include $CPPFLAGS" LDFLAGS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib $LDFLAGS";; esac #-------------------------------------------------------------------- # These headers/functions needed by gpbs.m #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in syslog.h do : ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" if test "x$ac_cv_header_syslog_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYSLOG_H 1 _ACEOF fi done for ac_func in syslog do : ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog" if test "x$ac_cv_func_syslog" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYSLOG 1 _ACEOF fi done #-------------------------------------------------------------------- # Find TIFF (Solaris requires this to find the correct library, even though # it does not link directly to it) #-------------------------------------------------------------------- # Check whether --with-tiff_library was given. if test "${with_tiff_library+set}" = set; then : withval=$with_tiff_library; else with_tiff_library= fi if test -n "$with_tiff_library"; then GRAPHIC_LFLAGS="$GRAPHIC_LFLAGS -L$with_tiff_library" fi #-------------------------------------------------------------------- # Find for X windows #-------------------------------------------------------------------- set_x_paths=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test "x$no_x" = xyes; then set_x_paths=no fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi if test $set_x_paths = yes; then GRAPHIC_CFLAGS="$GRAPHIC_CFLAGS $X_CFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" # Note: Don't include $X_LIBS in LDFLAGS as it may conflict with # other libraries installed in /sw, /sw/lib/freetyp2/lib #GRAPHIC_LFLAGS="$X_LIBS $GRAPHIC_LFLAGS" # But do include it here just to find the extra x libraries LDFLAGS="$LDFLAGS $X_LIBS" LIBS="-lX11 $X_EXTRA_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXext" >&5 $as_echo_n "checking for main in -lXext... " >&6; } if ${ac_cv_lib_Xext_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_main=yes else ac_cv_lib_Xext_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_main" >&5 $as_echo "$ac_cv_lib_Xext_main" >&6; } if test "x$ac_cv_lib_Xext_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXEXT 1 _ACEOF LIBS="-lXext $LIBS" fi if test "$HAVE_LIBXext" = no; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xext" >&5 $as_echo_n "checking for xext... " >&6; } if test -n "$XEXT_CFLAGS"; then pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xext\""; } >&5 ($PKG_CONFIG --exists --print-errors "xext") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEXT_CFLAGS=`$PKG_CONFIG --cflags "xext" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XEXT_LIBS"; then pkg_cv_XEXT_LIBS="$XEXT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xext\""; } >&5 ($PKG_CONFIG --exists --print-errors "xext") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEXT_LIBS=`$PKG_CONFIG --libs "xext" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xext" 2>&1` else XEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xext" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XEXT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xext) were not met: $XEXT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XEXT_CFLAGS and XEXT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XEXT_CFLAGS and XEXT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XEXT_CFLAGS=$pkg_cv_XEXT_CFLAGS XEXT_LIBS=$pkg_cv_XEXT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXt" >&5 $as_echo_n "checking for main in -lXt... " >&6; } if ${ac_cv_lib_Xt_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xt_main=yes else ac_cv_lib_Xt_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_main" >&5 $as_echo "$ac_cv_lib_Xt_main" >&6; } if test "x$ac_cv_lib_Xt_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXT 1 _ACEOF LIBS="-lXt $LIBS" fi if test "$HAVE_LIBXt" = no; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xt" >&5 $as_echo_n "checking for xt... " >&6; } if test -n "$XT_CFLAGS"; then pkg_cv_XT_CFLAGS="$XT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5 ($PKG_CONFIG --exists --print-errors "xt") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XT_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XT_LIBS"; then pkg_cv_XT_LIBS="$XT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5 ($PKG_CONFIG --exists --print-errors "xt") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XT_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xt" 2>&1` else XT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xt" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xt) were not met: $XT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XT_CFLAGS and XT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XT_CFLAGS and XT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XT_CFLAGS=$pkg_cv_XT_CFLAGS XT_LIBS=$pkg_cv_XT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXmu" >&5 $as_echo_n "checking for main in -lXmu... " >&6; } if ${ac_cv_lib_Xmu_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xmu_main=yes else ac_cv_lib_Xmu_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_main" >&5 $as_echo "$ac_cv_lib_Xmu_main" >&6; } if test "x$ac_cv_lib_Xmu_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXMU 1 _ACEOF LIBS="-lXmu $LIBS" fi if test "$HAVE_LIBXmu" = no; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmu" >&5 $as_echo_n "checking for xmu... " >&6; } if test -n "$XMU_CFLAGS"; then pkg_cv_XMU_CFLAGS="$XMU_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu\""; } >&5 ($PKG_CONFIG --exists --print-errors "xmu") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XMU_CFLAGS=`$PKG_CONFIG --cflags "xmu" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XMU_LIBS"; then pkg_cv_XMU_LIBS="$XMU_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu\""; } >&5 ($PKG_CONFIG --exists --print-errors "xmu") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XMU_LIBS=`$PKG_CONFIG --libs "xmu" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XMU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xmu" 2>&1` else XMU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xmu" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XMU_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xmu) were not met: $XMU_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XMU_CFLAGS and XMU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XMU_CFLAGS and XMU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XMU_CFLAGS=$pkg_cv_XMU_CFLAGS XMU_LIBS=$pkg_cv_XMU_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFixesSelectSelectionInput in -lXfixes" >&5 $as_echo_n "checking for XFixesSelectSelectionInput in -lXfixes... " >&6; } if ${ac_cv_lib_Xfixes_XFixesSelectSelectionInput+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXfixes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XFixesSelectSelectionInput (); int main () { return XFixesSelectSelectionInput (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xfixes_XFixesSelectSelectionInput=yes else ac_cv_lib_Xfixes_XFixesSelectSelectionInput=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xfixes_XFixesSelectSelectionInput" >&5 $as_echo "$ac_cv_lib_Xfixes_XFixesSelectSelectionInput" >&6; } if test "x$ac_cv_lib_Xfixes_XFixesSelectSelectionInput" = xyes; then : LIBS="-lXfixes $LIBS" $as_echo "#define HAVE_XFIXES 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XcursorImageCreate in -lXcursor" >&5 $as_echo_n "checking for XcursorImageCreate in -lXcursor... " >&6; } if ${ac_cv_lib_Xcursor_XcursorImageCreate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXcursor $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XcursorImageCreate (); int main () { return XcursorImageCreate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xcursor_XcursorImageCreate=yes else ac_cv_lib_Xcursor_XcursorImageCreate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xcursor_XcursorImageCreate" >&5 $as_echo "$ac_cv_lib_Xcursor_XcursorImageCreate" >&6; } if test "x$ac_cv_lib_Xcursor_XcursorImageCreate" = xyes; then : LIBS="-lXcursor $LIBS" $as_echo "#define HAVE_XCURSOR 1" >>confdefs.h fi have_xshape=no for ac_header in X11/extensions/shape.h do : ac_fn_c_check_header_compile "$LINENO" "X11/extensions/shape.h" "ac_cv_header_X11_extensions_shape_h" "#include " if test "x$ac_cv_header_X11_extensions_shape_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_SHAPE_H 1 _ACEOF have_xshape=yes fi done if test $have_xshape = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShapeCombineMask in -lXext" >&5 $as_echo_n "checking for XShapeCombineMask in -lXext... " >&6; } if ${ac_cv_lib_Xext_XShapeCombineMask+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XShapeCombineMask (); int main () { return XShapeCombineMask (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_XShapeCombineMask=yes else ac_cv_lib_Xext_XShapeCombineMask=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeCombineMask" >&5 $as_echo "$ac_cv_lib_Xext_XShapeCombineMask" >&6; } if test "x$ac_cv_lib_Xext_XShapeCombineMask" = xyes; then : $as_echo "#define HAVE_XSHAPE 1" >>confdefs.h fi fi for ac_header in X11/extensions/sync.h do : ac_fn_c_check_header_compile "$LINENO" "X11/extensions/sync.h" "ac_cv_header_X11_extensions_sync_h" "#include #include " if test "x$ac_cv_header_X11_extensions_sync_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_SYNC_H 1 _ACEOF fi done have_xrandr=no for ac_header in X11/extensions/Xrandr.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "$ac_includes_default" if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_XRANDR_H 1 _ACEOF have_xrandr=yes fi done if test $have_xrandr = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRUpdateConfiguration in -lXrandr" >&5 $as_echo_n "checking for XRRUpdateConfiguration in -lXrandr... " >&6; } if ${ac_cv_lib_Xrandr_XRRUpdateConfiguration+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrandr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRRUpdateConfiguration (); int main () { return XRRUpdateConfiguration (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xrandr_XRRUpdateConfiguration=yes else ac_cv_lib_Xrandr_XRRUpdateConfiguration=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRUpdateConfiguration" >&5 $as_echo "$ac_cv_lib_Xrandr_XRRUpdateConfiguration" >&6; } if test "x$ac_cv_lib_Xrandr_XRRUpdateConfiguration" = xyes; then : LIBS="-lXrandr $LIBS" $as_echo "#define HAVE_XRANDR 1" >>confdefs.h fi fi LIBS="$X_LIBS $LIBS" fi # Old X11 support { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 function prototypes" >&5 $as_echo_n "checking for X11 function prototypes... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if NeedFunctionPrototypes yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : have_funcproto=yes else have_funcproto=no fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_funcproto" >&5 $as_echo "$have_funcproto" >&6; } if test "$have_funcproto" = no; then $as_echo "#define FUNCPROTO 1" >>confdefs.h fi #-------------------------------------------------------------------- # Find for DPS #-------------------------------------------------------------------- save_CPPFLAGS=${CPPFLAGS} if test -r $x_includes/X11/DPS; then CPPFLAGS="-I$x_includes/X11 $CPPFLAGS" fi for ac_header in DPS/dpsclient.h DPS/dpsNXargs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_DPS_dpsNXargs_h = no; then CPPFLAGS="${save_CPPFLAGS}" fi #-------------------------------------------------------------------- # freetype libraries #-------------------------------------------------------------------- # Mac OS X with macports has a freetype which includes Apple's Foundation # which we do not want # Check whether --with-freetype was given. if test "${with_freetype+set}" = set; then : withval=$with_freetype; else with_freetype=yes fi have_freetype=no if test $with_freetype = yes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5 $as_echo_n "checking for freetype2... " >&6; } if test -n "$FREETYPE_CFLAGS"; then pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FREETYPE_LIBS"; then pkg_cv_FREETYPE_LIBS="$FREETYPE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FREETYPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "freetype2" 2>&1` else FREETYPE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "freetype2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FREETYPE_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (freetype2) were not met: $FREETYPE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables FREETYPE_CFLAGS and FREETYPE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables FREETYPE_CFLAGS and FREETYPE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else FREETYPE_CFLAGS=$pkg_cv_FREETYPE_CFLAGS FREETYPE_LIBS=$pkg_cv_FREETYPE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test x"$FREETYPE_LIBS" != x; then save_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${FREETYPE_CFLAGS} ${CPPFLAGS}" ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" if test "x$ac_cv_header_ft2build_h" = xyes; then : have_freetype=yes else have_freetype=no fi CPPFLAGS="${save_CPPFLAGS}" fi fi #-------------------------------------------------------------------- # Extended font support & UTF8 support #-------------------------------------------------------------------- pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xft" >&5 $as_echo_n "checking for xft... " >&6; } if test -n "$XFT_CFLAGS"; then pkg_cv_XFT_CFLAGS="$XFT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft\""; } >&5 ($PKG_CONFIG --exists --print-errors "xft") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XFT_CFLAGS=`$PKG_CONFIG --cflags "xft" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XFT_LIBS"; then pkg_cv_XFT_LIBS="$XFT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft\""; } >&5 ($PKG_CONFIG --exists --print-errors "xft") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XFT_LIBS=`$PKG_CONFIG --libs "xft" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XFT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xft" 2>&1` else XFT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xft" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XFT_PKG_ERRORS" >&5 WITH_XFT=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } WITH_XFT=no else XFT_CFLAGS=$pkg_cv_XFT_CFLAGS XFT_LIBS=$pkg_cv_XFT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } WITH_XFT=yes fi if test $WITH_XFT = no; then # pkg-config failed for some reason, Check the old way? save_CPPFLAGS=${CPPFLAGS} save_LIBS=${LIBS} if test $have_freetype = yes; then LIBS="$FREETYPE_LIBS $LIBS" CPPFLAGS="$FREETYPE_CFLAGS $CPPFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5 $as_echo_n "checking for XftFontOpen in -lXft... " >&6; } if ${ac_cv_lib_Xft_XftFontOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftFontOpen (); int main () { return XftFontOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xft_XftFontOpen=yes else ac_cv_lib_Xft_XftFontOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5 $as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; } if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXFT 1 _ACEOF LIBS="-lXft $LIBS" fi ac_fn_c_check_header_mongrel "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then : fi if test "$ac_cv_lib_Xft_XftFontOpen" = yes -a "$ac_cv_header_X11_Xft_Xft_h" = yes; then WITH_XFT=yes XFT_LIBS="-lXft $FREETYPE_LIBS" XFT_CFLAGS="$FREETYPE_CFLAGS" fi CPPFLAGS=${save_CPPFLAGS} LIBS=${save_LIBS} else WITH_XFT=yes fi if test $WITH_XFT = yes; then # Now add in some extra defines depending on what we have. save_CPPFLAGS=${CPPFLAGS} save_LIBS=${LIBS} CPPFLAGS="$XFT_CFLAGS $CPPFLAGS" LIBS="$XFT_LIBS $LIBS" $as_echo "#define HAVE_XFT 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftDrawStringUtf8 in -lXft" >&5 $as_echo_n "checking for XftDrawStringUtf8 in -lXft... " >&6; } if ${ac_cv_lib_Xft_XftDrawStringUtf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftDrawStringUtf8 (); int main () { return XftDrawStringUtf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xft_XftDrawStringUtf8=yes else ac_cv_lib_Xft_XftDrawStringUtf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftDrawStringUtf8" >&5 $as_echo "$ac_cv_lib_Xft_XftDrawStringUtf8" >&6; } if test "x$ac_cv_lib_Xft_XftDrawStringUtf8" = xyes; then : have_utf8=yes else have_utf8=no fi if test "$have_utf8" = yes; then $as_echo "#define HAVE_UTF8 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftPatternGetString in -lXft" >&5 $as_echo_n "checking for XftPatternGetString in -lXft... " >&6; } if ${ac_cv_lib_Xft_XftPatternGetString+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftPatternGetString (); int main () { return XftPatternGetString (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xft_XftPatternGetString=yes else ac_cv_lib_Xft_XftPatternGetString=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftPatternGetString" >&5 $as_echo "$ac_cv_lib_Xft_XftPatternGetString" >&6; } if test "x$ac_cv_lib_Xft_XftPatternGetString" = xyes; then : have_xftpgs=yes else have_xftpgs=no fi for ac_func in Xutf8LookupString do : ac_fn_c_check_func "$LINENO" "Xutf8LookupString" "ac_cv_func_Xutf8LookupString" if test "x$ac_cv_func_Xutf8LookupString" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_XUTF8LOOKUPSTRING 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FcPatternCreate in -lfontconfig" >&5 $as_echo_n "checking for FcPatternCreate in -lfontconfig... " >&6; } if ${ac_cv_lib_fontconfig_FcPatternCreate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfontconfig $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char FcPatternCreate (); int main () { return FcPatternCreate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fontconfig_FcPatternCreate=yes else ac_cv_lib_fontconfig_FcPatternCreate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fontconfig_FcPatternCreate" >&5 $as_echo "$ac_cv_lib_fontconfig_FcPatternCreate" >&6; } if test "x$ac_cv_lib_fontconfig_FcPatternCreate" = xyes; then : have_fc=yes else have_fc=no fi ac_fn_c_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" if test "x$ac_cv_header_fontconfig_fontconfig_h" = xyes; then : fi if test "$have_fc" = yes -a "$ac_cv_header_fontconfig_fontconfig_h" = yes; then XFT_LIBS="${XFT_LIBS} -lfontconfig" $as_echo "#define HAVE_FC 1" >>confdefs.h fi CPPFLAGS=${save_CPPFLAGS} LIBS=${save_LIBS} fi #-------------------------------------------------------------------- # GLX support #-------------------------------------------------------------------- WITH_GLX=no # Check whether --enable-glx was given. if test "${enable_glx+set}" = set; then : enableval=$enable_glx; else enable_glx=yes fi if test "x$enable_glx" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXMakeContextCurrent in -lGL" >&5 $as_echo_n "checking for glXMakeContextCurrent in -lGL... " >&6; } if ${ac_cv_lib_GL_glXMakeContextCurrent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char glXMakeContextCurrent (); int main () { return glXMakeContextCurrent (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_GL_glXMakeContextCurrent=yes else ac_cv_lib_GL_glXMakeContextCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glXMakeContextCurrent" >&5 $as_echo "$ac_cv_lib_GL_glXMakeContextCurrent" >&6; } if test "x$ac_cv_lib_GL_glXMakeContextCurrent" = xyes; then : have_glx=yes else have_glx=no fi ac_fn_c_check_header_mongrel "$LINENO" "GL/glx.h" "ac_cv_header_GL_glx_h" "$ac_includes_default" if test "x$ac_cv_header_GL_glx_h" = xyes; then : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLX_RGBA_TYPE" >&5 $as_echo_n "checking for GLX_RGBA_TYPE... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef GLX_RGBA_TYPE yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : have_glx_rgba=yes else have_glx_rgba=no fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_glx_rgba" >&5 $as_echo "$have_glx_rgba" >&6; } if test "$have_glx" = yes -a "$ac_cv_header_GL_glx_h" = yes -a "$have_glx_rgba" = yes; then GLX_LIBS="-lGL" GLX_FLAGS="" WITH_GLX=yes $as_echo "#define HAVE_GLX 1" >>confdefs.h fi fi #-------------------------------------------------------------------- # XIM support #-------------------------------------------------------------------- # Check whether --enable-xim was given. if test "${enable_xim+set}" = set; then : enableval=$enable_xim; else enable_xim=yes fi if test "x$enable_xim" = "xyes"; then $as_echo "#define USE_XIM 1" >>confdefs.h fi #-------------------------------------------------------------------- # Functions #-------------------------------------------------------------------- for ac_func in usleep do : ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_USLEEP 1 _ACEOF fi done have_xshm=no for ac_header in X11/extensions/XShm.h do : ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XShm.h" "ac_cv_header_X11_extensions_XShm_h" "#include " if test "x$ac_cv_header_X11_extensions_XShm_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_XSHM_H 1 _ACEOF have_xshm=yes fi done for ac_func in shmctl do : ac_fn_c_check_func "$LINENO" "shmctl" "ac_cv_func_shmctl" if test "x$ac_cv_func_shmctl" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SHMCTL 1 _ACEOF fi done if test "$ac_cv_header_X11_extensions_XShm_h" = yes -a "$ac_cv_func_shmctl" = yes; then $as_echo "#define XSHM 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XInternAtoms in -lX11" >&5 $as_echo_n "checking for XInternAtoms in -lX11... " >&6; } if ${ac_cv_lib_X11_XInternAtoms+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $X_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XInternAtoms (); int main () { return XInternAtoms (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XInternAtoms=yes else ac_cv_lib_X11_XInternAtoms=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XInternAtoms" >&5 $as_echo "$ac_cv_lib_X11_XInternAtoms" >&6; } if test "x$ac_cv_lib_X11_XInternAtoms" = xyes; then : $as_echo "#define HAVE_XINTERNATOMS 1" >>confdefs.h fi #-------------------------------------------------------------------- # Window's graphics library #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgdi32" >&5 $as_echo_n "checking for main in -lgdi32... " >&6; } if ${ac_cv_lib_gdi32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgdi32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gdi32_main=yes else ac_cv_lib_gdi32_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdi32_main" >&5 $as_echo "$ac_cv_lib_gdi32_main" >&6; } if test "x$ac_cv_lib_gdi32_main" = xyes; then : have_gdi32=yes else have_gdi32=no fi if test "$have_gdi32" = yes; then WIN32_LIBS="-lgdi32 -lm" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmsimg32" >&5 $as_echo_n "checking for main in -lmsimg32... " >&6; } if ${ac_cv_lib_msimg32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmsimg32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_msimg32_main=yes else ac_cv_lib_msimg32_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_msimg32_main" >&5 $as_echo "$ac_cv_lib_msimg32_main" >&6; } if test "x$ac_cv_lib_msimg32_main" = xyes; then : have_msimg32=yes else have_msimg32=no fi if test "$have_msimg32" = yes; then WIN32_LIBS="${WIN32_LIBS} -lmsimg32" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -limm32" >&5 $as_echo_n "checking for main in -limm32... " >&6; } if ${ac_cv_lib_imm32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-limm32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_imm32_main=yes else ac_cv_lib_imm32_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_imm32_main" >&5 $as_echo "$ac_cv_lib_imm32_main" >&6; } if test "x$ac_cv_lib_imm32_main" = xyes; then : have_imm32=yes else have_imm32=no fi if test "$have_imm32" = yes; then WIN32_LIBS="${WIN32_LIBS} -limm32" fi #-------------------------------------------------------------------- # WGL support #-------------------------------------------------------------------- WITH_WGL=no # Check whether --enable-wgl was given. if test "${enable_wgl+set}" = set; then : enableval=$enable_wgl; else enable_wgl=yes fi if test "x$enable_wgl" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lopengl32" >&5 $as_echo_n "checking for main in -lopengl32... " >&6; } if ${ac_cv_lib_opengl32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lopengl32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_opengl32_main=yes else ac_cv_lib_opengl32_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opengl32_main" >&5 $as_echo "$ac_cv_lib_opengl32_main" >&6; } if test "x$ac_cv_lib_opengl32_main" = xyes; then : have_wgl=yes else have_wgl=no fi save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS" ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" if test "x$ac_cv_header_windows_h" = xyes; then : fi CPPFLAGS="$save_CPPFLAGS" if test "$have_wgl" = yes -a "$ac_cv_header_windows_h" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wgl" >&5 $as_echo_n "checking for wgl... " >&6; } WGL_LIBS="-lopengl32 -lgdi32" WGL_CFLAGS="" save_libs="$LIBS" LIBS="$WGL_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { wglCreateContext(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : use_wgl=yes else use_wgl=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_libs" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_wgl" >&5 $as_echo "$use_wgl" >&6; } WITH_WGL=$use_wgl $as_echo "#define HAVE_WGL 1" >>confdefs.h fi fi #-------------------------------------------------------------------- # libart graphics libraries #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libart2" >&5 $as_echo_n "checking for libart2... " >&6; } LIBART_VERSION="`libart2-config --version 2>/dev/null`" if test x"$LIBART_VERSION" = x; then LIBART_VERSION="none" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBART_VERSION" >&5 $as_echo "$LIBART_VERSION" >&6; } LIBART_LIBS="`libart2-config --libs 2>/dev/null`" LIBART_CFLAGS="`libart2-config --cflags 2>/dev/null`" if test x"$LIBART_LIBS" = x; then # No libart2-config, is there any point in checking for individual libs? { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lart_lgpl_2" >&5 $as_echo_n "checking for main in -lart_lgpl_2... " >&6; } if ${ac_cv_lib_art_lgpl_2_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lart_lgpl_2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_art_lgpl_2_main=yes else ac_cv_lib_art_lgpl_2_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_art_lgpl_2_main" >&5 $as_echo "$ac_cv_lib_art_lgpl_2_main" >&6; } if test "x$ac_cv_lib_art_lgpl_2_main" = xyes; then : have_libart=yes else have_libart=no fi if test "$have_libart" = yes; then ac_fn_c_check_header_mongrel "$LINENO" "libart_lgpl/libart.h" "ac_cv_header_libart_lgpl_libart_h" "$ac_includes_default" if test "x$ac_cv_header_libart_lgpl_libart_h" = xyes; then : have_libart=yes else have_libart=no fi fi if test "$have_libart" = yes; then LIBART_LIBS="-lart_lgpl_2" fi else have_libart=yes fi #-------------------------------------------------------------------- # Cairo graphics libraries #-------------------------------------------------------------------- pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo" >&5 $as_echo_n "checking for cairo... " >&6; } if test -n "$CAIRO_CFLAGS"; then pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_LIBS"; then pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo" 2>&1` else CAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_PKG_ERRORS" >&5 have_cairo=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_cairo=no else CAIRO_CFLAGS=$pkg_cv_CAIRO_CFLAGS CAIRO_LIBS=$pkg_cv_CAIRO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_cairo=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo-ft" >&5 $as_echo_n "checking for cairo-ft... " >&6; } if test -n "$CAIRO_FT_CFLAGS"; then pkg_cv_CAIRO_FT_CFLAGS="$CAIRO_FT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-ft\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-ft") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_FT_CFLAGS=`$PKG_CONFIG --cflags "cairo-ft" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_FT_LIBS"; then pkg_cv_CAIRO_FT_LIBS="$CAIRO_FT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-ft\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-ft") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_FT_LIBS=`$PKG_CONFIG --libs "cairo-ft" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_FT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo-ft" 2>&1` else CAIRO_FT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo-ft" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_FT_PKG_ERRORS" >&5 have_cairo_ft=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_cairo_ft=no else CAIRO_FT_CFLAGS=$pkg_cv_CAIRO_FT_CFLAGS CAIRO_FT_LIBS=$pkg_cv_CAIRO_FT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_cairo_ft=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo-xlib" >&5 $as_echo_n "checking for cairo-xlib... " >&6; } if test -n "$CAIRO_XLIB_CFLAGS"; then pkg_cv_CAIRO_XLIB_CFLAGS="$CAIRO_XLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-xlib\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-xlib") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_XLIB_CFLAGS=`$PKG_CONFIG --cflags "cairo-xlib" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_XLIB_LIBS"; then pkg_cv_CAIRO_XLIB_LIBS="$CAIRO_XLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-xlib\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-xlib") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_XLIB_LIBS=`$PKG_CONFIG --libs "cairo-xlib" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_XLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo-xlib" 2>&1` else CAIRO_XLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo-xlib" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_XLIB_PKG_ERRORS" >&5 have_cairo_xlib=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_cairo_xlib=no else CAIRO_XLIB_CFLAGS=$pkg_cv_CAIRO_XLIB_CFLAGS CAIRO_XLIB_LIBS=$pkg_cv_CAIRO_XLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_cairo_xlib=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo-win32" >&5 $as_echo_n "checking for cairo-win32... " >&6; } if test -n "$CAIRO_WIN32_CFLAGS"; then pkg_cv_CAIRO_WIN32_CFLAGS="$CAIRO_WIN32_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-win32\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-win32") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_WIN32_CFLAGS=`$PKG_CONFIG --cflags "cairo-win32" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_WIN32_LIBS"; then pkg_cv_CAIRO_WIN32_LIBS="$CAIRO_WIN32_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-win32\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-win32") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_WIN32_LIBS=`$PKG_CONFIG --libs "cairo-win32" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_WIN32_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo-win32" 2>&1` else CAIRO_WIN32_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo-win32" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_WIN32_PKG_ERRORS" >&5 have_cairo_win32=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_cairo_win32=no else CAIRO_WIN32_CFLAGS=$pkg_cv_CAIRO_WIN32_CFLAGS CAIRO_WIN32_LIBS=$pkg_cv_CAIRO_WIN32_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_cairo_win32=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo-glitz" >&5 $as_echo_n "checking for cairo-glitz... " >&6; } if test -n "$CAIRO_GLITZ_CFLAGS"; then pkg_cv_CAIRO_GLITZ_CFLAGS="$CAIRO_GLITZ_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-glitz\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-glitz") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_GLITZ_CFLAGS=`$PKG_CONFIG --cflags "cairo-glitz" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_GLITZ_LIBS"; then pkg_cv_CAIRO_GLITZ_LIBS="$CAIRO_GLITZ_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-glitz\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo-glitz") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_GLITZ_LIBS=`$PKG_CONFIG --libs "cairo-glitz" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_GLITZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo-glitz" 2>&1` else CAIRO_GLITZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo-glitz" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_GLITZ_PKG_ERRORS" >&5 have_cairo_glitz=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_cairo_glitz=no else CAIRO_GLITZ_CFLAGS=$pkg_cv_CAIRO_GLITZ_CFLAGS CAIRO_GLITZ_LIBS=$pkg_cv_CAIRO_GLITZ_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_cairo_glitz=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig" >&5 $as_echo_n "checking for fontconfig... " >&6; } if test -n "$FONTCONFIG_CFLAGS"; then pkg_cv_FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5 ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "fontconfig" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FONTCONFIG_LIBS"; then pkg_cv_FONTCONFIG_LIBS="$FONTCONFIG_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5 ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FONTCONFIG_LIBS=`$PKG_CONFIG --libs "fontconfig" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fontconfig" 2>&1` else FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fontconfig" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FONTCONFIG_PKG_ERRORS" >&5 have_fontconfig=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_fontconfig=no else FONTCONFIG_CFLAGS=$pkg_cv_FONTCONFIG_CFLAGS FONTCONFIG_LIBS=$pkg_cv_FONTCONFIG_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_fontconfig=yes fi if test "$have_cairo" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_create in -lcairo" >&5 $as_echo_n "checking for cairo_create in -lcairo... " >&6; } if ${ac_cv_lib_cairo_cairo_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcairo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cairo_create (); int main () { return cairo_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cairo_cairo_create=yes else ac_cv_lib_cairo_cairo_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cairo_cairo_create" >&5 $as_echo "$ac_cv_lib_cairo_cairo_create" >&6; } if test "x$ac_cv_lib_cairo_cairo_create" = xyes; then : have_cairo=yes fi fi if test "$have_cairo_ft" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_ft_font_face_create_for_ft_face in -lcairo" >&5 $as_echo_n "checking for cairo_ft_font_face_create_for_ft_face in -lcairo... " >&6; } if ${ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcairo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cairo_ft_font_face_create_for_ft_face (); int main () { return cairo_ft_font_face_create_for_ft_face (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face=yes else ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face" >&5 $as_echo "$ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face" >&6; } if test "x$ac_cv_lib_cairo_cairo_ft_font_face_create_for_ft_face" = xyes; then : have_cairo_ft=yes fi fi if test "$have_cairo_xlib" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_xlib_surface_create in -lcairo" >&5 $as_echo_n "checking for cairo_xlib_surface_create in -lcairo... " >&6; } if ${ac_cv_lib_cairo_cairo_xlib_surface_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcairo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cairo_xlib_surface_create (); int main () { return cairo_xlib_surface_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cairo_cairo_xlib_surface_create=yes else ac_cv_lib_cairo_cairo_xlib_surface_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cairo_cairo_xlib_surface_create" >&5 $as_echo "$ac_cv_lib_cairo_cairo_xlib_surface_create" >&6; } if test "x$ac_cv_lib_cairo_cairo_xlib_surface_create" = xyes; then : have_cairo_xlib=yes fi fi if test "$have_cairo_win32" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo_win32_surface_create in -lcairo" >&5 $as_echo_n "checking for cairo_win32_surface_create in -lcairo... " >&6; } if ${ac_cv_lib_cairo_cairo_win32_surface_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcairo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cairo_win32_surface_create (); int main () { return cairo_win32_surface_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cairo_cairo_win32_surface_create=yes else ac_cv_lib_cairo_cairo_win32_surface_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cairo_cairo_win32_surface_create" >&5 $as_echo "$ac_cv_lib_cairo_cairo_win32_surface_create" >&6; } if test "x$ac_cv_lib_cairo_cairo_win32_surface_create" = xyes; then : have_cairo_win32=yes fi fi #-------------------------------------------------------------------- # XRender support #-------------------------------------------------------------------- have_xrender=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderFindVisualFormat in -lXrender" >&5 $as_echo_n "checking for XRenderFindVisualFormat in -lXrender... " >&6; } if ${ac_cv_lib_Xrender_XRenderFindVisualFormat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRenderFindVisualFormat (); int main () { return XRenderFindVisualFormat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xrender_XRenderFindVisualFormat=yes else ac_cv_lib_Xrender_XRenderFindVisualFormat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderFindVisualFormat" >&5 $as_echo "$ac_cv_lib_Xrender_XRenderFindVisualFormat" >&6; } if test "x$ac_cv_lib_Xrender_XRenderFindVisualFormat" = xyes; then : have_xrender=yes fi #-------------------------------------------------------------------- # Glitz libraries #-------------------------------------------------------------------- WITH_GLITZ=no # Check whether --enable-glitz was given. if test "${enable_glitz+set}" = set; then : enableval=$enable_glitz; else enable_glitz=no fi if test "x$enable_glitz" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glitz" >&5 $as_echo_n "checking for glitz... " >&6; } if test -n "$GLITZ_CFLAGS"; then pkg_cv_GLITZ_CFLAGS="$GLITZ_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glitz\""; } >&5 ($PKG_CONFIG --exists --print-errors "glitz") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLITZ_CFLAGS=`$PKG_CONFIG --cflags "glitz" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLITZ_LIBS"; then pkg_cv_GLITZ_LIBS="$GLITZ_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glitz\""; } >&5 ($PKG_CONFIG --exists --print-errors "glitz") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLITZ_LIBS=`$PKG_CONFIG --libs "glitz" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLITZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glitz" 2>&1` else GLITZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glitz" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLITZ_PKG_ERRORS" >&5 have_glitz=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_glitz=no else GLITZ_CFLAGS=$pkg_cv_GLITZ_CFLAGS GLITZ_LIBS=$pkg_cv_GLITZ_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_glitz=yes fi save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GLITZ_CFLAGS" ac_fn_c_check_header_mongrel "$LINENO" "glitz.h" "ac_cv_header_glitz_h" "$ac_includes_default" if test "x$ac_cv_header_glitz_h" = xyes; then : have_glitz_h=yes else have_glitz_h=no fi CPPFLAGS=$save_CPPFLAGS if test "$have_glitz" = yes -a "$have_glitz_h" = yes; then if test "x$WITH_GLX" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glitz-glx" >&5 $as_echo_n "checking for glitz-glx... " >&6; } if test -n "$GLITZ_GLX_CFLAGS"; then pkg_cv_GLITZ_GLX_CFLAGS="$GLITZ_GLX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glitz-glx\""; } >&5 ($PKG_CONFIG --exists --print-errors "glitz-glx") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLITZ_GLX_CFLAGS=`$PKG_CONFIG --cflags "glitz-glx" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLITZ_GLX_LIBS"; then pkg_cv_GLITZ_GLX_LIBS="$GLITZ_GLX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glitz-glx\""; } >&5 ($PKG_CONFIG --exists --print-errors "glitz-glx") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLITZ_GLX_LIBS=`$PKG_CONFIG --libs "glitz-glx" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLITZ_GLX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glitz-glx" 2>&1` else GLITZ_GLX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glitz-glx" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLITZ_GLX_PKG_ERRORS" >&5 have_glitz_glx=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_glitz_glx=no else GLITZ_GLX_CFLAGS=$pkg_cv_GLITZ_GLX_CFLAGS GLITZ_GLX_LIBS=$pkg_cv_GLITZ_GLX_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_glitz_glx=yes fi save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GLITZ_GLX_CFLAGS" ac_fn_c_check_header_mongrel "$LINENO" "glitz-glx.h" "ac_cv_header_glitz_glx_h" "$ac_includes_default" if test "x$ac_cv_header_glitz_glx_h" = xyes; then : have_glitz_glx_h=yes else have_glitz_glx_h=no fi CPPFLAGS=$save_CPPFLAGS if test "$have_glitz_glx" = yes -a "$have_glitz_glx_h" = yes; then GLITZ_LIBS="$GLITZ_LIBS $GLITZ_GLX_LIBS" GLITZ_CFLAGS="$GLITZ_CFLAGS $GLITZ_GLX_CFLAGS" $as_echo "#define HAVE_GLITZ_GLX 1" >>confdefs.h WITH_GLITZ=yes fi fi if test "x$WITH_WGL" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glitz-wgl" >&5 $as_echo_n "checking for glitz-wgl... " >&6; } if test -n "$GLITZ_WGL_CFLAGS"; then pkg_cv_GLITZ_WGL_CFLAGS="$GLITZ_WGL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glitz-wgl\""; } >&5 ($PKG_CONFIG --exists --print-errors "glitz-wgl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLITZ_WGL_CFLAGS=`$PKG_CONFIG --cflags "glitz-wgl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLITZ_WGL_LIBS"; then pkg_cv_GLITZ_WGL_LIBS="$GLITZ_WGL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glitz-wgl\""; } >&5 ($PKG_CONFIG --exists --print-errors "glitz-wgl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLITZ_WGL_LIBS=`$PKG_CONFIG --libs "glitz-wgl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLITZ_WGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glitz-wgl" 2>&1` else GLITZ_WGL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glitz-wgl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLITZ_WGL_PKG_ERRORS" >&5 have_glitz_wgl=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_glitz_wgl=no else GLITZ_WGL_CFLAGS=$pkg_cv_GLITZ_WGL_CFLAGS GLITZ_WGL_LIBS=$pkg_cv_GLITZ_WGL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_glitz_wgl=yes fi save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GLITZ_WGL_CFLAGS" ac_fn_c_check_header_mongrel "$LINENO" "glitz-wgl.h" "ac_cv_header_glitz_wgl_h" "$ac_includes_default" if test "x$ac_cv_header_glitz_wgl_h" = xyes; then : have_glitz_wgl_h=yes else have_glitz_wgl_h=no fi CPPFLAGS=$save_CPPFLAGS if test "$have_glitz_wgl" = yes -a "$have_glitz_wgl_h" = yes; then GLITZ_LIBS="$GLITZ_LIBS $GLITZ_WGL_LIBS" GLITZ_CFLAGS="$GLITZ_CFLAGS $GLITZ_WGL_CFLAGS" $as_echo "#define HAVE_GLITZ_WGL 1" >>confdefs.h WITH_GLITZ=yes fi fi if test "$WITH_GLITZ" != "yes" ; then as_fn_error $? "Invalid glitz backend : glitz-glx or glitz-wgl required." "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: Glitz disable" >&5 $as_echo "$as_me: Glitz disable" >&6;} fi $as_echo "#define USE_GLITZ 1" >>confdefs.h fi fi #-------------------------------------------------------------------- # Set definitions #-------------------------------------------------------------------- WITH_WRASTER=no # Revert to previous flags (removing added GNUstep flags) CPPFLAGS=${GRAPHIC_CFLAGS} LDFLAGS=${GRAPHIC_LFLAGS} #-------------------------------------------------------------------- # Which projects should we build? #-------------------------------------------------------------------- BUILD_SERVER=x11 BUILD_GRAPHICS=cairo case $target_os in *mingw32* ) BUILD_SERVER=win32 BUILD_GRAPHICS=winlib;; esac # Check whether --enable-server was given. if test "${enable_server+set}" = set; then : enableval=$enable_server; else enable_server=$BUILD_SERVER fi # Check whether --enable-graphics was given. if test "${enable_graphics+set}" = set; then : enableval=$enable_graphics; else enable_graphics="$BUILD_GRAPHICS" fi BUILD_SERVER=$enable_server BUILD_GRAPHICS="$enable_graphics" { $as_echo "$as_me:${as_lineno-$LINENO}: checking Backend Server" >&5 $as_echo_n "checking Backend Server... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_SERVER" >&5 $as_echo "$BUILD_SERVER" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Backend Graphics" >&5 $as_echo_n "checking Backend Graphics... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_GRAPHICS" >&5 $as_echo "$BUILD_GRAPHICS" >&6; } if test x"$BUILD_GRAPHICS" = "xcairo"; then if test "$have_freetype" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find freetype, required for graphics=cairo" >&5 $as_echo "$as_me: WARNING: can't find freetype, required for graphics=cairo" >&2;} if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib elif test $BUILD_SERVER = wayland; then as_fn_error $? "wayland backend requires cairo" "$LINENO" 5 else BUILD_GRAPHICS=xlib fi { $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;} elif test "$have_cairo" = no -o "$have_cairo-ft" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find cairo, required for graphics=cairo!" >&5 $as_echo "$as_me: WARNING: can't find cairo, required for graphics=cairo!" >&2;} if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib elif test $BUILD_SERVER = wayland; then as_fn_error $? "wayland backend requires cairo" "$LINENO" 5 else BUILD_GRAPHICS=art fi { $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;} elif test $BUILD_SERVER = win32 -a "$have_fontconfig" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find fontconfig, required for graphics=cairo!" >&5 $as_echo "$as_me: WARNING: can't find fontconfig, required for graphics=cairo!" >&2;} BUILD_GRAPHICS=winlib { $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking Cairo backend" >&5 $as_echo_n "checking Cairo backend... " >&6; } CAIRO_LIBS="$CAIRO_FT_LIBS" CAIRO_CFLAGS="$CAIRO_FT_CFLAGS" if test $BUILD_SERVER = win32; then CAIRO_LIBS="$CAIRO_LIBS $FONTCONFIG_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $FONTCONFIG_CFLAGS" fi if test "$have_xrender" = yes; then if test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then $as_echo "#define XRENDER 1" >>confdefs.h CAIRO_LIBS="$CAIRO_LIBS -lXrender" fi fi if test "x$WITH_GLITZ" = "xyes" -a "x$have_cairo_glitz" = "xyes"; then if test $BUILD_SERVER = win32 -a "x$have_cairo_win32" = "xyes"; then CAIRO_GLITZ_LIBS="$CAIRO_GLITZ_LIBS $GLITZ_WGL_LIBS" CAIRO_GLITZ_CFLAGS="$CAIRO_GLITZ_CFLAGS $GLITZ_WGL_CFLAGS" elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then CAIRO_GLITZ_LIBS="$CAIRO_GLITZ_LIBS $GLITZ_GLX_LIBS" CAIRO_GLITZ_CFLAGS="$CAIRO_GLITZ_CFLAGS $GLITZ_GLX_CFLAGS" else as_fn_error $? "Invalid Glitz installation" "$LINENO" 5 fi CAIRO_LIBS="$CAIRO_LIBS $CAIRO_GLITZ_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_GLITZ_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: glitz" >&5 $as_echo "glitz" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** Cairo-over-Glitz backend is highly experimental" >&5 $as_echo "$as_me: WARNING: **** Cairo-over-Glitz backend is highly experimental" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** You definitively shouldn't do that." >&5 $as_echo "$as_me: WARNING: **** You definitively shouldn't do that." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** It actually does not work !" >&5 $as_echo "$as_me: WARNING: **** It actually does not work !" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** Are you a backend developer ?" >&5 $as_echo "$as_me: WARNING: **** Are you a backend developer ?" >&2;} elif test $BUILD_SERVER = win32 -a "x$have_cairo_win32" = "xyes"; then CAIRO_LIBS="$CAIRO_LIBS $CAIRO_WIN32_LIBS $WIN32_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_WIN32_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: winlib" >&5 $as_echo "winlib" >&6; } #AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.]) #AC_MSG_WARN([**** Are you a backend developer ?]) elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: xlib" >&5 $as_echo "xlib" >&6; } elif test $BUILD_SERVER = wayland; then for ac_header in wayland-util.h do : ac_fn_c_check_header_mongrel "$LINENO" "wayland-util.h" "ac_cv_header_wayland_util_h" "$ac_includes_default" if test "x$ac_cv_header_wayland_util_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WAYLAND_UTIL_H 1 _ACEOF else as_fn_error $? "**** No wayland-util.h. Install libwayland-dev or equivalent." "$LINENO" 5 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wl_display_flush in -lwayland-client" >&5 $as_echo_n "checking for wl_display_flush in -lwayland-client... " >&6; } if ${ac_cv_lib_wayland_client_wl_display_flush+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwayland-client $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char wl_display_flush (); int main () { return wl_display_flush (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_wayland_client_wl_display_flush=yes else ac_cv_lib_wayland_client_wl_display_flush=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wayland_client_wl_display_flush" >&5 $as_echo "$ac_cv_lib_wayland_client_wl_display_flush" >&6; } if test "x$ac_cv_lib_wayland_client_wl_display_flush" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWAYLAND_CLIENT 1 _ACEOF LIBS="-lwayland-client $LIBS" else as_fn_error $? "**** No wl_display_flush in libwayland-client. Install correct version of libwayland-dev or equivalent." "$LINENO" 5 fi for ac_header in xkbcommon/xkbcommon.h do : ac_fn_c_check_header_mongrel "$LINENO" "xkbcommon/xkbcommon.h" "ac_cv_header_xkbcommon_xkbcommon_h" "$ac_includes_default" if test "x$ac_cv_header_xkbcommon_xkbcommon_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_XKBCOMMON_XKBCOMMON_H 1 _ACEOF else as_fn_error $? "**** No xkbcommon/xkbcommon.h. Required for wayland. Install libxkbcommon-dev or equivalent." "$LINENO" 5 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xkb_context_new in -lxkbcommon" >&5 $as_echo_n "checking for xkb_context_new in -lxkbcommon... " >&6; } if ${ac_cv_lib_xkbcommon_xkb_context_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxkbcommon $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char xkb_context_new (); int main () { return xkb_context_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xkbcommon_xkb_context_new=yes else ac_cv_lib_xkbcommon_xkb_context_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xkbcommon_xkb_context_new" >&5 $as_echo "$ac_cv_lib_xkbcommon_xkb_context_new" >&6; } if test "x$ac_cv_lib_xkbcommon_xkb_context_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXKBCOMMON 1 _ACEOF LIBS="-lxkbcommon $LIBS" else as_fn_error $? "**** No xkb_context_new in libxkbcommon. Install correct version of libxkbcommon-dev or equivalent." "$LINENO" 5 fi CAIRO_LIBS="$CAIRO_LIBS $XFT_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS" LIBS="-lwayland-client -lxkbcommon $LIBS" else as_fn_error $? "Invalid Cairo installation" "$LINENO" 5 fi LIBS="$CAIRO_LIBS $LIBS" CPPFLAGS="$CAIRO_CFLAGS $CPPFLAGS" fi fi if test x"$BUILD_GRAPHICS" = "xxdps"; then CPPFLAGS="-I$x_includes/X11 $CPPFLAGS" LIBS="-ldpstk -ldps -lpsres -lXt $X_PRE_LIBS $LIBS" elif test x"$BUILD_GRAPHICS" = "xcairo"; then : # Alread handled above elif test x"$BUILD_GRAPHICS" = "xart"; then if test "$have_freetype" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find freetype, required for graphics=art" >&5 $as_echo "$as_me: WARNING: can't find freetype, required for graphics=art" >&2;} if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi { $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;} elif test "$have_libart" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find libart, required for graphics=art" >&5 $as_echo "$as_me: WARNING: can't find libart, required for graphics=art" >&2;} if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi { $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;} else LIBS="$LIBART_LIBS $FREETYPE_LIBS $LIBS" CPPFLAGS="$LIBART_CFLAGS $FREETYPE_CFLAGS $CPPFLAGS" fi elif test x"$BUILD_GRAPHICS" = "xxlib"; then LIBS="$FREETYPE_LIBS $LIBS" elif test x"$BUILD_GRAPHICS" = "xwinlib"; then : # Nothing to do elif test x"$BUILD_GRAPHICS" = "xopal"; then CPPFLAGS="$FONTCONFIG_CFLAGS $FREETYPE_CFLAGS $CPPFLAGS" LIBS="-lopal -lgnustep-corebase $LIBS" LIBS="$FONTCONFIG_LIBS $FREETYPE_LIBS $LIBS" if test "$have_freetype" = no ; then # FCFaceInfo requires this { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find freetype, required for graphics=opal!" >&5 $as_echo "$as_me: WARNING: can't find freetype, required for graphics=opal!" >&2;} if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi { $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;} elif test "$have_fontconfig" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find fontconfig, required for graphics=opal!" >&5 $as_echo "$as_me: WARNING: can't find fontconfig, required for graphics=opal!" >&2;} if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi { $as_echo "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5 $as_echo "$as_me: Switching to $BUILD_GRAPHICS" >&6;} fi else as_fn_error $? "Invalid graphics backend $BUILD_GRAPHICS" "$LINENO" 5 fi if test x"$BUILD_GRAPHICS" = "xwinlib"; then LIBS="$WIN32_LIBS $LIBS" fi if test x"$BUILD_GRAPHICS" = "xxlib"; then LIBS="$XFT_LIBS $LIBS" CPPFLAGS="$XFT_CFLAGS $CPPFLAGS" fi if test $BUILD_SERVER = x11; then if test $set_x_paths = no; then as_fn_error $? "No X11 libraries/headers for building x11 server" "$LINENO" 5 fi if test "$ac_cv_lib_Xt_main" = no; then as_fn_error $? "libXt not found - required for building x11 server" "$LINENO" 5 fi if test "$ac_cv_lib_Xext" = no; then as_fn_error $? "libXext not found - required for building x11 server" "$LINENO" 5 fi if test "x$WITH_GLX" = "xyes"; then LIBS="$GLX_LIBS $LIBS" CPPFLAGS="$GLX_CFLAGS $CPPFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: Warning : no OpenGL support for X11 backend" >&5 $as_echo "$as_me: Warning : no OpenGL support for X11 backend" >&6;} fi fi if test $BUILD_SERVER = win32; then if test "x$WITH_WGL" = "xyes"; then LIBS="$LIBS $WGL_LIBS" CPPFLAGS="$CPPFLAGS $WGL_CFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: Warning : no OpenGL support for win32 backend" >&5 $as_echo "$as_me: Warning : no OpenGL support for win32 backend" >&6;} fi fi cat >>confdefs.h <<_ACEOF #define BUILD_SERVER SERVER_$BUILD_SERVER _ACEOF cat >>confdefs.h <<_ACEOF #define BUILD_GRAPHICS GRAPHICS_$BUILD_GRAPHICS _ACEOF #-------------------------------------------------------------------- # Check for -Wdeclaration-after-statement #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5 $as_echo_n "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wdeclaration-after-statement" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : HAS_W_DECL_AFTER_STATEMENT=yes else HAS_W_DECL_AFTER_STATEMENT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$saved_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_W_DECL_AFTER_STATEMENT" >&5 $as_echo "$HAS_W_DECL_AFTER_STATEMENT" >&6; } if test x"$HAS_W_DECL_AFTER_STATEMENT" = x"yes"; then WARN_FLAGS="-Wall -Wdeclaration-after-statement" else WARN_FLAGS=-Wall fi #-------------------------------------------------------------------- # Set the name of the backend #-------------------------------------------------------------------- # Check whether --with-name was given. if test "${with_name+set}" = set; then : withval=$with_name; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Backend name" >&5 $as_echo_n "checking Backend name... " >&6; } if test "x$with_name" = "x"; then BACKEND_NAME=back else BACKEND_NAME=${with_name} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BACKEND_NAME" >&5 $as_echo "$BACKEND_NAME" >&6; } ac_config_files="$ac_config_files back.make config.make" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "back.make") CONFIG_FILES="$CONFIG_FILES back.make" ;; "config.make") CONFIG_FILES="$CONFIG_FILES config.make" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test $BUILD_GRAPHICS = art || test $BUILD_GRAPHICS = xlib || test $BUILD_GRAPHICS = xdps; then : cat < # # This file is part of the GNUstep Backend. # # 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 3 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; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. builtin(include, pkg.m4)dnl AC_INIT AC_PREREQ(2.57) AC_CONFIG_SRCDIR([back.make.in]) AC_CONFIG_HEADER(config.h) # If GNUSTEP_MAKEFILES is undefined, try to use gnustep-config to determine it. if test -z "$GNUSTEP_MAKEFILES"; then GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5` fi if test -z "$GNUSTEP_MAKEFILES"; then AC_MSG_ERROR([You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!]) fi #-------------------------------------------------------------------- # Use config.guess, config.sub and install-sh provided by gnustep-make #-------------------------------------------------------------------- AC_CONFIG_AUX_DIR($GNUSTEP_MAKEFILES) #-------------------------------------------------------------------- # Determine the host, build, and target systems #-------------------------------------------------------------------- AC_CANONICAL_TARGET([]) #-------------------------------------------------------------------- # Find the compiler #-------------------------------------------------------------------- MAKECC=`gnustep-config --variable=CC` MAKECPP=`gnustep-config --variable=CPP` MAKECXX=`gnustep-config --variable=CXX` if test "$CC" = ""; then CC=$MAKECC else if test "$CC" != "$MAKECC"; then AC_MSG_WARN([You are running configure with the compiler ($CC) set to a different value from that used by gnustep-make ($MAKECC). To a void conflicts/problems, reconfigure/reinstall gnustep-make to use $CC or run the gnustep-base configure again with your CC environment var iable set to $MAKECC]) fi fi if test "$CPP" = ""; then CPP=$MAKECPP else if test "$CPP" != "$MAKECPP"; then AC_MSG_WARN([You are running configure with the preprocessor ($CPP) set to a different value from that used by gnustep-make ($MAKECPP). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CPP or run the gnustep-base configure again with your CPP environ ment variable set to $MAKECPP]) fi fi if test "$CXX" = ""; then CXX=$MAKECXX else if test "$CXX" != "$MAKECXX"; then AC_MSG_WARN([You are running configure with the compiler ($CXX) set to a different value from that used by gnustep-make ($MAKECXX). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CXX or run the gnustep-base configure again with your CXX environment variable set to $MAKECXX]) fi fi AC_PROG_CC AC_PROG_CPP #-------------------------------------------------------------------- # The following is so that headers and custom libraries # in the GNUstep root are used before the standard ones #-------------------------------------------------------------------- GRAPHIC_CFLAGS="$CPPFLAGS" GRAPHIC_LFLAGS="$LDFLAGS" # # It looks like we ought to source the whole GNUstep.sh here, and even # ask it to output all variables! That way we have access to (eg) # GNUSTEP_SYSTEM_HEADERS below. # GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes . "$GNUSTEP_MAKEFILES/GNUstep.sh" unset GNUSTEP_SH_EXPORT_ALL_VARIABLES # For backwards compatibility, define GNUSTEP_SYSTEM_HEADERS from # GNUSTEP_SYSTEM_ROOT if not set yet. if test x"$GNUSTEP_SYSTEM_HEADERS" = x""; then GNUSTEP_SYSTEM_HEADERS="$GNUSTEP_SYSTEM_ROOT/Library/Headers" fi if test x"$GNUSTEP_SYSTEM_LIBRARIES" = x""; then GNUSTEP_SYSTEM_LIBRARIES="$GNUSTEP_SYSTEM_ROOT/Library/Libraries" fi if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES/$obj_dir GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS/$LIBRARY_COMBO else GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS fi CPPFLAGS="$CPPFLAGS -I$GNUSTEP_HDIR" LDFLAGS="$LDFLAGS -L$GNUSTEP_LDIR/$LIBRARY_COMBO -L$GNUSTEP_LDIR" #-------------------------------------------------------------------- # Add target OS directories as necessary #-------------------------------------------------------------------- case "$target_os" in freebsd* | openbsd* ) CPPFLAGS="-I/usr/pkg/include $CPPFLAGS" LDFLAGS="-L/usr/pkg/lib $LDFLAGS";; netbsd*) CPPFLAGS="-I/usr/pkg/include $CPPFLAGS" LDFLAGS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib $LDFLAGS";; esac #-------------------------------------------------------------------- # These headers/functions needed by gpbs.m #-------------------------------------------------------------------- AC_CHECK_HEADERS(syslog.h) AC_CHECK_FUNCS(syslog) #-------------------------------------------------------------------- # Find TIFF (Solaris requires this to find the correct library, even though # it does not link directly to it) #-------------------------------------------------------------------- AC_ARG_WITH(tiff_library, [ --with-tiff-library=DIR TIFF library file are in DIR], , with_tiff_library=) if test -n "$with_tiff_library"; then GRAPHIC_LFLAGS="$GRAPHIC_LFLAGS -L$with_tiff_library" fi #-------------------------------------------------------------------- # Find for X windows #-------------------------------------------------------------------- set_x_paths=yes AC_PATH_XTRA if test "x$no_x" = xyes; then set_x_paths=no fi PKG_PROG_PKG_CONFIG if test $set_x_paths = yes; then GRAPHIC_CFLAGS="$GRAPHIC_CFLAGS $X_CFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" # Note: Don't include $X_LIBS in LDFLAGS as it may conflict with # other libraries installed in /sw, /sw/lib/freetyp2/lib #GRAPHIC_LFLAGS="$X_LIBS $GRAPHIC_LFLAGS" # But do include it here just to find the extra x libraries LDFLAGS="$LDFLAGS $X_LIBS" LIBS="-lX11 $X_EXTRA_LIBS $LIBS" AC_CHECK_LIB(Xext, main) if test "$HAVE_LIBXext" = no; then PKG_CHECK_MODULES([XEXT], [xext]) fi AC_CHECK_LIB(Xt, main) if test "$HAVE_LIBXt" = no; then PKG_CHECK_MODULES([XT], [xt]) fi AC_CHECK_LIB(Xmu, main) if test "$HAVE_LIBXmu" = no; then PKG_CHECK_MODULES([XMU], [xmu]) fi AC_CHECK_LIB(Xfixes, XFixesSelectSelectionInput, [ LIBS="-lXfixes $LIBS" AC_DEFINE(HAVE_XFIXES, 1, [Define to enable Xfixes support]) ] ,) AC_CHECK_LIB(Xcursor, XcursorImageCreate, [ LIBS="-lXcursor $LIBS" AC_DEFINE(HAVE_XCURSOR, 1, [Define to enable Xcursor support]) ] ,) have_xshape=no AC_CHECK_HEADERS(X11/extensions/shape.h, have_xshape=yes,, [#include ]) if test $have_xshape = yes; then AC_CHECK_LIB(Xext, XShapeCombineMask, [ AC_DEFINE(HAVE_XSHAPE, 1, [Define to enable Xshape support]) ] ,) fi AC_CHECK_HEADERS(X11/extensions/sync.h,,, [#include #include ]) have_xrandr=no AC_CHECK_HEADERS(X11/extensions/Xrandr.h, have_xrandr=yes,,) if test $have_xrandr = yes; then AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration, [ LIBS="-lXrandr $LIBS" AC_DEFINE(HAVE_XRANDR, 1, [Define to enable Xrandr support]) ] ,) fi LIBS="$X_LIBS $LIBS" fi AC_SUBST(X_PRE_LIBS) # Old X11 support AC_MSG_CHECKING([for X11 function prototypes]) AC_EGREP_CPP(yes, [#include #if NeedFunctionPrototypes yes #endif ], have_funcproto=yes, have_funcproto=no) AC_MSG_RESULT([$have_funcproto]) if test "$have_funcproto" = no; then AC_DEFINE(FUNCPROTO,1,[Define if X11 doesn't automatically use prototypes]) fi #-------------------------------------------------------------------- # Find for DPS #-------------------------------------------------------------------- save_CPPFLAGS=${CPPFLAGS} if test -r $x_includes/X11/DPS; then CPPFLAGS="-I$x_includes/X11 $CPPFLAGS" fi AC_CHECK_HEADERS([DPS/dpsclient.h DPS/dpsNXargs.h]) if test $ac_cv_header_DPS_dpsNXargs_h = no; then CPPFLAGS="${save_CPPFLAGS}" fi #-------------------------------------------------------------------- # freetype libraries #-------------------------------------------------------------------- # Mac OS X with macports has a freetype which includes Apple's Foundation # which we do not want AC_ARG_WITH(freetype, [ --without-freetype Do not check for or include freetype], , with_freetype=yes) have_freetype=no if test $with_freetype = yes; then PKG_CHECK_MODULES([FREETYPE], [freetype2]) if test x"$FREETYPE_LIBS" != x; then save_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${FREETYPE_CFLAGS} ${CPPFLAGS}" AC_CHECK_HEADER(ft2build.h,have_freetype=yes, have_freetype=no) CPPFLAGS="${save_CPPFLAGS}" fi fi #-------------------------------------------------------------------- # Extended font support & UTF8 support #-------------------------------------------------------------------- PKG_CHECK_MODULES(XFT, xft, WITH_XFT=yes, WITH_XFT=no) if test $WITH_XFT = no; then # pkg-config failed for some reason, Check the old way? save_CPPFLAGS=${CPPFLAGS} save_LIBS=${LIBS} if test $have_freetype = yes; then LIBS="$FREETYPE_LIBS $LIBS" CPPFLAGS="$FREETYPE_CFLAGS $CPPFLAGS" fi AC_CHECK_LIB(Xft, XftFontOpen) AC_CHECK_HEADER(X11/Xft/Xft.h) if test "$ac_cv_lib_Xft_XftFontOpen" = yes -a "$ac_cv_header_X11_Xft_Xft_h" = yes; then WITH_XFT=yes XFT_LIBS="-lXft $FREETYPE_LIBS" XFT_CFLAGS="$FREETYPE_CFLAGS" fi CPPFLAGS=${save_CPPFLAGS} LIBS=${save_LIBS} else WITH_XFT=yes fi if test $WITH_XFT = yes; then # Now add in some extra defines depending on what we have. save_CPPFLAGS=${CPPFLAGS} save_LIBS=${LIBS} CPPFLAGS="$XFT_CFLAGS $CPPFLAGS" LIBS="$XFT_LIBS $LIBS" AC_DEFINE(HAVE_XFT,1,[Define if you have a functional XFreeType installation, including libXft.]) AC_CHECK_LIB(Xft, XftDrawStringUtf8, have_utf8=yes, have_utf8=no) if test "$have_utf8" = yes; then AC_DEFINE(HAVE_UTF8,1,[Define if you have XftDrawStringUtf8]) fi AC_CHECK_LIB(Xft, XftPatternGetString, have_xftpgs=yes, have_xftpgs=no) AC_HAVE_FUNCS(Xutf8LookupString) AC_CHECK_LIB(fontconfig, FcPatternCreate, have_fc=yes, have_fc=no) AC_CHECK_HEADER(fontconfig/fontconfig.h) if test "$have_fc" = yes -a "$ac_cv_header_fontconfig_fontconfig_h" = yes; then XFT_LIBS="${XFT_LIBS} -lfontconfig" AC_DEFINE(HAVE_FC,1,[Define if you have FcPatternCreate]) fi CPPFLAGS=${save_CPPFLAGS} LIBS=${save_LIBS} fi AC_SUBST(WITH_XFT) #-------------------------------------------------------------------- # GLX support #-------------------------------------------------------------------- WITH_GLX=no AC_ARG_ENABLE(glx, [ --disable-glx Disable GLX support],, enable_glx=yes) if test "x$enable_glx" = "xyes"; then AC_CHECK_LIB(GL, glXMakeContextCurrent, have_glx=yes, have_glx=no) AC_CHECK_HEADER(GL/glx.h) AC_MSG_CHECKING([for GLX_RGBA_TYPE]) AC_EGREP_CPP(yes, [#include #ifdef GLX_RGBA_TYPE yes #endif ], have_glx_rgba=yes, have_glx_rgba=no) AC_MSG_RESULT([$have_glx_rgba]) if test "$have_glx" = yes -a "$ac_cv_header_GL_glx_h" = yes -a "$have_glx_rgba" = yes; then GLX_LIBS="-lGL" GLX_FLAGS="" WITH_GLX=yes AC_DEFINE(HAVE_GLX,1,[Define if you have the glx library]) fi fi AC_SUBST(WITH_GLX) #-------------------------------------------------------------------- # XIM support #-------------------------------------------------------------------- AC_ARG_ENABLE(xim, [ --disable-xim Disable XIM support],, enable_xim=yes) if test "x$enable_xim" = "xyes"; then AC_DEFINE(USE_XIM,1,[Define to enable XIM support]) fi #-------------------------------------------------------------------- # Functions #-------------------------------------------------------------------- AC_HAVE_FUNCS(usleep) have_xshm=no AC_CHECK_HEADERS(X11/extensions/XShm.h, have_xshm=yes,, [#include ]) AC_CHECK_FUNCS(shmctl) if test "$ac_cv_header_X11_extensions_XShm_h" = yes -a "$ac_cv_func_shmctl" = yes; then AC_DEFINE(XSHM,1,[Define if you have X11 XShm extensions]) fi AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE([HAVE_XINTERNATOMS], 1, [Define to 1 if you have 'XInternAtoms' function.]), , $X_LIBS) #-------------------------------------------------------------------- # Window's graphics library #-------------------------------------------------------------------- AC_CHECK_LIB(gdi32, main, have_gdi32=yes, have_gdi32=no) if test "$have_gdi32" = yes; then WIN32_LIBS="-lgdi32 -lm" fi AC_CHECK_LIB(msimg32, main, have_msimg32=yes, have_msimg32=no) if test "$have_msimg32" = yes; then WIN32_LIBS="${WIN32_LIBS} -lmsimg32" fi AC_CHECK_LIB(imm32, main, have_imm32=yes, have_imm32=no) if test "$have_imm32" = yes; then WIN32_LIBS="${WIN32_LIBS} -limm32" fi #-------------------------------------------------------------------- # WGL support #-------------------------------------------------------------------- WITH_WGL=no AC_ARG_ENABLE(wgl, [ --disable-wgl Disable WGL support],, enable_wgl=yes) if test "x$enable_wgl" = "xyes"; then AC_CHECK_LIB(opengl32, main, have_wgl=yes, have_wgl=no) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS" AC_CHECK_HEADER(windows.h) CPPFLAGS="$save_CPPFLAGS" if test "$have_wgl" = yes -a "$ac_cv_header_windows_h" = yes; then AC_MSG_CHECKING([for wgl]) WGL_LIBS="-lopengl32 -lgdi32" WGL_CFLAGS="" save_libs="$LIBS" LIBS="$WGL_LIBS" AC_TRY_LINK([#include ], [ wglCreateContext(0); ], [use_wgl=yes], [use_wgl=no]) LIBS="$save_libs" AC_MSG_RESULT([$use_wgl]) WITH_WGL=$use_wgl AC_DEFINE(HAVE_WGL,1,[Define if you have the wgl library]) fi fi AC_SUBST(WITH_WGL) #-------------------------------------------------------------------- # libart graphics libraries #-------------------------------------------------------------------- AC_MSG_CHECKING([for libart2]) LIBART_VERSION="`libart2-config --version 2>/dev/null`" if test x"$LIBART_VERSION" = x; then LIBART_VERSION="none" fi AC_MSG_RESULT([$LIBART_VERSION]) LIBART_LIBS="`libart2-config --libs 2>/dev/null`" LIBART_CFLAGS="`libart2-config --cflags 2>/dev/null`" if test x"$LIBART_LIBS" = x; then # No libart2-config, is there any point in checking for individual libs? AC_CHECK_LIB(art_lgpl_2, main, have_libart=yes, have_libart=no) if test "$have_libart" = yes; then AC_CHECK_HEADER(libart_lgpl/libart.h,have_libart=yes, have_libart=no) fi if test "$have_libart" = yes; then LIBART_LIBS="-lart_lgpl_2" fi else have_libart=yes fi #-------------------------------------------------------------------- # Cairo graphics libraries #-------------------------------------------------------------------- PKG_CHECK_MODULES(CAIRO, cairo, have_cairo=yes, have_cairo=no) PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=yes, have_cairo_ft=no) PKG_CHECK_MODULES(CAIRO_XLIB, cairo-xlib, have_cairo_xlib=yes, have_cairo_xlib=no) PKG_CHECK_MODULES(CAIRO_WIN32, cairo-win32, have_cairo_win32=yes, have_cairo_win32=no) PKG_CHECK_MODULES(CAIRO_GLITZ, cairo-glitz, have_cairo_glitz=yes, have_cairo_glitz=no) PKG_CHECK_MODULES(FONTCONFIG, fontconfig, have_fontconfig=yes, have_fontconfig=no) if test "$have_cairo" = no; then AC_CHECK_LIB(cairo, cairo_create, have_cairo=yes) fi if test "$have_cairo_ft" = no; then AC_CHECK_LIB(cairo, cairo_ft_font_face_create_for_ft_face, have_cairo_ft=yes) fi if test "$have_cairo_xlib" = no; then AC_CHECK_LIB(cairo, cairo_xlib_surface_create, have_cairo_xlib=yes) fi if test "$have_cairo_win32" = no; then AC_CHECK_LIB(cairo, cairo_win32_surface_create, have_cairo_win32=yes) fi #-------------------------------------------------------------------- # XRender support #-------------------------------------------------------------------- have_xrender=no AC_CHECK_LIB(Xrender, XRenderFindVisualFormat, have_xrender=yes) #-------------------------------------------------------------------- # Glitz libraries #-------------------------------------------------------------------- WITH_GLITZ=no AC_ARG_ENABLE(glitz, [ --enable-glitz Enable Glitz support],, enable_glitz=no) if test "x$enable_glitz" = "xyes"; then PKG_CHECK_MODULES(GLITZ, glitz, have_glitz=yes, have_glitz=no) save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GLITZ_CFLAGS" AC_CHECK_HEADER(glitz.h,have_glitz_h=yes, have_glitz_h=no) CPPFLAGS=$save_CPPFLAGS if test "$have_glitz" = yes -a "$have_glitz_h" = yes; then if test "x$WITH_GLX" = "xyes"; then PKG_CHECK_MODULES(GLITZ_GLX, glitz-glx, have_glitz_glx=yes, have_glitz_glx=no) save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GLITZ_GLX_CFLAGS" AC_CHECK_HEADER(glitz-glx.h,have_glitz_glx_h=yes, have_glitz_glx_h=no) CPPFLAGS=$save_CPPFLAGS if test "$have_glitz_glx" = yes -a "$have_glitz_glx_h" = yes; then GLITZ_LIBS="$GLITZ_LIBS $GLITZ_GLX_LIBS" GLITZ_CFLAGS="$GLITZ_CFLAGS $GLITZ_GLX_CFLAGS" AC_DEFINE(HAVE_GLITZ_GLX,1,[Define if you have glitz-glx]) WITH_GLITZ=yes fi fi if test "x$WITH_WGL" = "xyes"; then PKG_CHECK_MODULES(GLITZ_WGL, glitz-wgl, have_glitz_wgl=yes, have_glitz_wgl=no) save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GLITZ_WGL_CFLAGS" AC_CHECK_HEADER(glitz-wgl.h,have_glitz_wgl_h=yes, have_glitz_wgl_h=no) CPPFLAGS=$save_CPPFLAGS if test "$have_glitz_wgl" = yes -a "$have_glitz_wgl_h" = yes; then GLITZ_LIBS="$GLITZ_LIBS $GLITZ_WGL_LIBS" GLITZ_CFLAGS="$GLITZ_CFLAGS $GLITZ_WGL_CFLAGS" AC_DEFINE(HAVE_GLITZ_WGL,1,[Define if you have glitz-wgl]) WITH_GLITZ=yes fi fi if test "$WITH_GLITZ" != "yes" ; then AC_MSG_ERROR([Invalid glitz backend : glitz-glx or glitz-wgl required.]) AC_MSG_NOTICE([Glitz disable]) fi AC_DEFINE(USE_GLITZ,1,[Define to enable glitz support]) fi AC_SUBST(WITH_GLITZ) fi #-------------------------------------------------------------------- # Set definitions #-------------------------------------------------------------------- WITH_WRASTER=no AC_SUBST(WITH_WRASTER) # Revert to previous flags (removing added GNUstep flags) CPPFLAGS=${GRAPHIC_CFLAGS} LDFLAGS=${GRAPHIC_LFLAGS} #-------------------------------------------------------------------- # Which projects should we build? #-------------------------------------------------------------------- BUILD_SERVER=x11 BUILD_GRAPHICS=cairo case $target_os in *mingw32* ) BUILD_SERVER=win32 BUILD_GRAPHICS=winlib;; esac AC_ARG_ENABLE(server, [ --enable-server=SRV Build server type: x11, win32, wayland],, enable_server=$BUILD_SERVER) AC_ARG_ENABLE(graphics, [ --enable-graphics=GPH Build graphics: xlib, xdps, winlib, art, cairo, opal],, enable_graphics="$BUILD_GRAPHICS") BUILD_SERVER=$enable_server BUILD_GRAPHICS="$enable_graphics" AC_MSG_CHECKING(Backend Server) AC_MSG_RESULT($BUILD_SERVER) AC_MSG_CHECKING(Backend Graphics) AC_MSG_RESULT($BUILD_GRAPHICS) if test x"$BUILD_GRAPHICS" = "xcairo"; then if test "$have_freetype" = no; then AC_MSG_WARN([can't find freetype, required for graphics=cairo]) if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib elif test $BUILD_SERVER = wayland; then AC_MSG_ERROR([wayland backend requires cairo]) else BUILD_GRAPHICS=xlib fi AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) elif test "$have_cairo" = no -o "$have_cairo-ft" = no ; then AC_MSG_WARN([can't find cairo, required for graphics=cairo!]) if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib elif test $BUILD_SERVER = wayland; then AC_MSG_ERROR([wayland backend requires cairo]) else BUILD_GRAPHICS=art fi AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) elif test $BUILD_SERVER = win32 -a "$have_fontconfig" = no ; then AC_MSG_WARN([can't find fontconfig, required for graphics=cairo!]) BUILD_GRAPHICS=winlib AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) else AC_MSG_CHECKING(Cairo backend) CAIRO_LIBS="$CAIRO_FT_LIBS" CAIRO_CFLAGS="$CAIRO_FT_CFLAGS" if test $BUILD_SERVER = win32; then CAIRO_LIBS="$CAIRO_LIBS $FONTCONFIG_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $FONTCONFIG_CFLAGS" fi if test "$have_xrender" = yes; then if test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then AC_DEFINE(XRENDER,1,[Define if you have X11 XRender extension]) CAIRO_LIBS="$CAIRO_LIBS -lXrender" fi fi if test "x$WITH_GLITZ" = "xyes" -a "x$have_cairo_glitz" = "xyes"; then if test $BUILD_SERVER = win32 -a "x$have_cairo_win32" = "xyes"; then CAIRO_GLITZ_LIBS="$CAIRO_GLITZ_LIBS $GLITZ_WGL_LIBS" CAIRO_GLITZ_CFLAGS="$CAIRO_GLITZ_CFLAGS $GLITZ_WGL_CFLAGS" elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then CAIRO_GLITZ_LIBS="$CAIRO_GLITZ_LIBS $GLITZ_GLX_LIBS" CAIRO_GLITZ_CFLAGS="$CAIRO_GLITZ_CFLAGS $GLITZ_GLX_CFLAGS" else AC_MSG_ERROR([Invalid Glitz installation]) fi CAIRO_LIBS="$CAIRO_LIBS $CAIRO_GLITZ_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_GLITZ_CFLAGS" AC_MSG_RESULT(glitz) AC_MSG_WARN([**** Cairo-over-Glitz backend is highly experimental]) AC_MSG_WARN([**** You definitively shouldn't do that.]) AC_MSG_WARN([**** It actually does not work !]) AC_MSG_WARN([**** Are you a backend developer ?]) elif test $BUILD_SERVER = win32 -a "x$have_cairo_win32" = "xyes"; then CAIRO_LIBS="$CAIRO_LIBS $CAIRO_WIN32_LIBS $WIN32_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_WIN32_CFLAGS" AC_MSG_RESULT(winlib) #AC_MSG_WARN([**** Cairo backend on win32 is experimental and is not supported.]) #AC_MSG_WARN([**** Are you a backend developer ?]) elif test $BUILD_SERVER = x11 -a "x$have_cairo_xlib" = "xyes"; then CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XLIB_LIBS $XFT_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XLIB_CFLAGS" AC_MSG_RESULT(xlib) elif test $BUILD_SERVER = wayland; then AC_CHECK_HEADERS(wayland-util.h,, [AC_MSG_ERROR([**** No wayland-util.h. Install libwayland-dev or equivalent.])]) AC_CHECK_LIB(wayland-client, wl_display_flush,, [AC_MSG_ERROR([**** No wl_display_flush in libwayland-client. Install correct version of libwayland-dev or equivalent.])]) AC_CHECK_HEADERS(xkbcommon/xkbcommon.h,, [AC_MSG_ERROR([**** No xkbcommon/xkbcommon.h. Required for wayland. Install libxkbcommon-dev or equivalent.])]) AC_CHECK_LIB(xkbcommon, xkb_context_new,, [AC_MSG_ERROR([**** No xkb_context_new in libxkbcommon. Install correct version of libxkbcommon-dev or equivalent.])]) CAIRO_LIBS="$CAIRO_LIBS $XFT_LIBS" CAIRO_CFLAGS="$CAIRO_CFLAGS" LIBS="-lwayland-client -lxkbcommon $LIBS" else AC_MSG_ERROR([Invalid Cairo installation]) fi LIBS="$CAIRO_LIBS $LIBS" CPPFLAGS="$CAIRO_CFLAGS $CPPFLAGS" fi fi if test x"$BUILD_GRAPHICS" = "xxdps"; then CPPFLAGS="-I$x_includes/X11 $CPPFLAGS" LIBS="-ldpstk -ldps -lpsres -lXt $X_PRE_LIBS $LIBS" elif test x"$BUILD_GRAPHICS" = "xcairo"; then : # Alread handled above elif test x"$BUILD_GRAPHICS" = "xart"; then if test "$have_freetype" = no; then AC_MSG_WARN([can't find freetype, required for graphics=art]) if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) elif test "$have_libart" = no; then AC_MSG_WARN([can't find libart, required for graphics=art]) if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) else LIBS="$LIBART_LIBS $FREETYPE_LIBS $LIBS" CPPFLAGS="$LIBART_CFLAGS $FREETYPE_CFLAGS $CPPFLAGS" fi elif test x"$BUILD_GRAPHICS" = "xxlib"; then LIBS="$FREETYPE_LIBS $LIBS" elif test x"$BUILD_GRAPHICS" = "xwinlib"; then : # Nothing to do elif test x"$BUILD_GRAPHICS" = "xopal"; then CPPFLAGS="$FONTCONFIG_CFLAGS $FREETYPE_CFLAGS $CPPFLAGS" LIBS="-lopal -lgnustep-corebase $LIBS" LIBS="$FONTCONFIG_LIBS $FREETYPE_LIBS $LIBS" if test "$have_freetype" = no ; then # FCFaceInfo requires this AC_MSG_WARN([can't find freetype, required for graphics=opal!]) if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) elif test "$have_fontconfig" = no ; then AC_MSG_WARN([can't find fontconfig, required for graphics=opal!]) if test $BUILD_SERVER = win32; then BUILD_GRAPHICS=winlib else BUILD_GRAPHICS=xlib fi AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS]) fi else AC_MSG_ERROR([Invalid graphics backend $BUILD_GRAPHICS]) fi if test x"$BUILD_GRAPHICS" = "xwinlib"; then LIBS="$WIN32_LIBS $LIBS" fi if test x"$BUILD_GRAPHICS" = "xxlib"; then LIBS="$XFT_LIBS $LIBS" CPPFLAGS="$XFT_CFLAGS $CPPFLAGS" fi if test $BUILD_SERVER = x11; then if test $set_x_paths = no; then AC_MSG_ERROR([No X11 libraries/headers for building x11 server]) fi if test "$ac_cv_lib_Xt_main" = no; then AC_MSG_ERROR([libXt not found - required for building x11 server]) fi if test "$ac_cv_lib_Xext" = no; then AC_MSG_ERROR([libXext not found - required for building x11 server]) fi if test "x$WITH_GLX" = "xyes"; then LIBS="$GLX_LIBS $LIBS" CPPFLAGS="$GLX_CFLAGS $CPPFLAGS" else AC_MSG_NOTICE([Warning : no OpenGL support for X11 backend]) fi fi if test $BUILD_SERVER = win32; then if test "x$WITH_WGL" = "xyes"; then LIBS="$LIBS $WGL_LIBS" CPPFLAGS="$CPPFLAGS $WGL_CFLAGS" else AC_MSG_NOTICE([Warning : no OpenGL support for win32 backend]) fi fi AH_TOP([ #define SERVER_x11 1 #define SERVER_win32 2 #define SERVER_wayland 3 #define GRAPHICS_xdps 0 #define GRAPHICS_art 1 #define GRAPHICS_xlib 2 #define GRAPHICS_winlib 3 #define GRAPHICS_cairo 4 #define GRAPHICS_opal 5 ]) AC_DEFINE_UNQUOTED(BUILD_SERVER,SERVER_$BUILD_SERVER, [Define to type of window server to build]) AC_DEFINE_UNQUOTED(BUILD_GRAPHICS,GRAPHICS_$BUILD_GRAPHICS, [Define to type of graphics context to build]) AC_SUBST(BUILD_GRAPHICS) AC_SUBST(BUILD_SERVER) #-------------------------------------------------------------------- # Check for -Wdeclaration-after-statement #-------------------------------------------------------------------- AC_MSG_CHECKING(whether the compiler supports -Wdeclaration-after-statement) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wdeclaration-after-statement" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],HAS_W_DECL_AFTER_STATEMENT=yes,HAS_W_DECL_AFTER_STATEMENT=no) CFLAGS="$saved_CFLAGS" AC_MSG_RESULT($HAS_W_DECL_AFTER_STATEMENT) if test x"$HAS_W_DECL_AFTER_STATEMENT" = x"yes"; then WARN_FLAGS="-Wall -Wdeclaration-after-statement" else WARN_FLAGS=-Wall fi AC_SUBST(WARN_FLAGS) #-------------------------------------------------------------------- # Set the name of the backend #-------------------------------------------------------------------- AC_ARG_WITH(name, [ --with-name=PREFIX Set the name of the backend (def=back)]) AC_MSG_CHECKING(Backend name) if test "x$with_name" = "x"; then BACKEND_NAME=back else BACKEND_NAME=${with_name} fi AC_MSG_RESULT($BACKEND_NAME) AC_SUBST(BACKEND_NAME) AC_CONFIG_FILES([back.make config.make]) AC_OUTPUT AS_IF([test $BUILD_GRAPHICS = art || test $BUILD_GRAPHICS = xlib || test $BUILD_GRAPHICS = xdps], [ cat < Vendor: The GNUstep Project URL: http://www.gnustep.org/ %description This is a backend for the GNUstep gui Library which allows you to use the GNUstep gui Library on an X Windows System (other backends will be added later to allow you to use the GNUstep gui Library in other windowing environments). This package includes development headers too. gnustep-back-0.29.0/install-sh000077500000000000000000000042121404163720200161670ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$cpprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 gnustep-back-0.29.0/install.sh000077500000000000000000000002331404163720200161670ustar00rootroot00000000000000#! /bin/sh PREFIX=$1 MAKE=${2:-make} . $PREFIX/System/Library/Makefiles/GNUstep.sh $MAKE GNUSTEP_INSTALLATION_DOMAIN=SYSTEM messages=yes install exit 0 gnustep-back-0.29.0/pkg.m4000066400000000000000000000240071404163720200152120ustar00rootroot00000000000000# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR gnustep-back-0.29.0/wayland-regenerate.sh000077500000000000000000000005751404163720200203100ustar00rootroot00000000000000#!/bin/bash # This script is used to regenerate xdg-shell-protocol public code and headers # from the XML specification. wayland-scanner public-code /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml Source/wayland/xdg-shell-protocol.c wayland-scanner client-header /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml Headers/wayland/xdg-shell-client-protocol.h